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

# SiteGPT CLI

> Manage SiteGPT chatbots, knowledge, settings, conversations, and account operations from a terminal or AI agent.

The SiteGPT CLI is the first-party command line interface for managing SiteGPT from a terminal, script, or AI assistant. It lets you create chatbots, add training content, configure appearance and behavior, inspect conversations, manage leads, invite team members, and review account usage without opening the dashboard.

The installed command is:

```bash theme={null}
sitegpt
```

## When to use the CLI

<CardGroup cols={2}>
  <Card title="Automate setup" icon="wand-magic-sparkles" href="/cli/playbooks/create-chatbot-from-website">
    Create a chatbot, add website knowledge, configure settings, upload icons, and verify everything from one workflow.
  </Card>

  <Card title="Try before signup" icon="sparkles" href="/cli/onboarding">
    Let an AI agent create a temporary chatbot from a website before the user has a SiteGPT account.
  </Card>

  <Card title="Manage knowledge" icon="database" href="/cli/knowledge">
    Add links, websites, sitemaps, files, YouTube videos, text snippets, cloud sources, and custom responses.
  </Card>

  <Card title="Run support operations" icon="headset" href="/cli/conversations">
    Review conversations, tags, messages, leads, escalations, and support handoff state.
  </Card>

  <Card title="Use with AI agents" icon="sparkles" href="/cli/use-with-ai-agents">
    Give personal AI agents a scoped CLI profile, a skill file, JSON output, and safe workflows for operating SiteGPT.
  </Card>

  <Card title="Connect MCP server" icon="plug" href="/cli/mcp-server">
    Connect Claude and other remote MCP clients to SiteGPT with browser-based OAuth approval.
  </Card>
</CardGroup>

## Choose your CLI flow

| Situation                                                                               | Start here                                |
| --------------------------------------------------------------------------------------- | ----------------------------------------- |
| The user does not have a SiteGPT account yet or wants to try SiteGPT from a website URL | [Agent-first onboarding](/cli/onboarding) |
| The user already has a SiteGPT account, token, or saved profile                         | [Install and log in](/cli/install-login)  |

New customers can still log in first and create their first chatbot directly
inside an account. If the goal is to see a working chatbot before signup, use
agent-first onboarding.

## Quick start: no account yet

<Steps>
  <Step title="Install the CLI">
    ```bash theme={null}
    npm install -g @sitegpt/cli
    sitegpt --version
    ```
  </Step>

  <Step title="Start onboarding">
    ```bash theme={null}
    sitegpt onboarding start https://example.com --json
    ```

    Save `data.workspace.id`, `data.workspace.chatbotId`, `data.apiToken`, and
    `data.onboardingUrl` from the response.
  </Step>

  <Step title="Use the temporary token">
    ```bash theme={null}
    SITEGPT_API_TOKEN=<temporary-token> sitegpt onboarding status <workspace-id> --json
    SITEGPT_API_TOKEN=<temporary-token> sitegpt knowledge sitemap add --chatbot <chatbot-id> https://example.com/sitemap.xml --json
    ```
  </Step>

  <Step title="Share the onboarding URL">
    Configure and test the chatbot first. Then share `data.onboardingUrl` so the
    human can preview and claim it.
  </Step>
</Steps>

## Quick start: existing account

<Steps>
  <Step title="Install the CLI">
    ```bash theme={null}
    npm install -g @sitegpt/cli
    sitegpt --version
    ```
  </Step>

  <Step title="Log in">
    ```bash theme={null}
    sitegpt login
    ```

    The CLI opens a SiteGPT approval page in your browser. After approval, it stores a local token profile on your machine.
  </Step>

  <Step title="Verify authentication">
    ```bash theme={null}
    sitegpt whoami
    sitegpt profiles list
    ```
  </Step>

  <Step title="List your chatbots">
    ```bash theme={null}
    sitegpt chatbots list
    ```
  </Step>

  <Step title="Use JSON for scripts and agents">
    ```bash theme={null}
    sitegpt chatbots list --json
    sitegpt knowledge documents list --chatbot <chatbot-id> --json
    ```
  </Step>
</Steps>

## Common workflow

```bash theme={null}
# Authenticate
sitegpt login
sitegpt whoami

# Create a chatbot
sitegpt chatbots create "Support Bot" --description "Answers customer support questions" --json

# Add knowledge
sitegpt knowledge sitemap add --chatbot <chatbot-id> https://example.com/sitemap.xml --json
sitegpt knowledge files add --chatbot <chatbot-id> ./faq.pdf ./policy.docx

# Customize behavior
sitegpt personas add --chatbot <chatbot-id> --title "Support specialist" --file ./persona.md
sitegpt instructions add --chatbot <chatbot-id> --file ./instructions.md --temperature 0.3

# Configure appearance and prompts
sitegpt settings appearance update --chatbot <chatbot-id> --brand-color "#155DEE"
sitegpt starters add --chatbot <chatbot-id> --title "Pricing" --message "Tell me about pricing."

# Test the bot
sitegpt messages send --chatbot <chatbot-id> "How do I contact support?"
```

## Command groups

| Area                   | Commands                                                                                                                                                                                                               |
| ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Auth and local config  | `login`, `logout`, `whoami`, `profiles`                                                                                                                                                                                |
| Agent-first onboarding | `onboarding`                                                                                                                                                                                                           |
| Account                | `account`, `usage`, `limits`, `billing`, `tokens`                                                                                                                                                                      |
| Chatbots               | `chatbots`, `dashboard`, `installation`, `icons`, `settings`, `personas`, `instructions`                                                                                                                               |
| Knowledge              | `knowledge documents`, `knowledge links`, `knowledge website`, `knowledge sitemap`, `knowledge youtube`, `knowledge text`, `knowledge files`, `knowledge sources`, `knowledge sync-jobs`, `knowledge custom-responses` |
| Support operations     | `conversations`, `messages`, `tags`, `leads`, `starters`, `followups`, `members`, `member-invites`                                                                                                                     |

See the [full command reference](/cli/command-reference) for every command and option.

If you want a personal AI agent to operate SiteGPT for you, start with [Use with AI agents](/cli/use-with-ai-agents). If your AI app supports remote MCP servers, use the [MCP Server](/cli/mcp-server).

## Global options

These options work across command groups:

| Option             | Description                                                   |
| ------------------ | ------------------------------------------------------------- |
| `--json`           | Print machine-readable JSON. Use this for scripts and agents. |
| `--profile <name>` | Use a named local CLI profile.                                |
| `-p <name>`        | Alias for `--profile`.                                        |
| `--api-base <url>` | Override the SiteGPT API base URL for one command.            |
| `-v`, `--version`  | Print the installed CLI version.                              |
| `-h`, `--help`     | Show contextual help for the current command level.           |

## Environment variables

| Variable            | Description                                                                           |
| ------------------- | ------------------------------------------------------------------------------------- |
| `SITEGPT_API_TOKEN` | Token override for the current command.                                               |
| `SITEGPT_API_BASE`  | API base URL override. Defaults to `https://sitegpt.ai` when no profile value is set. |
| `SITEGPT_PROFILE`   | Profile name override.                                                                |

## Contextual help

Every command level has help built in. This is important for both people and AI agents because the help output includes enum values, defaults, and examples.

```bash theme={null}
sitegpt --help
sitegpt knowledge --help
sitegpt knowledge documents --help
sitegpt settings appearance --help
sitegpt conversations --help
```

<Tip>
  Use `--json` whenever you need IDs, cursors, nested data, or output that an automation can parse reliably.
</Tip>
