Skip to main content
The CLI authenticates with scoped SiteGPT API tokens. Tokens are bearer credentials, stored locally by profile, and sent to /api/v2 routes.

Authentication methods

Recommended for humans and local AI assistants:
OAuth device login opens a browser approval page and creates a scoped token after you approve access. The CLI uses client_id=sitegpt-cli with SiteGPT’s OAuth device authorization endpoints.

Manual dashboard-token login

Manual token login is useful when you want to choose permissions in the dashboard first, then connect the CLI afterward.
1

Create a token in the dashboard

Open the SiteGPT dashboard, go to Agents, click Create token, and choose the access level, scopes, and chatbot access.
2

Copy the token

Copy the plaintext token immediately. SiteGPT stores only a secure hash and cannot show the same token again.
3

Save it in the CLI

4

Use a named profile when needed

Creating a token does not automatically switch the CLI to that token. You must run sitegpt login --token <token> or set SITEGPT_API_TOKEN for one-off commands.

OAuth device flow for agents

sitegpt login uses the OAuth Device Authorization Grant. This is the recommended browser-approved flow for local CLIs and personal AI agents because it does not require pasting an API token into chat. The first-party CLI uses this public client identifier:
client_id identifies the application requesting access. It is not a secret, and it is the same for all users of the SiteGPT CLI. Discovery endpoints:
OAuth endpoints:
For the full protocol shape, request fields, response fields, and polling errors, see OAuth device flow.

Access levels

Token issuance is role-aware. A user can only create tokens for scopes and chatbots they are allowed to manage in the dashboard.
For personal AI assistants, use a dedicated named profile and give the agent only the scopes it needs. See Use with AI agents for setup examples.

Available scopes

Token commands

Create options

Reference: token scopes and API token commands.

Token lifecycle

Newly created and rotated tokens are shown once:
Store the plaintext token immediately. SiteGPT only stores a secure hash and cannot show the exact token again.

Least-privilege examples

Read-only chatbot inventory:
Knowledge-only updater for one chatbot:
Support queue agent:

Security notes

  • Do not commit ~/.config/sitegpt/config.json.
  • Prefer chatbot-restricted tokens for agents.
  • Use --json for automation so scripts do not scrape human tables.
  • Rotate tokens after demos, tests, and shared-agent sessions.
  • Revoke tokens you no longer use: