Quick Start Guide
Get up and running with ConnectOnion in under 2 minutes.
Estimated time: 2 minutes to first working agent
1Install ConnectOnion
Terminal
$pip install connectonion
2Create Your First Meta-Agent
Initialize a ConnectOnion development assistant with powerful built-in capabilities:
Terminal
$mkdir meta-agent
$cd meta-agent
$co init
Files created:
meta-agent/
├──🐍agent.py# Your meta-agent with tools
├──prompt.md# Main system prompt
├──prompts/# Specialized prompts
├──metagent.md
├──docs_retrieve_prompt.md
├──answer_prompt.md
└──think_prompt.md
├──.env.example# API key template
├──.gitignore# Git config
└──.co/# ConnectOnion config
├──config.toml
└──docs/
└──connectonion.md
Your meta-agent includes:
- •answer_connectonion_question() - Expert answers from embedded docs
- •create_agent_from_template() - Generate complete agent code
- •generate_tool_code() - Create tool functions
- •create_test_for_agent() - Generate pytest test suites
- •think() - Self-reflection to analyze tasks
- •generate_todo_list() - Create structured plans (uses GPT-4o-mini)
- •suggest_project_structure() - Architecture recommendations
3Set Up Your API Key
Terminal
$cp .env.example .env
Then edit .env
and add your OpenAI API key:
.env
# OpenAI API Configuration
OPENAI_API_KEY=sk-your-actual-api-key-here
OPENAI_API_KEY=sk-your-actual-api-key-here
4Try These Commands
Your meta-agent can help you build ConnectOnion projects:
main.py
Python REPL
Interactive
main.py
Python REPL
Interactive
main.py
Python REPL
Interactive
5Alternative: Playwright Web Automation
For web automation tasks, use the Playwright template:
Terminal
$co init --template playwright
Stateful browser tools included:
•start_browser() - Launch browser
•navigate() - Go to URLs
•scrape_content() - Extract content
•fill_form() - Complete forms
•take_screenshot() - Capture pages
•extract_links() - Get all links
•click() - Click elements
•execute_javascript() - Run JS
Note: Requires pip install playwright && playwright install
6Create a Custom Tool Agent
You can also create agents from scratch with custom tools:
main.py
Python REPL
Interactive
7Debugging with @xray
Use the @xray decorator to see what your agent is thinking:
main.py
Python REPL
Interactive
What's Next?
Master System Prompts
Learn advanced prompting techniques to create expert agents for any domain.
Deep Dive into @xray
Master debugging and get complete visibility into your agent's decision-making.
Real-World Examples
See complete agent implementations for various use cases.
Build Custom Tools
Learn how to create powerful tools for your agents.