Technical Guide

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 -- --help

Or run directly with npx tsx:

npx tsx src/cli/index.ts --help

Authentication#

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 logout

You can also set the OPERATOR_API_KEY environment variable instead of logging in:

export OPERATOR_API_KEY=op_live_your_key_here

Quick Start#

1. List Your Products

agencyai products list

Shows a table with title, type, price, and status for all your products.

2. Create a Product

agencyai products create

Interactive 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

CommandDescription
auth login --key <KEY>Validate and save API key
auth statusShow logged-in expert info
auth logoutClear saved credentials

agencyai products

CommandFlagsDescription
products list--status, --limitTable of your products
products get <id>Full product details
products createInteractive product creation
products publish <id>Set status to published
products retire <id>Set status to retired

agencyai orders

CommandFlagsDescription
orders list--status, --limitRecent orders table
orders get <id>Full order + intake responses
orders fulfill <id>--content, --notesMark as delivered

Other Commands

CommandDescription
storefront viewShow storefront URL and published product count
storefront openOpen storefront in browser
analytics overviewOrders by status, revenue, top products
keys listList 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 function

Dashboard#

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.

CLI
Terminal
MCP
AI Agents
Dashboard
Web UI

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.