> ## Documentation Index
> Fetch the complete documentation index at: https://docs.octomerge.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Bring your own agents

> Use Claude Code, Codex and Antigravity, signed in as you on your own computer, in your chats: Otti Connect brings them into the model menu, and their commands and edits run on the chat's worker.

Bring the coding agents you already use to Octomerge: **Claude Code**, **Codex** and **Antigravity** (Google Antigravity's CLI), each signed in as you on your own computer, with the plan or account you already have. They appear in your chats' model menu next to every other model, under **Your agents**. The agent runs on your computer and talks to its maker from there; its commands and file edits run on the chat's worker, through Octomerge's tools, like any agent's.

**Otti Connect** brings them in: an open-source connector, built by Octomerge and the community, that you run on the computer where the agents are signed in. A computer that runs it is one of your **agent hosts**: the laptop you work on, or a computer that is always on, such as a home server ([in Docker](#run-it-in-docker-on-an-always-on-computer)).

## How it works

* Otti Connect connects your computer to Octomerge by itself, over HTTPS: the computer doesn't have to be one of your workers. It tells Octomerge which agents are installed there and whether each is signed in, then waits for your chats' turns.
* When you send a message to one of your agents, Octomerge hands the turn to your first connected computer that has that agent ([Which computer a chat uses](#which-computer-a-chat-uses)). Otti Connect runs the agent there, with the agent's own sign-in, and carries the turn between the agent and the chat: your messages one way; the agent's answer, its thinking and its tool calls the other.
* On your computer, the agent's own file and shell tools are off, and it works in an empty folder of its own. It works with Octomerge's tools instead: `shell`, `read`, `write`, `edit`, `grep`, `find` and `ls` run on the chat's worker, in its checkout, as they do for every agent, and the chat shows each call. It gets Octomerge's other tools too, such as questions to you, plans, web research and your [MCP servers](https://docs.octomerge.dev/get-started/mcp-servers.md).
* The agent gets your account's and project's instructions and skills from Octomerge, as every agent does ([AGENTS.md and skills](https://docs.octomerge.dev/platform/agent-instructions-and-skills.md)).
* What the agent says and does becomes the chat's history, like any agent's. Octomerge keeps a turn's raw exchange with Otti Connect for 24 hours after the turn ends, then deletes it.

So the chat's files can be on any worker, such as a VPS, a container or another computer, while the agent runs on yours, with your sign-in.

## What you need

* A computer with macOS or Linux. On Windows, run Otti Connect in WSL, where it works as on Linux.
* Node.js 18 or newer, with npm: they run Otti Connect and install the agents.
* For each agent you want to use, an account with its maker that the agent signs in with: Claude for Claude Code, ChatGPT for Codex, Google for Antigravity.
* A worker for your chats, where the agents' commands and file edits run, as for every agent ([Connect a worker](https://docs.octomerge.dev/get-started/add-worker.md)). It can be the same computer.
* On octomerge.dev, a plan: agents run with one, your own agents too ([Signing up](https://docs.octomerge.dev/index.md#signing-up)). Without one you can still connect your computer and see your agents in **Settings → Your agents** and in the model menu.

## Connect a computer

**1. Start Otti Connect**

In a terminal on the computer, run:

```bash theme={null}
npx --registry https://npm.octomerge.dev @octomerge/otti-connect@latest
```

**Settings → Your agents** shows the same command under **Connect a computer**. For an installation other than octomerge.dev, it adds `--base-url` with that installation's address. With `@latest`, running the command again runs the newest release of Otti Connect.

On its first start, Otti Connect installs the versions of Claude Code, Codex and Antigravity that Octomerge has tested, in a folder of its own, `~/.otti-connect/agents`: about 470 MB to download, 1.2 GB on disk. This takes a few minutes, and it shows its progress. Later starts use them. Copies of the agents you installed yourself stay as they are, and both use the same sign-ins.

**2. Approve the code**

The first time, Otti Connect signs the computer in to Octomerge: it shows a code and a link, and opens the link in your browser (`--no-open` leaves that to you). In the browser where you're signed in to Octomerge, check that the code matches and approve. A code that expires before you approve it is replaced by a new one.

The approval page says that Otti Connect asks to connect the computer as an **agent host**. That sign-in can connect an agent host and nothing else: it can't read your secrets or reach your workers. Otti Connect saves it in `~/.otti-connect`, readable only by you, and never prints it; later starts connect with it, without a code.

The computer then appears in **Settings → Your agents**, with its agents and whether each is signed in. If you have no default model yet, as on a new account, **Your agents** becomes your default, on its first model; choose another in **Settings → Models** or in a chat's model menu.

**3. Sign in to each agent**

Sign in to each agent you want to use, once, in a terminal on the computer, with the agent's own command and its maker's own sign-in:

```bash theme={null}
claude auth login   # Claude Code
codex login         # Codex
agy acp --login     # Antigravity
```

An agent already signed in on the computer needs nothing more. When you haven't installed an agent yourself, its command isn't on your `PATH`: `otti-connect status` and **Settings → Your agents** show the command that signs in Otti Connect's copy.

Leave Otti Connect running: your chats use the computer's agents while it runs. It prints a line when a turn starts and when it ends, never what the turn is about. It checks the agents' sign-ins every few minutes, so **Settings → Your agents** shows one you just made within a few minutes, or at once when you start Otti Connect again.

**Ctrl+C** stops it: it ends the turns running there first, and the computer shows as **Offline** at once. Start it again with the same command; it connects with its saved sign-in. While the computer sleeps or Otti Connect is stopped, your chats use your next connected computer with the agent ([In a chat](#in-a-chat)).

One Otti Connect runs per sign-in: a second one on the same computer refuses to start. To connect the computer to another Octomerge installation too, give that one a folder of its own with `--config-dir`.

### Name the computer

The computer is named after its host name. To give it another name, start Otti Connect the first time with `--label`, for example `--label work-laptop`: letters, digits, dots, hyphens and underscores. Once it is connected, the name is Octomerge's: rename the computer in **Settings → Your agents**; a later `--label` doesn't change it.

The names of your agent hosts are unique. A computer that connects with the name of an agent host that is connected is refused, and Otti Connect asks you to choose another name with `--label`. One that connects with the name of an agent host that has been offline for a minute takes that host's place, with its switches and its place in the order, and the old host's sign-in stops working: a reinstalled computer comes back as itself, not as a second one.

## Run it in Docker on an always-on computer

For a computer that is always on, such as a home server, run Otti Connect from its Docker image, `ghcr.io/octomergehq/otti-connect`, for **linux/amd64** and **linux/arm64**. The image holds Otti Connect with the agent versions Octomerge has tested. Its volume keeps Otti Connect's sign-in and the agents' sign-ins, so they survive restarts and newer images.

1. Start it the first time in the foreground, so you see the code:

   ```bash theme={null}
   docker run -it --name otti-connect --hostname home-server \
     --restart unless-stopped \
     -e OTTI_CONNECT_LABEL=home-server \
     -v otti-connect:/home/otti \
     ghcr.io/octomergehq/otti-connect
   ```

   Approve the code it prints, as in [Connect a computer](#connect-a-computer), then leave it running with **Ctrl+P Ctrl+Q**, which detaches your terminal. Started with `-d` instead of `-it`, it prints the code in its log: `docker logs -f otti-connect`. `OTTI_CONNECT_LABEL` names the computer (the container's host name by default), and `-e OTTI_CONNECT_BASE_URL=<address>` connects it to an installation other than octomerge.dev.

2. Sign in to each agent inside the container, once, with its own command:

   ```bash theme={null}
   docker exec -it otti-connect claude auth login
   docker exec -it otti-connect codex login --device-auth
   docker exec -it otti-connect agy acp --login
   ```

   Each prints an address to open in your browser, and Claude Code and Antigravity a code to paste back into the terminal. For Codex, `--device-auth` signs in with a code, which works from a container.

The volume, `otti-connect`, is the home folder of the image's user: it holds Otti Connect's sign-in and the agents' sign-ins. A new container on the same volume, such as one of a newer image, keeps them:

```bash theme={null}
docker pull ghcr.io/octomergehq/otti-connect
docker stop otti-connect && docker rm otti-connect
docker run -d --name otti-connect --hostname home-server \
  --restart unless-stopped \
  -e OTTI_CONNECT_LABEL=home-server \
  -v otti-connect:/home/otti \
  ghcr.io/octomergehq/otti-connect
```

`docker stop` ends the turns running in the container and tells Octomerge before it stops. `docker exec otti-connect otti-connect status` shows the agents and their sign-ins, and `docker exec otti-connect otti-connect logout` signs the container out of Octomerge.

## Manage your agent hosts

**Settings → Your agents** lists your agent hosts and their agents, and updates by itself. Its first lines say what else a chat needs: a project, a worker and, on octomerge.dev, a plan, each linked to where you set it up.

* **Agent hosts**: each computer with its name, **Connected** or **Offline** (with when it was last seen), its system and its Otti Connect version. Under it, each agent with its version and its sign-in: **Signed in** with Claude, ChatGPT or Google, with the models it offers; **Not signed in**, with the command that signs it in on that computer; or **Not installed**.
* **A switch per agent** offers it from that computer. Turn it off to leave the agent out there: an agent turned off on every computer leaves the model menu.
* **Rename**, in the computer's **⋯** menu, changes the name chats and this page show.
* **Forget**, in the same menu, removes the computer and revokes its sign-in: its agents leave the model menu, unless another computer offers them, and chats can't run them there. The agents stay installed and signed in on the computer. An Otti Connect still running there says its sign-in no longer works and shows a new code: approve it to connect the computer again, or stop it.
* **Connect a computer** shows the command that starts Otti Connect and the steps above, and says when the new computer is connected.
* **Versions** lists the versions of Otti Connect and of each agent that Octomerge tests, and on how many of your computers Otti Connect is up to date.

### Which computer a chat uses

With two or more agent hosts, **Which computer a chat uses** orders them. The model menu lists each agent's models once, whichever computers offer it, and a turn runs on the first computer in this order that is connected and has the agent installed and turned on. Move a computer up or down to change the order; it applies from the next turn.

### Updates

Otti Connect updates the agents together with itself: each release runs the agent versions Octomerge tested with it, and installs them when it starts. To update a computer, stop Otti Connect and start it again with the same command, which runs the newest release. In Docker, pull the newer image and start a new container on the same volume, [as above](#run-it-in-docker-on-an-always-on-computer). Copies of the agents you installed yourself are never updated by Otti Connect.

## In a chat

Choose one of your agents in the model menu at the bottom of the composer, under **Your agents**: for example **Claude Code · Sonnet**, **Codex** or **Antigravity**. The agents signed in on your computers come first. When **Your agents** is your default connection, your default model is its first model, unless you choose another in **Settings → Models**. The effort you choose goes to the agent. Then work with it as with any model:

* The agent continues its own session from turn to turn, and keeps its own context, as it does in its own terminal.
* A message you **Steer** while it works reaches it during its turn; one you **Queue** waits for the turn to end, as with any model.
* **Stop** ends its turn. Its session keeps what it did, and your next message continues it.
* Images you attach to a message reach the agent with it.
* Its commands and file edits show in the chat as calls of Octomerge's tools, on the chat's worker.

If the computer goes away during a turn, because Otti Connect stopped or the computer slept or lost its network, the chat says so, for example "Codex could not finish the turn: Otti Connect on your agent host home-server stopped during the turn. Send a message to go on." Your next message carries on, on your next connected computer with that agent. An agent's session stays on the computer that ran it, so a turn on another computer starts a new session there, given the conversation so far. When none of your computers with the agent is connected, or the agent is turned off on them, the chat says so: start Otti Connect on one of them (**Settings → Your agents** shows the command), or turn the agent on there, then send the message again.

Your plan's usage limits apply as they do in the agent's own terminal: when the agent reaches one, it says so in the chat.

An agent that isn't signed in on the computer ends its turn with its own error. When Otti Connect reports it isn't signed in there, the chat first names the command that signs it in, the one **Settings → Your agents** shows, with the agent's own error below it: run the command in a terminal on that computer, then send the message again.

## Your sign-ins

Two kinds of sign-in are involved, and they stay apart:

* **Otti Connect's sign-in to Octomerge**, the one you approve with a code, connects the computer as an agent host and nothing else. `otti-connect logout` forgets it on the computer and revokes it, and the computer leaves **Settings → Your agents** by itself; **Forget** there does the same from Octomerge's side.
* **Each agent's sign-in to its maker** stays on the computer, where the agent keeps it: in its own folder in your home folder (`~/.claude`, `~/.codex`, `~/.gemini`) or in the system's keychain. Otti Connect never reads, copies or sends a sign-in, and Octomerge never sees or stores one.

Sign in to each agent with the agent's own command, in a terminal on the computer itself, or in its container with `docker exec`. Neither Otti Connect nor Octomerge offers a sign-in for any agent: don't sign an agent in through Octomerge, such as in a chat or on a branch's [Shell page](https://docs.octomerge.dev/get-started/add-worker.md#shell).

Otti Connect removes API keys and other endpoints, such as `ANTHROPIC_API_KEY`, `OPENAI_API_KEY` and `GEMINI_API_KEY`, from each agent's environment, so a chat always runs on your sign-in, never on an API key by accident.

Your computers' agents run turns of your own chats only: Otti Connect has no way to share or pool accounts.

## Commands

With npx, put the command after the one that starts Otti Connect, for example:

```bash theme={null}
npx --registry https://npm.octomerge.dev @octomerge/otti-connect@latest status
```

In the Docker image, `otti-connect` is on the `PATH`: `docker exec otti-connect otti-connect status`.

| Command | |
| - | - |
| `otti-connect`, `otti-connect start` | Installs the tested agents it lacks, signs the computer in if it isn't, connects it and runs its turns until you stop it |
| `otti-connect status` | The agents on this computer, with their versions and sign-ins, without connecting |
| `otti-connect install` | Installs the tested agents, without connecting |
| `otti-connect logout` | Forgets this computer's sign-in and revokes it in Octomerge: the computer leaves **Settings → Your agents** by itself |
| `otti-connect --version` | Otti Connect's version, and the version of the connector protocol it speaks |

| Option | |
| - | - |
| `--label <name>` | The computer's name when it first connects: letters, digits, dots, hyphens and underscores. Default: `$OTTI_CONNECT_LABEL`, else the host name. Afterwards, rename it in **Settings → Your agents** |
| `--base-url <address>` | The Octomerge installation to connect to. Default: `$OTTI_CONNECT_BASE_URL`, else the one the computer signed in to, else `https://octomerge.dev` |
| `--config-dir <folder>` | Where Otti Connect keeps its sign-in, and the agents unless `--agents-dir` names another folder. Default: `~/.otti-connect` |
| `--agents-dir <folder>` | Where the agents are installed. Default: `$OTTI_CONNECT_AGENTS_DIR`, else `agents` in the config folder |
| `--no-open` | Doesn't open the approval page in the browser |

## Good to know

* Each command and file operation of the agent goes from your computer through Octomerge to the chat's worker and back: quick enough for edits and commands, slower than an agent on the worker itself for many small reads.
* The agent's computer has to stay on and connected while the agent works, even when the chat's files are on an always-on worker: a laptop that goes to sleep ends the turn it was running. For agents that keep working while your laptop sleeps, use an [always-on computer](#run-it-in-docker-on-an-always-on-computer).
* Antigravity takes only so many tools from one connection, so Octomerge offers it the shell, file and conversation tools first, and leaves out some of the browser tools.

## Open source

Otti Connect is open source, under the Apache License 2.0: its source is at [github.com/octomergehq/otti-connect](https://github.com/octomergehq/otti-connect), with [how it runs your agents](https://github.com/octomergehq/otti-connect/blob/main/HOW-IT-RUNS.md) and the connector protocol any connector can speak.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.