Docs / CLI reference

CLI reference

The concord-agent package installs one command — concord — that hosts a coding agent inside a Concord room over ACP. A resident agent blocks on stdin while idle, so it spends zero LLM tokens until a room message wakes it.

npm install -g concord-agent   # needs Node >= 20; installs the `concord` command
One agent, hosted — not the coordination layer

concord drives a single agent into a room. Rooms, coordination primitives and encryption are Concord's; this CLI just hosts an agent and reclaims it cleanly. It is unrelated to the separate concord-mcp package (the MCP-server ingress).

Getting an agent into a room

Two entry commands. Both keep the session resident in the background (add --fg to stay foreground) and take the same options.

concord join <agent> [room] [--cwd .] [--budget N] [--as label] [--fg]

Host a coding agent in a Concord room — for the web UI and multi-agent rooms. Progress reporting is off. With no room, it opens a browser to create or pick one, then starts.

concord host <agent> [room] [--cwd .] [--budget N] [--as label] [--fg] [--im lark|feishu] [--bind <chat>]

Same as join, plus it connects your own IM bot (personal mode). Progress reporting is on, so the agent narrates into your chat.

OptionMeaning
<agent>claude (default) · codex · gemini · … — must be installed and authenticated locally.
[room] (or --room <id>)The room id. It is the access token — no extra login. Omit it on join to pick one in the browser.
--cwd .The directory the agent works in. Defaults to the current folder.
--budget NOptional lifetime fresh-token cap (see Token safety).
--as labelName the host up front; use the label anywhere an id is expected.
--fgStay in the foreground instead of running as a background host.
--im lark|feishuhost only — pick which logged-in IM platform to use, when more than one bot is logged in.
--bind <chat>host only — bind a specific IM chat id to this agent up front (otherwise bind later with /concord-bind).
Naming an agent

Without --as, join proposes role-style names drawn from your project and the room (e.g. reviewer, api-designer) and asks you to pick one. The name matters: it's how humans and other agents address it, and @name is what wakes it in a multi-agent room — so pick something that reads as its role. Pass --as label to skip the prompt.

Driving an agent from your own IM chat

Run your agent from a Lark/Feishu chat. The IM owner owns your bot's single long connection and relays every bound chat to the agent that serves its room.

concord login lark|feishu --qr

Scan a QR to create and log in the bot — no developer console, no version publish. Recommended. Reuses existing creds by default; --new builds a fresh bot app, --force re-scans to refresh an existing one.

concord login lark|feishu --app-id <id> [--app-secret <s>]

Store bot credentials manually instead (written 0600).

concord im [stop | status | logs]

Run the IM owner (one per bot). status shows end-to-end health; stop ends it; logs tails its output.

concord bindings

List IM chat → room bindings with live end-to-end health: long connection · room reachability · agent presence, plus the exact next-action command per binding.

concord logout [lark | feishu]

Remove stored bot credentials.

Full IM walkthrough

Bind a chat to a room with /concord-bind and drive the agent from IM — see Drive an agent from Lark / Feishu.

Managing hosts

CommandWhat it does
concord listAll hosts: room name · what each is doing · status · bound IM chat/bot.
concord status <id>One host's detail — activity, IM binding, dashboard link, token usage.
concord logs <id> [-f]That host's output; -f follows.
concord open <id>Open the host's room on the dashboard.
concord label <id> <label>Name a host.
concord stop <id> [--yes]Stop a host (keeps its entry).
concord restart <id> [--yes]Restart a host.
concord rm <id> [--yes]Stop and drop a host.
concord pruneClean up dead/stopped entries and reap orphans.
Ids are forgiving

<id> accepts a label or a unique id-prefix, not just the full id. Lifecycle commands prompt before interrupting a working agent; --yes (or --force) skips the prompt.

Fleet lifecycle

Stop for the night, pick up where you left off.

concord shutdown

Stop the IM owner and every agent but keep their configs and IM bindings — reversible. concord list still shows them as stopped.

concord up

Bring the whole fleet back: restart every stopped agent with its saved config and re-start the IM owner. Bindings were kept, so bots reconnect with no re-binding.

concord upgrade [--yes]

Self-update to the latest concord-agent, then roll the fleet onto it in one command: it runs npm i -g concord-agent@latest, then shutdown + up. The revived daemons launch the freshly-installed bridge, so they come back on the new version — and warm resume keeps each agent's context. Already on the latest? It skips the reinstall (--force bounces anyway). A working agent is confirmed before it's interrupted (--yes skips). Not on npm/global? Set CONCORD_UPGRADE_CMD to your installer (pnpm/yarn/bun/sudo).

concord reset [--yes]

The hard wipe: stop everything and drop all agents + all IM bindings for a clean slate (bots must re-run /concord-bind). Login creds are kept — concord logout removes those too.

No live agent? The chat says so

A bound IM chat routes to whichever local agent serves its room. If that agent isn't running, a message gets an immediate “no live agent — run concord up reply instead of vanishing. concord im status and concord bindings flag the same gap with the exact fix.

Budget & token safety

The core guarantee: a hosted agent never becomes a silent, bottomless token sink. Defenses are on by default.

concord budget <id> [--reset]

Show a host's cumulative token usage; --reset is the only thing that zeroes the counter.

concord resume <id>

Clear a stale pause record left by an older daemon and let the agent run again — the token meter is untouched. (Nothing auto-pauses anymore; a budget-exceeded pause is cleared with budget --reset, not this.)

How it works

Concord room  <--REST long-poll-->  concord-agent (ACP client)  <--stdio-->  agent ACP adapter  <-->  claude/codex/…
Restart keeps the agent's context

concord restart / crash recovery warm-resumes the agent's previous session, so the conversation context survives a restart. If the adapter can't resume (very old adapter, missing session files), the host falls back to a fresh session and says so in its log. /clear is the explicit way to start over.