Agentkit CLI
Install the Agentkit CLI, sign in with your browser, and manage agents, knowledge sources, settings and conversations from your terminal.
Manage your agents from the terminal with the Agentkit CLI. The CLI and API are included on every plan, including Free. Chat and training use your workspace's credits. Compare plans.
What you can do
- List agents and read their AI, design, security and training settings
- Read conversations from the widget, API, Playground, Instagram, Center Stage and Help Page
- List knowledge sources, add text and Q&A, and re-crawl web pages
- Test an agent's answers from the terminal without opening the dashboard
Install
You need Node.js 22 or newer.
npm install -g @agikits/agentkit agentkit --version
This installs two commands: agentkit (the CLI) and agentkit-mcp (the MCP server).
If your shell can't find agentkit afterwards, npm's global folder isn't on your PATH. Run npm prefix -g and add its bin folder (on Windows, that folder itself) to your PATH, or skip the global install and use npx -p @agikits/agentkit agentkit --version.
Auth
Run agentkit auth login --browser. The CLI prints a code and opens the activation page. Choose your workspace and approve the requested permissions. The CLI saves the resulting key on your machine.
agentkit auth login --browser agentkit auth status agentkit agents list
If you already have a workspace API key, run agentkit auth login and paste it at the hidden prompt. For CI or headless jobs, set AGENTKIT_API_KEY in the job environment or pipe a key from your secret manager to agentkit auth login --with-token. An environment key takes precedence over the saved credential.
agentkit auth status shows the active workspace, scopes and credential source. agentkit auth logout attempts to revoke the saved key and clears the local credentials. For an environment key, revoke it under API Keys and unset the variable.
Work with an agent
agentkit agents list agentkit projects --add support <agent-id> agentkit config set agent support agentkit train --status agentkit sources list agentkit conversations list --source widget
Use an agent ID or a registered alias as your default. An explicit agent argument overrides AGENTKIT_AGENT_ID, which in turn overrides the saved default.
Inspect and edit a knowledge source
Find the document ID with agentkit sources list. Read the current content before editing. For Q&A entries, sources get returns the questions and answer. Supply just the fields you want to change.
agentkit sources get support <document-id> --json agentkit sources update support <document-id> --answer "Returns are accepted within 30 days."
Use --question to replace Q&A questions. For text, web or file sources, use --content or --file to replace the stored text. The source keeps its ID.
agentkit sources update support <document-id> --file corrected-guide.txt
Call API v2
agentkit api sends an authenticated request to a path under /api/v2/ and prints the JSON response. Use --query for query parameters, -f for string fields or --body @request.json for a typed JSON body.
agentkit api GET /api/v2/agents --query limit=10 agentkit api PATCH /api/v2/agents/<agent-id> -f 'name=Help desk'
Output for scripts
Use --json for structured results. --plain produces compact JSON or undecorated text. --quiet hides progress and hints. --no-input disables interactive prompts and automatic browser opening.
agentkit agents list --json --plain --quiet --no-input
Run agentkit <command> --help for arguments and agentkit capabilities for the full command list.
Changes and credits
Commands that change an agent, such as settings instructions or sources add-text, take effect immediately: new text and Q&A sources are available to the agent right away. train re-crawls the agent's web-page sources and uses training credits; train --status only reads progress. Deleting anything requires --yes.
Limitations in the beta
- Widgets, Center Stage, Backstage, email inbox setup, and changes to custom actions and secrets need a short-lived dashboard session token instead of an API key. These commands are experimental. An API key can read the email inbox and send reviewed drafts.
- Instagram connection and other channel sign-ins stay in the dashboard.
Report issues on GitHub.