AgencyAI CLI
Manage your consulting products, orders, and analytics from the terminal. Same backend as MCP and the dashboard.
Installation#
The CLI is included with the AgencyAI platform. Clone the repo and run it with npx tsx:
git clone https://github.com/your-org/agent-operator-os.git
cd agent-operator-os
npm install
# Run the CLI
npm run cli -- --helpOr run directly with npx tsx:
npx tsx src/cli/index.ts --helpAuthentication#
The CLI uses the same API keys as MCP and the platform API. Get your key from Dashboard → Settings → Integrations.
# Log in with your API key
agencyai auth login --key op_live_your_key_here
# Check who you're logged in as
agencyai auth status
# Log out
agencyai auth logoutYou can also set the OPERATOR_API_KEY environment variable instead of logging in:
export OPERATOR_API_KEY=op_live_your_key_hereQuick Start#
1. List Your Products
agencyai products listShows a table with title, type, price, and status for all your products.
2. Create a Product
agencyai products createInteractive prompt for title, description, price, type, and at least 3 intake questions. Creates in draft status.
3. View Orders
# List recent orders
agencyai orders list
# Get full details for an order
agencyai orders get <order-id>
# Fulfill an order
agencyai orders fulfill <order-id> --content '{"result": "Done"}'Command Reference#
agencyai auth
| Command | Description |
|---|---|
auth login --key <KEY> | Validate and save API key |
auth status | Show logged-in expert info |
auth logout | Clear saved credentials |
agencyai products
| Command | Flags | Description |
|---|---|---|
products list | --status, --limit | Table of your products |
products get <id> | — | Full product details |
products create | — | Interactive product creation |
products publish <id> | — | Set status to published |
products retire <id> | — | Set status to retired |
agencyai orders
| Command | Flags | Description |
|---|---|---|
orders list | --status, --limit | Recent orders table |
orders get <id> | — | Full order + intake responses |
orders fulfill <id> | --content, --notes | Mark as delivered |
Other Commands
| Command | Description |
|---|---|
storefront view | Show storefront URL and published product count |
storefront open | Open storefront in browser |
analytics overview | Orders by status, revenue, top products |
keys list | List API keys with prefix, name, last used |
keys create --name <name> | Generate a new API key (shown once) |
keys revoke <id> | Revoke an API key |
MCP Integration#
The CLI and MCP server share the same backend — they use the same API keys, query the same Supabase database, and execute the same business logic. Think of them as two interfaces to the same system:
CLI
Best for scripting, batch operations, CI/CD workflows, and quick terminal-based management. Interactive mode for product creation.
MCP Server
Best for AI agent integration. Connect from Claude, Cursor, or any MCP-compatible tool to let AI manage your products and orders autonomously.
# MCP server uses the same auth
agencyai auth login --key op_live_xxx # CLI
# MCP also validates op_live_ keys via the same functionDashboard#
The third interface is the web dashboard at /dashboard. All three interfaces — CLI, MCP, and Dashboard — talk to the same Supabase database and enforce the same ownership rules.
Configuration#
CLI config is stored at ~/.agencyai/config.json:
{
"apiKey": "op_live_...",
"serverUrl": "http://localhost:3010"
}The CLI connects directly to Supabase using Drizzle ORM — no web server required. Set DATABASE_URL in your .env file.