The CEO.ai CLI lets you send prompts, have conversations, train agents with RAG memory, and manage your configuration — without leaving the command line. Install globally via npm. Zero learning curve if you've ever used a terminal.
# Install globally npm install -g @ceo-ai/cli # Configure your API key ceo configure --key sk_live_your_api_key_here # Send a prompt and get results ceo prompt "What was our Q4 revenue?" --poll # That's it.
You're the developer the CEO just asked to "look into this AI thing." Or you're a technical founder who wants to integrate AI agents into your existing tools, CI/CD pipelines, and scripts. Either way, you want:
A clean CLI — not a bloated desktop app
Simple authentication — one API key, stored securely
Scriptable output — JSON mode for piping and parsing
Conversation persistence — pick up where you left off
RAG training from the terminal — ingest files and directories
No surprises — clear errors, predictable behavior
The CEO.ai CLI gives you all of this. If you can npm install, you can be talking to your AI agents in 30 seconds.
Not a developer? That's fine — you don't need the CLI to use CEO.ai. The web app handles everything through a visual interface. The CLI is a power-user tool for developers who prefer the terminal. If you have a developer on your team, send them this page.
npm install -g @ceo-ai/cli
This gives you the ceo command available system-wide.
Interactive setup:
ceo configure
You'll be prompted for your API Key (sk_live_...) and Endpoint (defaults to https://ingestion.api.ceo.ai).
Inline setup (skip prompts):
ceo configure --key sk_live_abc123 --endpoint https://ingestion.api.ceo.ai
Verify your configuration:
ceo config:show Current Configuration: Endpoint: https://ingestion.api.ceo.ai API Key: sk_live_abc1••••••••def4
Your configuration is stored in ~/.ceo-ai/config.json with restricted file permissions (0600). Your key never leaves your machine unencrypted.
# Set API key ceo configure --key sk_live_abc123 # Set endpoint ceo configure --endpoint https://ingestion.api.ceo.ai # Set a custom command name (see "Personalize Your CLI" below) ceo configure --name jules # Set default conversation directory ceo configure --conversation-dir ~/my-chats # Combine flags ceo configure --key sk_live_abc123 --name jules --conversation-dir ~/my-chats
| Flag | Description |
|---|---|
| -k, --key <apiKey> | API key (sk_live_...) |
| -e, --endpoint <url> | API endpoint URL |
| -n, --name <commandName> | Personalize the CLI command name |
| -d, --conversation-dir <path> | Default directory for conversation files |
ceo prompt <text>
Send a prompt to your AI agent.
The fundamental command. Send any prompt to the agent associated with your API key. By default, RAG mode is enabled — meaning the agent will use any knowledge you've trained it with.
# Basic — returns the presigned URL immediately ceo prompt "What was our Q4 revenue?" # Wait for the result (most common usage) ceo prompt "What was our Q4 revenue?" --poll # Save result to a file ceo prompt "What was our Q4 revenue?" --poll -o result.json # Disable RAG mode ceo prompt "What is 2+2?" --no-rag --poll # Raw JSON output (useful for piping) ceo prompt "What was our Q4 revenue?" --poll --json # Override API key for a single request ceo prompt "Hello" --key sk_live_different_key --poll # Custom polling settings ceo prompt "Complex query..." --poll --poll-interval 5000 --poll-timeout 300000
| Flag | Description | Default |
|---|---|---|
| --poll | Wait for results instead of returning the presigned URL | false |
| --poll-interval <ms> | How often to check for results | 2000 |
| --poll-timeout <ms> | Maximum time to wait for results | 120000 |
| --no-rag | Disable RAG mode (RAG is enabled by default) | — |
| -o, --output <file> | Write results to a file (implies --poll) | — |
| -k, --key <apiKey> | Override the configured API key | — |
| --json | Output raw JSON | false |
With --poll, the CLI automatically checks the presigned URL repeatedly until results arrive.
$ ceo prompt "Summarize our sales performance this quarter" --poll ✓ Request submitted Agent: Sales Analyst Model: claude-sonnet-4-5 Credits: 20 ⠋ Waiting for results... (attempt 12) ✓ Results received --- Response --- Based on the available data, here are the key highlights...
ceo chat <text>
Start or continue a conversation with your agent.
The chat command maintains full conversation context across multiple exchanges. Every message and response is saved to a local JSON file, and the full history is sent with each new message so the agent has complete context.
# Start a new conversation (creates conversation.json) ceo chat "What was our Q4 revenue?" # Continue the same conversation ceo chat "How does that compare to Q3?" -c conversation.json # Start a named conversation ceo chat "Analyze our marketing spend" -c marketing-analysis.json # Continue it ceo chat "Break it down by channel" -c marketing-analysis.json
| Flag | Description | Default |
|---|---|---|
| -c, --conversation <file> | Conversation filename | conversation.json |
| --no-rag | Disable RAG mode | — |
| --poll-interval <ms> | Polling interval | 2000 |
| --poll-timeout <ms> | Max wait time | 120000 |
| -k, --key <apiKey> | Override configured API key | — |
| --json | Output raw JSON | false |
chat automatically polls for results (no --poll flag needed)Conversation file format:
{
"metadata": {
"agentId": "agent-abc-123",
"agentName": "Financial Analyst",
"model": "gpt-4",
"startedAt": "2025-02-14T18:30:00.000Z",
"totalCreditsUsed": 4500,
"exchangeCount": 3
},
"messages": [
{
"role": "user",
"content": "What was our Q4 revenue?",
"timestamp": "2025-02-14T18:30:00.000Z"
},
{
"role": "assistant",
"content": "Q4 revenue was $12.5M, representing a 15% increase...",
"credits": 1500
}
]
}
Conversation files are standard JSON — easy to parse, import, version control, or feed into other tools.
ceo conversations
List all conversation files.
# List conversations in the default directory ceo conversations # List conversations in a specific directory ceo conversations --dir ~/my-chats
Conversations in /home/user/chats: conversation.json Agent: Financial Analyst | Model: gpt-4 | Messages: 6 Started: 2025-02-14T18:30:00.000Z Updated: 2025-02-14T18:35:00.000Z marketing-analysis.json Agent: Marketing Bot | Model: gpt-4 | Messages: 4 Started: 2025-02-14T19:00:00.000Z Updated: 2025-02-14T19:10:00.000Z
ceo poll <url>
Poll an existing presigned URL for results.
Useful if you submitted a prompt without --poll and want to check for results later — or if you're building a two-step workflow where submission and retrieval happen in different processes.
# Poll a presigned URL ceo poll "https://ceo-ai-api-output-results.s3.amazonaws.com/api-data/..." # Save to file ceo poll "https://..." -o result.json # Custom interval and timeout ceo poll "https://..." --interval 5000 --timeout 300000 # Raw JSON output ceo poll "https://..." --json
| Flag | Description | Default |
|---|---|---|
| --interval <ms> | How often to check | 2000 |
| --timeout <ms> | Maximum wait time | 120000 |
| -o, --output <file> | Write results to file | — |
| --json | Output raw JSON | false |
Feed your agents files and entire directories from the command line. Every file is automatically chunked and categorized. Your agents become experts in your business data without opening a browser.
ceo addRag <filepath>
Add a single file as RAG memory to your agent.
The file is automatically chunked into digestible pieces and the category (code, documentation, data) is detected from the file extension.
# Add a markdown file ceo addRag ./docs/README.md # Add a code file ceo addRag ./src/index.js # Override the auto-detected category ceo addRag ./notes.txt --category documentation # Custom chunk size ceo addRag ./large-doc.md --chunk-size 4000 # JSON output ceo addRag ./README.md --json
| Category | Extensions |
|---|---|
| Code | .js .ts .jsx .tsx .py .java .go .rs .rb .php .c .cpp .h .cs .swift .kt .sql .sh .bash .yaml .yml .json .xml .html .css .scss |
| Documentation | .md .mdx .txt .rst .adoc .pdf .doc .docx |
| Data | .csv .tsv .log |
Maximum file size is 4MB. For larger files, split them manually or use addRagDir with smaller individual files.
ceo addRagDir <dirpath>
Add all supported files from a directory as RAG memory.
This is the power command for bulk knowledge ingestion. Point it at a folder and every supported file gets processed, chunked, and added to your agent's memory. Use --recursive to include subdirectories.
# Add all supported files from a directory ceo addRagDir ./docs # Include subdirectories (the most common usage) ceo addRagDir ./src --recursive # Only specific file types ceo addRagDir ./project --extensions md,txt,py --recursive # Override category for all files ceo addRagDir ./code-samples --category code # Custom chunk size for all files ceo addRagDir ./docs --chunk-size 4000 --recursive
Found 5 files to add: README.md guide/getting-started.md guide/advanced.md api/endpoints.md api/authentication.md ✓ README.md (3 chunks, 450 credits) ✓ guide/getting-started.md (5 chunks, 780 credits) ✓ guide/advanced.md (8 chunks, 1200 credits) ✓ api/endpoints.md (4 chunks, 620 credits) ✓ api/authentication.md (2 chunks, 310 credits) --- Summary --- Succeeded: 5 Credits: 3360
Hidden directories (.git, .env, etc.) and node_modules are automatically skipped when using --recursive. Empty files and files larger than 4MB are also skipped.
Train an agent on your entire codebase:
ceo addRagDir ./src --recursive --extensions js,ts,json
Your agent now understands your code structure, patterns, and conventions.
Train an agent on your company documentation:
ceo addRagDir ./docs --recursive --extensions md,txt,pdf
Your agent now knows your processes, policies, and product details.
Train an architect agent on your API docs + infrastructure:
ceo addRagDir ./api-docs --recursive ceo addRag ./terraform/main.tf ceo addRag ./docker-compose.yml
Your architect now understands your API contracts and deployment patterns.
Train a support agent on your knowledge base:
ceo addRagDir ./knowledge-base --recursive --extensions md,txt ceo addRagDir ./faq --recursive
Your support agent can now answer questions using your actual documentation.
Don't want to type ceo every time? Set a custom command name:
# Set your preferred name ceo configure --name jules # Get shell alias instructions ceo alias:setup
Add this line to your shell config: alias jules='/usr/local/bin/ceo' Or run this to add it automatically: echo "alias jules='/usr/local/bin/ceo'" >> ~/.bashrc && source ~/.bashrc
After setting up the alias, use your custom name everywhere:
jules chat "Good morning, what's on my agenda?" jules conversations jules prompt "Generate a report" --poll jules addRag ./new-docs/guide.md jules config:show
The command name must be a single word containing only letters and numbers.
The CLI is scriptable by design. Here are patterns for integrating it into your development workflow.
When to use: Long-running analysis, batch processing, or when you want to submit a task and come back to it.
# Step 1: Submit prompt, get presigned URL $ ceo prompt "Long running analysis..." ✓ Request submitted Agent: Data Analyst Model: claude-sonnet-4-5 Credits: 50 Presigned URL: https://ceo-ai-api-output-results.s3.amazonaws.com/api-data/abc/def/1234.json?X-Amz-... Use --poll to wait for results, or fetch the URL when ready. # Step 2: Later, poll for results $ ceo poll "https://ceo-ai-api-output-results.s3.amazonaws.com/..." ✓ Results received --- Response --- Analysis complete...
When to use: Integrating agent responses into scripts, CI/CD pipelines, or data processing chains.
# Pipe to jq for processing ceo prompt "List all customers" --poll --json | jq '.response.customers' # Pipe to another command ceo prompt "Get metrics" --poll --json > metrics.json # Use in shell scripts REVENUE=$(ceo prompt "What was Q4 revenue?" --poll --json | jq -r '.response.answer') echo "Q4 Revenue: $REVENUE"
When to use: CI/CD pipelines, Docker containers, environments where you don't want to store config files.
# Provide API key via environment variable CEO_API_KEY=sk_live_abc123 ceo prompt "Hello" --poll
When to use: Keep your agents' knowledge current by training them as part of your deployment process.
# In your deployment script or CI pipeline: # Train your agent on the latest docs after every deploy echo "Training agent on latest documentation..." ceo addRagDir ./docs --recursive --extensions md,txt ceo addRagDir ./api-reference --recursive --extensions md,json,yaml echo "Agent knowledge updated."
When to use: Scheduled tasks, automated reporting, monitoring — anything you'd run on a cron schedule.
#!/bin/bash # daily-report.sh — run via cron at 7am DATE=$(date +%Y-%m-%d) ceo prompt "Generate the daily operations report for ${DATE}" \ --poll \ -o "reports/daily-${DATE}.json" echo "Daily report generated: reports/daily-${DATE}.json"
The CLI provides specific error messages so you know exactly what went wrong and how to fix it.
# No API key configured $ ceo prompt "Hello" Error: No API key configured. Run: ceo configure # Invalid API key $ ceo prompt "Hello" --key invalid_key Error: Invalid API key format # Insufficient credits $ ceo prompt "Hello" --poll ✗ Request failed Error: You need 50 credits but only have 20 available. Details: {"requiredCredits":50,"availableCredits":20,"deficit":30} # Polling timeout $ ceo prompt "Hello" --poll --poll-timeout 5000 ✗ Polling failed Error: Polling timed out after 5000ms (3 attempts)
| Error | Cause | Fix |
|---|---|---|
| No API key configured | No key in config file | Run ceo configure --key sk_live_... |
| Invalid API key format | Key doesn't match expected pattern | Check your key starts with sk_live_ |
| Insufficient credits | Not enough credits | Add credits or wait for monthly refresh |
| Polling timed out | Agent took too long | Increase --poll-timeout (e.g., 300000 for 5 min) |
| File too large (max 4MB) | RAG file exceeds limit | Split the file or use addRagDir with smaller files |
npm uninstall -g @ceo-ai/cli # Optionally remove config rm -rf ~/.ceo-ai
| Command | Description |
|---|---|
| ceo configure | Set API key, endpoint, and preferences |
| ceo config:show | Display current configuration |
| ceo prompt <text> | Send a prompt to your agent |
| ceo chat <text> | Start or continue a conversation |
| ceo conversations | List all saved conversations |
| ceo poll <url> | Poll a presigned URL for results |
| ceo addRag <filepath> | Add a file as RAG memory to your agent |
| ceo addRagDir <dirpath> | Add all supported files from a directory as RAG memory |
| ceo alias:setup | Get instructions for setting up a custom command alias |
| Flag | Description |
|---|---|
| -k, --key <apiKey> | Override the configured API key for this request |
| -e, --endpoint <url> | Override the configured endpoint for this request |
| --json | Output raw JSON (useful for piping and scripting) |
The CLI gives developers terminal access to the same agent platform that powers CEO.ai's web app. Everything you do in the CLI — prompts, conversations, RAG training — works with the same agents and the same knowledge as the web interface and the SDK.
| If you want to… | Use… |
|---|---|
| Talk to agents from the terminal | CLI ← you are here |
| Embed agents in your Node.js applications | SDK |
| Build and manage agents visually | Web App — Agent Builder |
| Train agents on knowledge via web form | Web App — Add Memories |
| One-shot entire projects | CEO Agent |
| Automate multi-step operations | Workflows |
Install the CLI in 10 seconds. Configure your API key in 10 more. Start talking to your AI agents immediately.
npm install -g @ceo-ai/cli && ceo configure
Don't have a CEO.ai account yet? Every plan includes Agent API access and CLI support. The developer on your team will thank you.