Skip to content
المشاريع

حول

Cross-vendor middleware for coding agents: every model call, its cost and the full conversation, through one gateway.

أدوات التطوير

كيف تُقاس هذه الأرقام

257 نجمة58 التفرعات +19 خلال 24 ساعة

النمو المقاس للنجوم

خلال 24 ساعة
+١٩
خلال 7 أيام
+١٦٨
خلال 15 يومًا
+١٩١
خلال شهر
جارٍ جمع السجل

تغيّر صافي النجوم خلال فترات متداخلة، وليس مجموعًا يوميًا. تبقى القياسات المفقودة فارغة. النجوم تقيس الاهتمام لا جودة البرمجيات.

README.md

الأصل
AgentBus

Control every AI agent in a single place.

GitHub stars Latest release CI

Quickstart  •  Demo  •  Docs  •  Cockpit  •  Releases

AgentBus 0.6.10: Claude Code builds a change in a copy of your folder, CodeRabbit reviews it, and the change waits in Changes until you Apply. Click to watch the 1-minute demo.

AgentBus runs the coding agents you already have: Claude Code, Codex, Antigravity, OpenCode or any OpenRouter model. It sits between them and the model vendors, and it records every step.

  • Your agents work together. Claude can ask Codex, or any agent from any vendor, to answer a question, take on a task or check its work. The answer comes back into the same session.
  • You see every model call and what it cost: exactly what each model was sent, piece by piece, and what it answered.
  • Copy protects your code. The agent works in its own copy of your folder, and its changes reach your folder only when you apply them. Sandbox is Copy with your permission rules on.
  • Everything stays on your machine. Your sessions, every model call and reply, and your sign-ins and keys are kept in AgentBus's data folder on your machine.

Install

You need macOS or Linux, and claude, codex, agy or opencode installed. Use one of these.

Install script (puts the binary in ~/.local/bin):

curl -fsSL https://raw.githubusercontent.com/staysup/agentbus/main/install.sh | sh

Homebrew (macOS or Linux): brew install staysup/tap/agentbus

From source (Go 1.27.1 or later): go install github.com/staysup/agentbus/cmd/agentbus@latest. A source build serves the API only, with no cockpit. agentbus up then prints the one command that adds it.

Check the install with agentbus version. The script never edits your shell profile. If ~/.local/bin is not on your PATH, it prints the line to add for zsh, bash or fish. Set AGENTBUS_INSTALL_DIR for another folder, or AGENTBUS_VERSION for another release.

Quickstart

From nothing to two vendors talking about the same work. You need claude and codex installed, and a Claude and a ChatGPT subscription.

  1. Start AgentBus. Run agentbus up -open. It opens the cockpit in your browser. The cockpit comes with agentbus up: nothing else to install. If the link has expired, see The sign-in link.
  2. Add your agents. A new AgentBus has no agents. Press + Agent at the top of the Agents column, pick Claude Code, and press Create agent. Do the same for Codex.
  3. Log in to each tool. If you have not yet, run claude auth login and codex login on this machine. AgentBus uses each tool's own login. You do this once.
  4. Ask Claude something. Press + Session, pick Claude Code, type the path of a project folder and press Start. Send a first message, such as "what does this project do?".
  5. Ask Codex about it. In the same session, switch the agent beside Send to Codex. Send "what do you think about the answer above?". Codex reads Claude's answer and gives its own.

Every turn and every model call is now in the record, with its cost.

Three modes: Direct, Copy, Sandbox

You pick a mode when you start a session. The choice is remembered.

  • Direct. The session works in your folder itself, like your terminal. No wall, no rules.
  • Copy (the default). The session works in its own copy of your folder. The agent's writes reach your folder only through Review and Apply. Several sessions can work on the same code at once. Copy has no permission rules, so nothing waits for you.
  • Sandbox. Copy, with your permission rules on. Allow, Ask and Forbid in Settings decide every command and tool, so a call can wait for you or be refused.

Copy protects your code. It does not protect your machine or your secrets: see Known limits.

Direct Copy (default) Sandbox
Works in your folder its own copy its own copy
Wall around the agent none srt srt
Writes anywhere anywhere except your project folders and AgentBus's data folder as Copy
Network open open open, as Copy
Docker, ssh-agent open open open, as Copy
Home yours yours, with your setup as Copy
Secrets readable readable readable, as Copy
Permission rules none none all of them
The agent's writes reach your folder at once only through Review and Apply (Docker is a way past it) as Copy

The wall. In Copy and Sandbox the whole agent runs inside one wall that AgentBus builds with srt: its commands, hooks, MCP servers and file tools, the same for every agent. The wall refuses writes to your project folders and to AgentBus's data folder, and hides that folder (its token, sign-ins and record). Package and build caches go to the session's own folder, and closing the session removes them. Your setup comes in read only, without the agents' own login files.

Sandbox keeps each agent's own permission checks on. Its default Forbid on tool:subagent applies in Sandbox only, so subagents run in Direct and Copy. A Codex Sandbox turn whose rules forbid edits is refused at its start: Codex's only edit check is its own sandbox, which cannot start inside the wall. In the API it is "mode":"sandbox" on POST /api/v0/workspaces. Still to come: hidden secrets, a home of its own, a network allow-list, Docker and ssh-agent closed, and git push held until Apply.

What Copy needs. A runner needs srt for Copy and Sandbox. The release tarball and Homebrew ship AgentBus's own tools, pinned, in libexec/agentbus-tools beside agentbus: srt, the Node.js it runs on, the git a copy keeps its checkpoints with, and on Linux bwrap, socat and ripgrep. You install none of them. On Linux they need glibc, so on musl (Alpine) Copy is refused. The shipped git needs glibc 2.34 or later; on an older system (Debian 11, Ubuntu 20.04, RHEL 8) the runner uses the git on PATH. A source build or go install needs srt on PATH, on Node.js 22.12 or later (on Linux also bwrap, socat and ripgrep), until it fetches the tools itself.

Review, apply, discard

A Copy or Sandbox session's workspace holds its copy, and its file changes are held for you. Open the session, read what each turn changed, and ask another model to check it with Review, right next to Apply. Then Apply writes the changes into your folder, or Discard drops the copy. What a turn's commands did outside the copy is shown in the turn view; it is not undone.

What each agent gets

Claude Code Codex OpenCode Antigravity (agy) Shell
Sign-in Claude subscription, or an Anthropic API key ChatGPT sign-in, or an OpenAI API key OpenRouter or xAI key (its own sign-in: not yet) a Gemini API key; its Google sign-in does not work yet on macOS (kept in the Keychain) none: it runs no model
Copy: AgentBus's wall around the whole turn yes, checked live yes, checked live yes, checked live yes, but not measured live: agy cannot sign in on macOS yet yes: run_command's in a fork of the asker's copy, a "!" line in the session's own copy
Sandbox: the permission rules apply all all all tool and API rules; shell forbid rules are refused, since the gateway cannot read Gemini's format command rules for run_command; none for a "!" line (the mode's wall still holds)
Every model call recorded yes yes yes yes no model calls
AgentBus builds each turn's history (own replay) yes yes yes no: the vendor's own resume not needed
A note reaches a running turn yes yes yes at the next turn's start no
Can ask other agents, review, run_command yes yes yes yes no
Can be the reviewer (review_turn) yes yes yes yes no: it has no model to read a turn
Known limits chained commands can be blocked by its own rules in Sandbox; its Chrome browser does not run, since it needs the tool's own sign-in a Sandbox turn whose rules forbid edits is refused gets no instructions or AgentBus tools (it reaches the API through agentbus-api); a turn with forbidden or asked commands is refused; a command on no list is refused, not held; below a git repository's root it runs without edits, since OpenCode would edit the whole repository gets no instructions; a turn with forbidden commands is refused; it cannot turn off its own subagents runs one command line; an agent starts one with run_command, you with a "!" line

Sign-ins and keys

A turn on a subscription uses the tool's own login on the machine that runs it: run claude auth login or codex login there once. The tool's calls still go through AgentBus, so every call is recorded. A turn on a machine where the tool is not logged in ends with a sentence that says how to log in. The rest of your setup comes along, since the turn runs in your real home: CLAUDE.md, hooks, plugins, skills, and logins such as gh, aws, ssh and gitconfig.

An agent can use an API key instead. Paste it once in Settings, Subscriptions: an OpenRouter key for any OpenRouter model, or the vendor's own key (Anthropic for Claude Code, OpenAI for Codex, Gemini for Antigravity). AgentBus adds it only to that vendor's model calls. It never shows it again or gives it to an agent. Replace and Remove change it. An agent's access says which it uses:

  • subscription: the tool's own login on the machine that runs the turn. The model is optional.
  • openrouter: an OpenRouter key. The model is required, in OpenRouter's naming.
  • api: the vendor's own API key set in Settings. The model is optional.

OpenCode 2 or later (curl -fsSL https://opencode.ai/v2/install | bash) runs on an OpenRouter key (openrouter) or an xAI key; its own sign-in is not used yet.

Use any model

Claude Code can run on any model OpenRouter offers. The agent is still Claude Code; only the model behind it changes. Add an OpenRouter key in Settings, Subscriptions. Then add a Claude Code agent with access openrouter and a model id in OpenRouter's naming, such as openai/gpt-oss-120b (GPT) or deepseek/deepseek-v4.1-flash (DeepSeek). Start a session with it as in the Quickstart. To have another model check the work, add a second such agent with another model id, switch to it beside Send, and send "check the work above".

Claude Code's tools are tuned for Claude, so other models may behave differently. Give clear steps and read what they reply.

The sign-in link

agentbus up prints a sign-in link, http://127.0.0.1:8787/?t=…, and -open also opens it. The link works once, for 10 minutes. For a new one, run agentbus open in another terminal: it opens a new link for the running up, with no restart (-print only prints it). It finds up by the address up recorded in the data folder, and sends the token to this machine only.

Or paste the token on the cockpit's sign-in screen. It is the file token in the data folder that up prints when it starts ($AGENTBUS_HOME, by default ~/.local/share/agentbus). Copy it without showing it: pbcopy < ~/.local/share/agentbus/token on a Mac, or xclip -sel c < ~/.local/share/agentbus/token on Linux. Anyone with the token controls your agents, so keep it to yourself.

Session history

agentbus up, server and runner continue Claude and Codex sessions by sending the earlier turns' history through the gateway (-replay, on by default; -replay=false uses the vendor's own resume). The history is kept within 40% of the model's window (context.history_budget in /api/v0/settings/permissions). Older long tool output becomes stubs the agent can fetch back, and the oldest turns become a short summary. The record keeps every byte.

Settings

Open Settings in the cockpit. A change applies from the next turn.

  • Subscriptions: paste an API key, and see how much of each plan is used.
  • Sandbox: Allow, Ask and Forbid rules for commands and tools, in Sandbox sessions only, and whether an agent may apply its own changes. By default everything runs except starting subagents. A call on Ask waits up to 60 seconds for your answer.
  • Limits: how deep agents may ask each other, how many turns, and the cost. At most 8 turns started by agents run at once; change it in Settings, Limits.

Every key and its default is in the API reference the service serves at /docs, under Settings (see Docs).

Upgrading

Install again the way you installed, then restart agentbus up:

  • Install script: run the same curl ... | sh line. It replaces the binary.
  • Homebrew: brew upgrade staysup/tap/agentbus.

Your data folder, sessions and settings stay as they are. If you run runners on other machines, upgrade them too: control refuses a runner on an older protocol.

Known limits

  • Windows is not supported yet.
  • Ubuntu 24.04 and later: Copy is slow until AgentBus's AppArmor profile is installed. This install puts it in place: curl -fsSL https://raw.githubusercontent.com/staysup/agentbus/main/install.sh | sudo AGENTBUS_INSTALL_DIR=/usr/local/bin sh
  • Copy protects your project folders, not your secrets. Agents read what your terminal reads: ~/.aws, ~/.ssh, git credentials, a .env.
  • Docker can write your folder from Copy and Sandbox. That change skips Review and Apply. Use Direct for Docker work.
  • Antigravity (agy) runs on a Gemini API key, and OpenCode on an OpenRouter or xAI key, for now. Their own sign-ins do not work through AgentBus yet.

Every deeper case of the wall is in SECURITY.md.

Docs

The running service describes its own API, without the token or the internet:

  • http://127.0.0.1:8787/docs: the API reference, as a page.
  • http://127.0.0.1:8787/api/v0/openapi.json: the same, as OpenAPI 3.1. It is the contract. Generate a client from it in any language.
  • http://127.0.0.1:8787/docs/llms.txt: one short page for coding agents.

Running agents on more than one machine is described at /api/v0/runner/openapi.json. Third-party code in the binary is listed in THIRD_PARTY.md.

To contribute, see CONTRIBUTING.md, the ROADMAP.md, and SECURITY.md for reporting a vulnerability.

License

Free to use, change and run, including inside your business. You can't sell it as a competing product or service. Each release becomes Apache 2.0 two years after it is published.

Licensed under the Functional Source License (FSL-1.1-ALv2). See LICENSE.

استكشف مشاريع مشابهة ومرتبطة

جارٍ التحميل…