CLI Reference
Quickly scaffold and manage ConnectOnion agent projects with the CLI.
Installation
The CLI is automatically installed when you install ConnectOnion:
This provides two equivalent commands: co
(short form) and connectonion
(full form)
co init
Initialize a new ConnectOnion agent project in the current directory.
Basic Usage
Options
Option | Description |
---|---|
--template, -t | Choose a template: meta-agent (default),playwright |
--force | Overwrite existing files |
What Gets Created
Meta-Agent (default)
Files created:
Playwright Template
Files created:
Templates
Meta-Agent (Default)
A ConnectOnion development assistant powered by llm_do()
for intelligent operations:
Uses llm_do() for intelligent doc retrieval
AI reflection on task progress
Task management functions
Generate pytest test suites
Self-reflection on tasks
Create structured plans (GPT-4o-mini)
Architecture recommendations
1# Learn about ConnectOnion
2result = agent.input("What is ConnectOnion and how do tools work?")
3
4# Generate agent code
5result = agent.input("Create a web scraper agent")
6
7# Create tool functions
8result = agent.input("Generate a tool for sending emails")
Playwright Template
Web automation agent with stateful browser control:
Launch browser instance
Go to URLs
Extract page content
Fill and submit forms
Capture pages
Get all links
Run JS code
Clean up resources
Note: Requires running the following command first:
Interactive Features
The CLI will:
- Warn if you're in a special directory (home, root, system)
- Ask for confirmation if the directory is not empty
- Automatically detect git repositories and update
.gitignore
- Provide clear next steps after initialization
Best Practices
Use Markdown for Prompts
Always store system prompts in prompt.md
files for better formatting and readability.
Environment Variables
Never commit .env
files. Use .env.example
as a template.
Git Integration
The CLI automatically handles .gitignore
for git repositories.
Embedded Documentation
The docs in .co/docs/
allow agents to work offline.
Troubleshooting
Python Version
ConnectOnion requires Python 3.8 or higher. Check your version:
API Keys Setup
After running co init
, set up your API keys: