All documentation pages

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

duo commands
CommandWhat it does
duoOpens 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 listLists the runs of this workspace: id, phase, last update and task.
duo doctorChecks the CLIs, the config and the workspace, without calling any model.
duo initCreates .agentduo/config.yaml and .agentduo/.gitignore, and offers git init.
duo --help, duo <command> --helpPrints the usage.
duo -V, duo --versionPrints 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).

Options every command takes
OptionEffect
--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.
--plainPlain 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, --verboseShows every agent activity, thoughts included.
--no-colorNo colours. Setting NO_COLOR in the environment does the same.
Options of the commands that start or continue a run
OptionCommandsEffect
--task-file <file>duo, duo runReads the task from a file. With words as well, the file’s text comes after them.
--accept-editsduo, duo run, duo resumeThe 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 resumeAnswers a run waiting for you: resume, revise or abort.
--note <text>duo resumeAn instruction for the agents, recorded with the decision. Only together with --decision.
--reload-configduo resumeUses 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 /pipeline also checks for a repository.
  • It holds the workspace’s lock until you leave, so a duo run in 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 run while 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:

Keys of a terminal run
KeyEffect
vShows or hides every agent activity, as --verbose.
qStops after the step that is running now. The run stays resumable (exit code 130).
Ctrl+CStops the running agent or gate now; that step runs again on resume (exit code 130).
Ctrl+C twiceKills 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-config uses your current config files instead, and saves it as the run’s config.
  • --decision answers a run waiting in HUMAN_REVIEW: resume goes on, revise goes back to planning with your note, abort ends the run (exit code 3). A run that is not waiting refuses a decision (exit code 1).
  • --note is 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.yaml in 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 before duo run.

Exit codes

Exit codes
CodeMeaning
0Done: the run reached DONE, or the command (status, list, init, a ready doctor, the chat, --help) succeeded.
1Config 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.
2The run waits for your decision (HUMAN_REVIEW): in plain mode, or after Decide later. Answer with duo resume.
3The run was aborted.
130The 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