Command line
The npm package installs one program under two names, duo and agentduo. duo alone opens the chat; with a task it runs the pipeline once and exits.
On this page
Commands
| Command | What it does |
|---|---|
duo | Opens the chat in this workspace (an interactive terminal only). |
duo "<task>", duo run "<task>" | Starts a pipeline run with the task, shows it until it ends, and exits with its exit code. |
duo resume [runId] | Continues the latest run, or the one named, optionally answering its pending decision. |
duo status [runId] | Shows a run’s phase, rounds, cost and tokens, its last steps, and where its files are. |
duo list | Lists the runs of this workspace: id, phase, last update and task. |
duo doctor | Checks the CLIs, the config and the workspace, without calling any model. |
duo init | Creates .agentduo/config.yaml and .agentduo/.gitignore, and offers git init. |
duo --help, duo <command> --help | Prints the usage. |
duo -V, duo --version | Prints the version. |
duo and agentduo are the same program: every example on this site works with either name.
Common options
Every command takes these options, before or after the command name (duo --dir ../api list and duo list --dir ../api are the same).
| Option | Effect |
|---|---|
--dir <path> | The workspace: this directory, not the repository root above it. Default: the current directory. |
--config <path> | The config file to use instead of <dir>/.agentduo/config.yaml. The user config is still read first. |
--plain | Plain timestamped lines instead of the live terminal UI. It is the default when stdout is not a terminal, when CI=true, or when the process runs in the background (duo … &). |
-v, --verbose | Shows every agent activity, thoughts included. |
--no-color | No colours. Setting NO_COLOR in the environment does the same. |
| Option | Commands | Effect |
|---|---|---|
--task-file <file> | duo, duo run | Reads the task from a file. With words as well, the file’s text comes after them. |
--accept-edits | duo, duo run, duo resume | The implementer edits files without asking: Claude’s acceptEdits mode, as /mode acceptEdits in the chat. On duo alone it sets the chat’s mode. |
--decision <decision> | duo resume | Answers a run waiting for you: resume, revise or abort. |
--note <text> | duo resume | An instruction for the agents, recorded with the decision. Only together with --decision. |
--reload-config | duo resume | Uses the current config instead of the one the run started with. |
The chat: duo
duo with no task opens the chat, but only where someone can type: an interactive terminal, in the foreground, outside CI, without --plain. Anywhere else it stops with exit code 1 and asks for a task.
- The chat opens in any folder, even without the CLIs or a Git repository; each question checks its agent’s CLI, and
/pipelinealso checks for a repository. - It holds the workspace’s lock until you leave, so a
duo runin the same workspace meanwhile is refused. - Leaving (
/quit, or Ctrl+C twice) stops a running pipeline at its current step; it stays resumable. The exit code is 0.
Everything you type in it is described in Slash commands.
Starting a run: duo "" and duo run
Terminal
duo "Add refresh tokens to the auth service"
duo run "Fix the flaky upload test" --accept-edits
duo --task-file task.md
duo -- "-x is ignored by the parser"- The task is every word after the command, joined. A task that starts with
-would be read as an option: put--before it. - A single word close to a command name (
duo stauts) is refused rather than sent as a paid task;duo run <word>runs it anyway. - Before anything starts, the workspace must be in a Git repository and the CLI of every role must be found; otherwise the run does not start (exit code 1).
- A workspace runs one pipeline at a time. A second
duo runwhile one runs, or while the chat is open there, is refused. - The run gets a folder of its own under the runs directory (run files) and keeps the config it started with in
config.json.
What happens next is described in The pipeline.
Watching a run in the terminal
In an interactive terminal a run shows a live view. These keys work while it runs:
| Key | Effect |
|---|---|
| v | Shows or hides every agent activity, as --verbose. |
| q | Stops after the step that is running now. The run stays resumable (exit code 130). |
| Ctrl+C | Stops the running agent or gate now; that step runs again on resume (exit code 130). |
| Ctrl+C twice | Kills the agents and exits at once (exit code 130). |
- When the run needs you, a menu replaces the view: Resume, Revise (with a note), view the plan, the review, the plan feedback or the diff stat, Abort, or Decide later. Ctrl+C at the menu also means Decide later (exit code 2). See Decisions and resume.
- In a terminal Claude’s permission prompts come to you, in plain mode too. Where nobody can answer (CI, a pipe, the background), Claude denies them itself and the run reports the denied tools: Permissions.
- In plain mode a run that needs a decision exits with code 2; answer it with
duo resume --decision ….
Continuing a run: duo resume
Terminal
duo resume
duo resume 20261031-101500-add-refresh-tokens
duo resume --decision revise --note "Keep the old endpoint until v2"
duo resume --reload-config- Without an id it continues the latest run of the runs directory. A step that was interrupted runs again.
- The run keeps the config it started with (its
config.json).--reload-configuses your current config files instead, and saves it as the run’s config. --decisionanswers a run waiting inHUMAN_REVIEW:resumegoes on,revisegoes back to planning with your note,abortends the run (exit code 3). A run that is not waiting refuses a decision (exit code 1).--noteis accepted only with--decision.- A run belongs to the workspace it started in. Resuming it from another one is refused; run it from there, or pass
--dir. - Like a new run, it needs a Git repository and the CLIs, and takes the workspace’s lock.
Note
In the chat, /resume does the same, and takes a note or a run id: /resume.
Looking at runs: duo status and duo list
duo status [runId] shows the latest run, or the one named: its phase, the planning and implementation rounds against their limits, open findings, cost and tokens, its last twelve steps, its warnings and its folder. A run waiting for you also shows the reason and the duo resume … --decision command that answers it.
duo list prints one line per run of this workspace’s runs directory. Neither command calls an agent or needs a Git repository.
Setting up: duo doctor and duo init
duo doctor
Checks the CLIs, the config and the workspace without calling a model, and prints one line per check: ✓ passed, ✗ a required check failed, ! a warning. It ends with doctor: ready (exit code 0) or doctor: problems found (exit code 1). Run it after upgrading Codex or Claude Code.
duo init
- Creates
.agentduo/config.yamlin the workspace, or keeps the one that exists. - Suggests gates it detects (package.json scripts, pytest, go test, cargo test, a Makefile test target), commented out.
- Creates
.agentduo/.gitignore, which keeps run data out of Git. - Outside a Git repository it offers to run
git init(in a terminal), or says to run it beforeduo run.
Exit codes
| Code | Meaning |
|---|---|
0 | Done: the run reached DONE, or the command (status, list, init, a ready doctor, the chat, --help) succeeded. |
1 | Config or environment error: an invalid option or config, no task, an unreadable task file, a missing CLI, no Git repository, a workspace that is busy, doctor problems, a decision the run cannot take. Nothing new ran. |
2 | The run waits for your decision (HUMAN_REVIEW): in plain mode, or after Decide later. Answer with duo resume. |
3 | The run was aborted. |
130 | The run was stopped (q, Ctrl+C, a signal). It is resumable. |
Terminal
duo --plain "Upgrade the logger"
case $? in
0) echo done ;;
2) duo status ;; # waiting for a decision
130) duo resume ;; # stopped; continue it
esac