> ## Documentation Index
> Fetch the complete documentation index at: https://docs.runflow.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# CLI Overview

> Command line interface to manage AI agents, knowledge bases, and prompts via API Portal

<CardGroup cols={3}>
  <Card title="Installation" icon="download" href="/cli/installation">
    Install the CLI tool
  </Card>

  <Card title="Create Agent" icon="plus" href="/cli/create">
    Create agents from templates
  </Card>

  <Card title="Login & Profiles" icon="key" href="/cli/login">
    Authenticate and manage profiles
  </Card>

  <Card title="Agents" icon="robot" href="/cli/agents">
    Manage your AI agents
  </Card>

  <Card title="Knowledge Base" icon="database" href="/cli/kb">
    Manage vector stores for RAG
  </Card>

  <Card title="Prompts" icon="file-lines" href="/cli/prompts">
    Manage prompt templates
  </Card>

  <Card title="Profiles" icon="users" href="/cli/profiles">
    Multi-tenant profile management
  </Card>

  <Card title="Test" icon="flask" href="/cli/test">
    Test agents locally with web interface
  </Card>
</CardGroup>

## What is Runflow CLI?

RunFlow CLI is a powerful command line interface to manage AI agents via **API Portal**. Create agents from templates, manage knowledge bases, handle prompts, and switch between multiple tenants — all from the terminal.

## Key Features

* 🚀 **Create agents from templates** with `rf create`
* 🧠 **Manage knowledge bases** (vector stores) with `rf kb`
* 📝 **Full prompts management** with CRUD and editor integration
* 👥 **Multi-tenant profiles** - switch between API keys easily
* 🧪 **Local testing** with web interface and live reload
* 🤖 **AI-friendly** - non-interactive flags for automation

## Quick Start

```bash theme={null}
# 1. Authenticate with your API key
rf login

# 2. Create a new agent from template
rf create

# 3. Navigate to the created folder
cd my-agent/

# 4. Test locally with web interface
rf test

# 5. Deploy to production
rf agents deploy
```

## Main Commands

| Command      | Description                                       |
| ------------ | ------------------------------------------------- |
| `rf create`  | Create new agents from templates ⭐                |
| `rf login`   | Authenticate with RunFlow API                     |
| `rf switch`  | Switch between saved profiles                     |
| `rf agents`  | Manage AI agents (deploy, clone, duplicate)       |
| `rf kb`      | Manage knowledge bases for RAG                    |
| `rf prompts` | Manage prompt templates (CRUD)                    |
| `rf test`    | Start local development server with web interface |

## Interactive & Non-Interactive Modes

All commands support both **interactive** and **non-interactive** modes:

### Interactive Mode (Default)

Perfect for developers working manually:

```bash theme={null}
rf create           # Walks you through agent creation
rf login            # Prompts for API key
rf prompts create   # Opens editor for content
```

### Non-Interactive Mode

Perfect for scripts, CI/CD, and AI tools (Cursor, Copilot):

```bash theme={null}
rf create --name my-agent --template starter --yes
rf login --api-key sk-xxx --profile prod
rf prompts create support --content "You are a helpful assistant"
rf kb upload docs ./files --yes
rf agents delete --yes
```

<Tip>
  Use `--yes` or `-y` to skip confirmations in scripts and automation!
</Tip>

## Multi-Tenant Support

Manage multiple API keys and switch between them easily:

```bash theme={null}
# Save profiles for different clients
rf login --profile acme-corp
rf login --profile tech-startup

# Switch between profiles
rf switch acme-corp
rf agents list

rf switch tech-startup
rf agents list

# List all profiles
rf profiles
```

## Local Development

Test your agents locally before deploying:

```bash theme={null}
cd my-agent/
rf test
```

**Features:**

* Zero config - auto-detects from `.runflow/rf.json`
* Web portal with real-time monitoring
* Live reload on file changes
* Traces saved to `.runflow/traces.json`

## Complete Workflow Example

```bash theme={null}
# 1. Login and create agent
rf login
rf create
# → Select "RAG Agent" template
# → Name: "support-bot"

# 2. Navigate and set up knowledge base
cd support-bot/
rf kb create support-docs
rf kb upload support-docs ./docs --yes

# 3. Create prompt template
rf prompts create system --content "You are a support assistant"

# 4. Test locally
rf test

# 5. Deploy to production
rf agents deploy
```

## Next Steps

<CardGroup cols={3}>
  <Card title="Installation" icon="download" href="/cli/installation">
    Install the CLI
  </Card>

  <Card title="Create Agent" icon="plus" href="/cli/create">
    Create your first agent
  </Card>

  <Card title="Login" icon="key" href="/cli/login">
    Authenticate
  </Card>
</CardGroup>
