# ConnectOnion

> ConnectOnion is the agent CLI harness. Each `co` command connects your AI agent to one service: Gmail, Outlook, Google Calendar, WhatsApp, Telegram, Discord, Feishu, SMS, a real logged-in browser, Google Drive or a Synology NAS. It also gives the agent its own 0x address, mailbox and memory, and it works from Claude Code and Codex. You don't create an OAuth app, add DNS records or write a Playwright script.

CLI is all you need. Open source (Apache-2.0), Python 3.10+. Install: `pip install connectonion`, then `co init`, which creates the agent's address and mailbox and signs in with $5 of model credit.

## Commands

### identity & account

- `co init`: Initialize global ~/.co/keys.env, or use co init ./ for a project.
- `co setup`: Set up your global ~/.co/ — identity, agent.json, and skill library.
- `co auth`: Sign in to OpenOnion (login, status, logout) or connect a service. Subcommands: login, status, logout, google, microsoft, feishu, lark.
- `co keys`: Show agent keys and credentials.
- `co env`: Show, set and remove settings in the selected env file (global ~/.co/keys.env unless --env-file was given). Subcommands: show, path, get, set, rotate, unset.
- `co status`: Check credential sources, account status, and deployments.
- `co trust`: Manage trust lists (contacts, whitelist, blocklist, admins) Subcommands: list, level, add, remove, block, unblock, admin.
- `co transfer`: Send credits to another agent address (irreversible, confirms first), or list transfers.
- `co doctor`: Diagnose installation.
- `co commands`: List every command, including subcommands, one per line with its summary.
- `co reset`: Reset account (destructive).

### mail & calendar

- `co email`: Send and read email from the agent's address. Subcommands: send, inbox, read, addresses, default, name, share, unshare, upgrade, sent.
- `co gmail`: Send and read email from your Gmail account. Subcommands: inbox, read, reply, send, sent, search, mark, archive, star, attachments, download, unanswered, draft, label.
- `co outlook`: Your Outlook account: mail, scheduled sends, contacts and calendar. Subcommands: send, inbox, read, download, reply, scheduled, cancel, sent, search, contact, calendar.
- `co gcalendar`: Google Calendar events and Meet links. Subcommands: list, today, read, meetings, free, create, meet, update, delete.

### chat apps

- `co whatsapp`: WhatsApp as an inbox: listen, receive, send, reply. Subcommands: listen, receive, send, reply, edit, delete, react, done, check, ls, chats, log, consume, group.
- `co telegram`: Telegram bot: send, plus experimental listen, receive and reply. Subcommands: send, listen, receive, reply, done, check, ls, chats, log, consume.
- `co discord`: Experimental: Discord bot as an inbox: listen, receive, send, reply. Subcommands: listen, receive, send, reply, done, check, ls, chats, log, consume.
- `co feishu`: Feishu bot as an inbox: listen, receive, send, reply. Subcommands: listen, receive, send, reply, done, check, ls, chats, log, consume.
- `co lark`: Lark (global Feishu) bot as an inbox: listen, receive, send, reply. Subcommands: listen, receive, send, reply, done, check, ls, chats, log, consume.
- `co sms`: Pair a phone and read the Agent's encrypted SMS inbox. Subcommands: pair, inbox, devices.

### browser & network

- `co browser`: Drive one persistent browser. Subcommands: do, tab, network, cookies, status, close, config, help.
- `co remote-browser`: Manage an owner-bound browser session on a remote agent over OIP. Subcommands: config, start, status, sessions, stop, diagnose.
- `co proxy`: Share this computer's internet connection with an authorized agent. Subcommands: share, status, stop, diagnose.
- `co call`: Run one command on a remote agent and print the result (no LLM).

### files & media

- `co gdrive`: List, search, download, and upload Google Drive files. Subcommands: list, search, info, get, put, rm.
- `co syno`: Connect to a Synology NAS, inspect its state and manage everyday files. Subcommands: login, logout, status, ls, info, search, download, upload, mkdir, copy, move, get, put, shares, nas, network, storage, service, share.
- `co youtube`: YouTube Data API using your saved Google login. Subcommands: channel, list, video, put, update.
- `co tiktok`: Experimental: TikTok post plans and read-only readiness. Nothing is uploaded. Subcommands: post, inspect.

### coding agents & memory

- `co claude`: Experimental: Run Claude Code through the ConnectOnion session connector. Subcommands: run.
- `co skills`: Discover, copy, list and link existing SKILL.md files; does not author or benchmark them. Subcommands: discover, copy, manifest, list, link.
- `co sub`: Follow public skills: co sub sync <0xaddress> once; co sub refreshes all saved publishers. Subcommands: sync, list, remove.
- `co announce`: Publish ~/.co/agent.json + SKILL.md bodies (publish:true) to the relay.
- `co wiki`: Experimental: Personal Wiki — map first, investigate next. Targets 1.9.0. Subcommands: init, investigate, open, list, show, search, start, stop, status, sync, logs, doctor, advanced, scan, map-skills, stub, reflect, reflections, propose, review, abstract, capture, sources, config.

### build & test

- `co ai`: Start AI coding agent or run one-shot prompt.
- `co create`: Create new project.
- `co copy`: Copy built-in tools/plugins to customize.
- `co benchmark`: Author the standard BEFORE editing a skill. Subcommands: list, check.
- `co eval`: Run a benchmark with the real Agent and inspect scored reports. Subcommands: run, report, legacy.

### run & ship

- `co deploy`: Deploy to ConnectOnion Cloud, or with --to onto a server you own.
- `co server`: Register, list and preflight the servers you can deploy to. Subcommands: add, ls, check, new, ssh, fix-key, forget, destroy.
- `co schedule`: This agent's own recurring work, from .co/schedule.yaml: see it, check it, run an entry now, pause or resume one. Subcommands: list, check, run, pause, resume.

## FAQ

### What is ConnectOnion?

ConnectOnion is the agent CLI harness. Each `co` command connects your AI agent to one service: Gmail, Outlook, Google Calendar, WhatsApp, Telegram, Discord, Feishu, SMS, a real logged-in browser, Google Drive or a Synology NAS. It also gives the agent its own 0x address, mailbox and memory, and it works from Claude Code and Codex. You don't create an OAuth app, add DNS records or write a Playwright script. It is an open-source Python package, Apache-2.0 licensed. Install it with `pip install connectonion`.

### What is an agent CLI harness?

A set of command-line tools an AI agent runs to reach real services: mail, chat apps, a browser, files, servers. Because each capability is an ordinary shell command, any agent with a shell can use it, including Claude Code and Codex, and a person can run the same command to check what the agent did. ConnectOnion's harness is the `co` command. More: https://docs.connectonion.com/guides/what-is-an-agent-cli-harness

### How do I give Claude Code or Codex access to Gmail?

Install ConnectOnion (`pip install connectonion`), run `co auth google`, then `co skills link`. The last command links ConnectOnion's bundled skills, including co-google, into Claude Code and Codex, so the agent can run `co gmail inbox`, `co gmail read` and `co gmail reply` from its shell. The Google credentials are saved only on your computer. Guide: https://docs.connectonion.com/guides/claude-code-gmail

### How do I give an AI agent its own email address?

Run `co init`. The agent gets a keypair, a 0x address and a mailbox at 0x…@mail.openonion.ai, hosted by OpenOnion, so there are no DNS records to set up. `co email send` sends and `co email inbox` reads. `co email name <name> --buy` claims a readable name@openonion.ai address from your credits. Guide: https://docs.connectonion.com/guides/ai-agent-email-address

### How do I connect an AI agent to WhatsApp?

Run `pip install 'connectonion[whatsapp]'`, then `co whatsapp listen`. Scan the QR code from WhatsApp (Settings → Linked devices → Link a device); every message is then written to ~/.co/inbox/whatsapp/. The agent takes the next one with `co whatsapp receive` and answers with `co whatsapp reply`. The linked device sees every chat on that number, so use a number meant for the agent. Guide: https://docs.connectonion.com/guides/ai-agent-whatsapp

### Can an AI agent use a browser I am logged into?

Yes. `co browser` keeps one real browser open between commands. You log in by hand once, including 2FA, and every later command (`co browser go_to`, `co browser get_text`, or `co browser do "…"` for an AI-driven task) runs in that logged-in session. Guide: https://docs.connectonion.com/guides/ai-agent-browser

### How is it different from an AI agent framework?

It still ships a Python Agent class, but the product is the harness. Every capability (browser, email, inboxes, files, remote calls, deploys) is a CLI command, so anything that can run a shell command can use it: your own ConnectOnion agent, or a coding agent such as Claude Code or Codex.

### Do I need an API key to try it?

No. New accounts get $5 of credit for managed models through the `co/` prefix, routed through OpenOnion's proxy. Put your own OpenAI, Anthropic or Google key in .env and change the model string whenever you like.

### How can an agent send email without setting up DNS?

Every agent gets its own mailbox at its address on mail.openonion.ai after `co auth`. It is an OpenOnion-hosted service, so there is no Resend or SendGrid account and no SPF, DKIM or MX records to add. `co email send` sends; bare `co email` shows the inbox.

### How does Gmail or Outlook work without my own OAuth app?

`co auth google` and `co auth microsoft` run the consent through OpenOnion's OAuth app, so there is no cloud project, consent screen or review queue on your side. The credentials come back encrypted to a one-time key your CLI generated and are saved only on your computer.

### Is agent traffic end-to-end encrypted?

No. Traffic between an agent and people outside your network passes through the OpenOnion relay, which terminates TLS and can read it.

### How do I control what an agent is allowed to do?

Dangerous tools (bash, shell, file writes, background tasks, email, delete) stop and ask for approval in the chat UI when one is attached, and file edits arrive as a diff. Custom tools you add run without asking unless you list them in .co/host.yaml. Remote agents calling yours with `co call` can only run what your .co/host.yaml whitelist names.

### Which models does it work with?

OpenAI, Anthropic, Google, Groq, Grok, OpenRouter and Mistral, or managed keys through the `co/` prefix. The model is a string you can change.

## Guides

- [What is an agent CLI harness?](https://docs.connectonion.com/guides/what-is-an-agent-cli-harness)
- [How to give Claude Code or Codex access to Gmail](https://docs.connectonion.com/guides/claude-code-gmail)
- [How to give an AI agent access to Gmail and Outlook](https://docs.connectonion.com/guides/ai-agent-gmail)
- [How to give an AI agent its own email address](https://docs.connectonion.com/guides/ai-agent-email-address)
- [How to give an AI agent a logged-in browser](https://docs.connectonion.com/guides/ai-agent-browser)
- [How to connect an AI agent to WhatsApp](https://docs.connectonion.com/guides/ai-agent-whatsapp)
- [How to connect an AI agent to Telegram, Discord, Feishu or SMS](https://docs.connectonion.com/guides/ai-agent-chat-apps)

## Links

- [Home](https://www.connectonion.com/): the agent CLI harness
- [Documentation](https://docs.connectonion.com): Guides, quickstart and API reference
- [GitHub](https://github.com/openonion/connectonion): Source code, Apache-2.0
- [PyPI](https://pypi.org/project/connectonion/): pip install connectonion
- [Discord](https://discord.gg/4xfD9k8AUF): Community and support
- [Manifesto](https://www.connectonion.com/manifesto): why we build it this way
