Skip to main content
The CLI does everything the Actions API does, with tables for people and JSON for scripts. It needs Node.js 20 or later. Commands that use your account need a plan with API access (Growth and above).

Install

To update, run npm install -g @customergpt/cli@latest.

Sign in

Your browser opens CustomerGPT. Sign in and approve the connection, then return to the terminal. The session is saved in ~/.config/customergpt/config.json and refreshes on its own. Don’t commit that file.
  • customergpt login --no-browser prints the sign-in URL instead of opening it. Open it on the same computer.
  • customergpt login --read-only asks only for read access, so the session can never change anything.
  • customergpt whoami checks that you’re signed in and shows your usage.
  • customergpt logout signs out.

Build a chatbot in five commands

The output includes the new chatbot’s id. Use it in place of BOT_ID:
messages send is a preview: it uses your message quota but doesn’t create a conversation or reach a real visitor. Paste the snippet from installation snippet into your site before </body>. It contains the public Widget ID, never your API key. For every command, see CLI commands.

Try without an account

This returns a temporary bot, a secret token, and a preview URL. Open the URL to ask questions and claim the bot into your account. Drafts expire after 24 hours and answer up to 20 preview messages. Keep the token private.

Confirmations and dry runs

  • --yes confirms a change, or a preview that uses your message quota. Without it, changes fail with CONFIRMATION_REQUIRED.
  • --dry-run checks a change without making it. Run deletions and bulk changes this way first.
  • --wait waits for training to finish, up to 15 minutes by default, and fails if the training fails. An interrupted wait doesn’t stop the training; check it later with customergpt jobs get JOB_ID.

Scripts and CI

In CI, set an API key instead of signing in:
To save a key without it ending up in your shell history, pipe it in: customergpt login --token-stdin. Output is JSON when stdout isn’t a terminal, when you pass --json, or when CUSTOMERGPT_OUTPUT=json is set. Results go to stdout; errors and progress go to stderr. Exit code 0 means success. Errors look like this:
To call any action directly, use call:

Profiles

Keep several accounts or servers without retyping keys:
The profile is chosen by --profile, then CUSTOMERGPT_PROFILE, then the saved default.

Use it as an MCP server

The CLI includes an MCP server that uses your saved sign-in. After customergpt login, add this to a client that starts local servers:
On Windows, some clients need "command": "cmd" with "args": ["/c", "customergpt", "mcp"].

Use it from JavaScript

For a fully typed client, use the JavaScript SDK.

For AI coding agents

customergpt agent-guide prints the workflow and command map for AI agents. The agent skill that ships with the CLI teaches Claude Code, Codex, Cursor and others to build a support bot safely. It’s also available at https://api.customergpt.ai/agents/customergpt-cli-skill.md.

Shell completion

Add the line to ~/.zshrc or ~/.bashrc to keep it.

Configuration

Troubleshooting