CLI Reference
Quickly scaffold and manage ConnectOnion agent projects with the CLI.
Quick Reference
Installation
The CLI is automatically installed when you install ConnectOnion:
This provides two equivalent commands: co (short form) and connectonion (full form)
Commands Overview
ConnectOnion provides two main commands for project creation:
co create [name]
Creates a new project directory with all necessary files
co init
Initializes the current directory as a ConnectOnion project
Both commands share the same interactive flow:
- 1AI feature toggle (Yes/No)
- 2API key input (with auto-detection)
- 3Template selection
co create [name]
Create a new ConnectOnion project in a new directory.
Basic Usage
Options
| Option | Description |
|---|---|
| [name] | Optional project name (creates directory) |
| --ai/--no-ai | Enable or disable AI features |
| --key | API key for AI provider (auto-detects provider) |
| --template | Choose template: minimal,web-research,custom |
| --description | Description for custom template (requires AI) |
| --yes, -y | Skip all prompts, use defaults |
Interactive Flow Example
$ co create
✔ Project name: … my-agent
✔ Enable AI features? (Y/n) … Y
✔ Paste your API key (or Enter to skip): … sk-proj-abc123
✓ Detected OpenAI API key
✔ Choose a template:
❯ Minimal - Simple starting point
Web Research - Data analysis & web scraping
Custom - AI generates based on your needs
✅ Created 'my-agent' with Minimal template
Next steps:
cd my-agent
python agent.pyco init
Initialize a ConnectOnion project in the current directory.
Basic Usage
Note: Options are the same as co create, except no [name] parameter (uses current directory name).
co auth
Authenticate for managed LLM keys with free credits included.
Basic Usage
What It Does
- 1Signs message with your Ed25519 key
- 2Authenticates with OpenOnion backend
- 3Saves
OPENONION_API_KEYto~/.co/keys.env
Using Managed Keys
co status
Check your account balance and managed keys usage.
Example Output
ConnectOnion Account Status ============================ Address: 0x7a9f3b2c8d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a Email: 0x7a9f3b2c@mail.openonion.ai Balance: $5.00
co reset
⚠️ Destructive: Reset your account and create a new identity.
What It Does
- Deletes your account data
- Clears balance and usage history
- Creates new account with new keys
- Generates new address and email
Example Output
$ co reset ⚠️ WARNING: This will delete ALL your data Including: - Account balance - Usage history - Current identity Continue? (y/N): y ✓ Account reset ✓ New identity created ✓ New address: 0x9b8c7d6e5f4a3b2c1d0e9f8a7b6c5d4e3f2a1b0
When to use: Starting completely fresh, testing account creation, or removing old identity.
co deploy
Deploy your agent to ConnectOnion Cloud.
Requirements
- Git repository with committed code
.co/config.toml(created byco createorco init)- Authenticated (
co auth)
Example Output
$ co deploy Deploying to ConnectOnion Cloud... Project: my-agent Secrets: 3 keys Uploading... Building... Deployed! Agent URL: https://my-agent-abc123.agents.openonion.ai
Beta: This feature is in beta. See the Deploy Guide for more details.
co doctor
Comprehensive diagnostics for your ConnectOnion installation.
What It Checks
System
- • Version
- • Python
- • Environment
Configuration
- • Config files
- • Keys
- • API keys
Connectivity
- • Backend
- • Authentication
- • Network
Browser Features
Guide the browser to do something using natural language commands. Use -b (short for browser) or the full browser subcommand:
Tip: co -b is short for co browser. Both syntaxes work the same way!
Device Presets
390×844
768×1024
1920×1080 (default)
Templates
Minimal
Basic agent structure with essential components:
- Simple agent.py with basic tools
- Minimal dependencies
- Quick start configuration
Web Research
Advanced template for data analysis and web scraping:
- Web scraping tools
- Data extraction utilities
- Browser automation support
- API integration examples
Custom (AI-only)
Only available when AI is enabled. Generates a complete custom template based on your description:
✔ Choose template: Custom ✔ Describe what you want to build: … I need an agent that monitors GitHub repos and sends notifications for new issues Generating custom template with AI... ✅ Created custom GitHub monitoring agent
API Key Detection
The CLI automatically detects your API provider from the key format:
| Provider | Key Format | Example |
|---|---|---|
| OpenAI | sk-... or sk-proj-... | sk-proj-abc123... |
| Anthropic | sk-ant-... | sk-ant-api03-xyz... |
| AIza... | AIzaSyAbc123... | |
| Groq | gsk_... | gsk_abc123... |
The appropriate environment variables and model configurations are set automatically.
What Gets Created
Project Structure
Files created:
Agent Identity
Every project automatically gets:
- Ed25519 cryptographic keys for agent identity
- Unique address (hex-encoded public key)
- 12-word recovery phrase for key restoration
Keys are stored in .co/keys/ and auto-added to .gitignore
Examples
Best Practices
Choose the Right Command
Use co create for new projects,co init for existing directories.
API Key Security
Never commit .env files. Store API keys securely.
Template Selection
Start with Minimal for learning. Use Custom (with AI) for specific needs.
Agent Keys
Never share .co/keys/ directory. Backup your recovery phrase.
Troubleshooting
Command Not Found
If co command is not found after installation:
Python Version
ConnectOnion requires Python 3.8 or higher. Check your version:
API Key Issues
- Check key format matches your provider
- Ensure key is active and has credits
- Try pasting without quotes or spaces
