> ## 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.

# Use the CLI with an AI agent

> Give an AI coding agent or personal assistant its own CLI profile and instructions so it can manage your chatbots.

An AI agent that can run terminal commands can use the SiteGPT CLI to set up and manage chatbots for you. This page shows how to give the agent its own profile and the CLI instructions.

If your AI app supports MCP but cannot run terminal commands, use [MCP](https://sitegpt.ai/docs/developers/mcp.md) instead. If you do not have a SiteGPT account yet, the agent can use [agent-first onboarding](https://sitegpt.ai/docs/cli/onboarding.md) and needs no login.

## Before you start

* The Growth plan or above, on your own account or on the account that owns the chatbot. See [Which plan applies](https://sitegpt.ai/docs/developers/authentication.md#which-plan-applies).
* An AI agent that can run terminal commands on your computer.
* Node.js 18 or later, with npm, on the same computer.
* A decision about what the agent may do. Pick a scope set in [Scope sets for common jobs](https://sitegpt.ai/docs/cli/authentication.md#scope-sets-for-common-jobs).

## Set up the agent

**1. Install the CLI**

```bash theme={null}
npm install -g @sitegpt/cli
```

**2. Log in with a profile for the agent**

Use a separate profile, so you can see when the agent works and revoke its access alone.

```bash theme={null}
sitegpt login --profile sitegpt-agent
```

To limit the agent, add `--scope` and `--chatbot` options. See [Login options](https://sitegpt.ai/docs/cli/authentication.md#login-options).

**3. Approve access in the browser**

Open the URL that the CLI prints. On the approval page, check the access that the CLI asks for. You can narrow it there. Then select **Approve**.

**4. Give the agent the CLI skill file**

Tell the agent to read this file before it uses SiteGPT:

```text theme={null}
https://sitegpt.ai/agents/sitegpt-cli-skill.md
```

Some AI products call this a skill, project instruction, custom instruction, or memory. To install the skill as a package instead, see [Install the skill as a package](#install-the-skill-as-a-package).

**5. Paste the agent instruction**

Copy the [agent instruction](#agent-instruction) into the agent's instructions or chat. If you used a different profile name, change `sitegpt-agent` in the text.

## Check that it works

Ask the agent: "Run `sitegpt --profile sitegpt-agent whoami` and list my SiteGPT chatbots as JSON."

The agent shows your account email and profile name. Then it lists the chatbots that the token can access.

## Agent instruction

```text theme={null}
You can manage my SiteGPT account with the SiteGPT CLI.

Before running commands, read the SiteGPT CLI skill file:
https://sitegpt.ai/agents/sitegpt-cli-skill.md

If I do not have a SiteGPT account yet, use agent-first onboarding. Run sitegpt onboarding start with my website URL, set up and test the temporary chatbot, then give me the onboarding URL to preview and claim.
If I already have a SiteGPT account, use the profile named sitegpt-agent unless I tell you otherwise.
Use --json for commands where you need IDs or structured output.
Do not ask me to paste API tokens into chat. Use the saved CLI profile for existing accounts, or the temporary onboarding token from onboarding start.
Ask me before you delete chatbots or content, revoke tokens, remove members, or make broad account changes.
When you create a chatbot from a website, first confirm or infer its purpose: customer support, marketing or site guide, lead generation, docs or help, onboarding, or a mix. Then inspect the website, prefer sitemap content when available, get brand colors and icons from the raw HTML and assets, and set up content, persona, instructions, appearance, conversation starters, and follow-up suggestions.
For agent-first onboarding, the error PROFILE_NOT_CONFIGURED is expected. Do not stop. Do not batch optional login checks with required website inspection or onboarding commands.
```

## Example requests

**Try SiteGPT before signup.** Playbook: [New customer onboarding](https://sitegpt.ai/docs/cli/playbooks/agent-first-onboarding-chatbot.md).

```text theme={null}
Try SiteGPT for https://example.com. Use agent-first onboarding. Inspect the site first and prefer sitemap content if available. Get the brand color and icon from the raw HTML and assets. Then set up the persona, instructions, appearance, conversation starters, and follow-up suggestions, and send test messages. Give me the onboarding URL when it is ready to preview and claim.
```

**Create a chatbot in your account.** Playbook: [Existing account setup](https://sitegpt.ai/docs/cli/playbooks/account-chatbot-setup.md).

```text theme={null}
Use the SiteGPT CLI with profile setup-agent. Create a customer support chatbot for https://example.com in my SiteGPT account. Inspect the site first and prefer sitemap content if available. Get the brand color and icon from the raw HTML and assets. Then set up the persona, instructions, appearance, conversation starters, and follow-up suggestions, and send a test message. Show me the chatbot ID, the chat URL, and what you set up.
```

**Add and check content.**

```text theme={null}
Use the SiteGPT CLI with profile knowledge-agent. Add this sitemap to chatbot YOUR_CHATBOT_ID: https://docs.example.com/sitemap.xml. Then list the new documents, wait until they finish processing, and resync any failed documents. Use JSON output for document IDs.
```

**Review recent support activity.**

```text theme={null}
Use the SiteGPT CLI with profile support-agent. Review recent conversations for chatbot YOUR_CHATBOT_ID. Summarize open issues, list new leads, and tag conversations that need human follow-up. Do not delete anything without asking me first.
```

## Keep the agent safe

* Give each agent its own profile, such as `setup-agent`, `knowledge-agent`, or `support-agent`.
* Limit the token to the chatbots the agent needs with `--chatbot`.
* Use `--full-access` only for a trusted local agent that must manage the whole account.
* Ask the agent to run `sitegpt profiles list` and `sitegpt whoami` before it makes changes.
* Revoke or rotate the agent's token after demos and shared sessions. See [Token commands](https://sitegpt.ai/docs/cli/authentication.md#token-commands).

## If the agent has problems

| Problem | Ask the agent to run |
| - | - |
| It uses the wrong account | `sitegpt profiles list` and `sitegpt --profile <name> whoami` |
| It cannot access a chatbot | `sitegpt chatbots list --json` with its profile, to see which chatbots the token can access |
| It cannot find a command | `sitegpt agent-guide` or contextual help, such as `sitegpt knowledge --help` |
| It calls the wrong API base URL | `sitegpt profiles show <profile>`, and check `SITEGPT_API_BASE` |

For more fixes, see [Troubleshooting](https://sitegpt.ai/docs/cli/troubleshooting.md).

## Reference

### Install the skill as a package

The [sitegpt/agent-skills](https://github.com/sitegpt/agent-skills) repository has two skills:

* `sitegpt-cli`: the CLI workflow and command map. It is a packaged copy of the public skill file. The public file can be a little newer.
* `sitegpt`: a short orientation skill. It tells the agent which surface to use (CLI, MCP, REST API, or no-account onboarding) and sends CLI work to `sitegpt-cli`.

The repository is packaged as an Agent Skills repository, a Claude Code plugin marketplace, and a Cursor plugin. It also has config files for Cursor, Windsurf, and Claude Code. The skills only teach the agent. The agent still needs the CLI from [Install the CLI](#set-up-the-agent).

```sh theme={null}
# Claude Code (also works in Cowork):
/plugin marketplace add sitegpt/agent-skills
/plugin install sitegpt@sitegpt

# Any agent environment that supports Agent Skills:
npx skills add sitegpt/agent-skills

# Only the CLI skill:
npx skills add sitegpt/agent-skills --skill sitegpt-cli
```

In Cursor, run `/add-plugin` and select **SiteGPT**. The Cursor plugin also adds the [MCP server](https://sitegpt.ai/docs/developers/mcp.md).

The CLI also prints a short version of the agent workflow and command map with `sitegpt agent-guide`. Add `--json` for JSON output.

### Agent discovery reference

These public URLs help agents find SiteGPT without earlier instructions.

| URL | What it gives agents |
| - | - |
| `https://sitegpt.ai/auth.md` | A guide to agent sign-up, including the no-account onboarding flow. |
| `https://sitegpt.ai/.well-known/oauth-authorization-server` | OAuth metadata. Its `agent_auth` block points to `auth.md` and describes anonymous sign-up and Sign in with AgentID. See [Authentication](https://sitegpt.ai/docs/developers/authentication.md). |
| `https://sitegpt.ai/llms.txt` | The list of machine-readable entry points. |
| Any sitegpt.ai marketing page + `.md` | A markdown version of the page, for example `https://sitegpt.ai/pricing.md`. The homepage is `https://sitegpt.ai/index.md`. You can also send `Accept: text/markdown`, or add `?mode=agent` as the only query parameter. |
| Docs pages under `/docs` + `.md` | A markdown version of the docs page. |
| Blog and resources posts | A markdown version only with `Accept: text/markdown`. |
| `https://sitegpt.ai/docs/mcp` | A docs MCP server for search over this documentation. No authentication. See [MCP](https://sitegpt.ai/docs/developers/mcp.md). |
| `https://sitegpt.ai/.well-known/agent-card.json` | The A2A card for the SiteGPT Support Agent, which answers questions about SiteGPT. See [A2A agent](https://sitegpt.ai/docs/developers/a2a.md). |

### Sign in with AgentID

An agent with its own [AgentID](https://www.agentid.com) identity can create a full SiteGPT account without a person. AgentID identities use an AgentMail inbox.

| Item | Detail |
| - | - |
| Start URL | `https://sitegpt.ai/auth/agentid` |
| Flow | SiteGPT sends the agent to AgentID to approve. AgentID sends it back, and SiteGPT checks the identity token. The AgentID docs describe the approval step. |
| Account | A normal SiteGPT account for the AgentMail address, with the same dashboard, API tokens, and billing as a person. |
| Email | The AgentMail address must be verified. SiteGPT refuses unverified addresses. |
| After sign-in | Create an API token on the **Agents** page. Then use the CLI, SDKs, or MCP as usual. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.