Documentation / CLI reference
CLI reference
The command is natamux. The short name nmx is the same program.
natamux <command> [options]nmx <command> [options]Run natamux help, natamux --help or natamux -h to print the usage text.
Task ids look like T-42. Inside a Natamux terminal, the token, the daemon address and the task are already set. There the token is the task’s own: it reaches only that task, so the gate commands (stage approve, stage skip, stage pass) and commands on another task get 403. Run them in the app, or in a terminal outside a task. Outside one, the Rust CLI reads the running desktop app’s saved token and port when available. Set NATAMUX_TOKEN and NATAMUX_URL for a different daemon (see Environment).
Commands
Section titled “Commands”| Command | What it does |
|---|---|
task create <title> |
Create a draft task |
task list |
List tasks, newest update first |
task show [id] |
Show one task |
task edit <id> |
Change the title, notes, priority, labels or dependencies |
task link <id> |
Link the task to its issue or ticket |
agent start <id> |
Start an agent in the task’s terminal |
ask <question> |
For an agent: say the task waits for you |
done |
For an agent: say the stage is done, so the daemon checks it |
stage <command> <id> |
approve, back, skip, pass, fail or start the task’s stage |
stage workflow <id> on|off |
Run a stage as a workflow the next time it starts (needs --stage) |
stage ci <id> on|off |
Check a stage on CI before it passes (needs --stage) |
stage ci-approve <stage> |
Approve the exact tree a Strict CI push sends (needs --task and --tree) |
event <id> <type> |
Send an event to a task |
events <id> |
Show the event log of a task |
workspace create <id> |
Create a git worktree and a branch for a task |
workspace remove <id> |
Remove the worktree of a task (needs --yes) |
repo trust <repo> |
Show the commands a project runs, or approve them (--approve) |
security |
Show whether Strict mode is on and what each of its keys blocks |
support-bundle |
Save a support bundle for a bug report, with no task text |
purge-data |
Remove task data, logs and the token from this machine; worktrees stay |
hooks claude-code |
Print Claude Code settings that report a task’s progress |
hooks opencode|qwen|droid |
Print the hook file Natamux writes into a task’s worktree (.opencode/plugins/natamux.js, .qwen/settings.json, .factory/hooks.json) |
hook <agent> [event] |
For an agent’s hook: send the JSON on stdin to the daemon |
help |
Show the help |
Options
Section titled “Options”| Option | Used by | Meaning |
|---|---|---|
--title <text> |
task edit |
New title |
--description <text> |
task create, task edit |
Notes |
--priority <name> |
task create, task edit |
low, normal, high or urgent |
--label <name> |
task create, task edit |
A label. Repeat for more |
--agent <name> |
task create, agent start |
The agent that works on the task, or the agent to start (default for agent start: claude-code) |
--depends-on <id> |
task create, task edit |
A task that must finish first. Repeat for more |
--parent <id> |
task create |
Make the task a subtask of this task. A subtask cannot have subtasks. Without --repo, it is in the project of the parent |
--context <source> |
task create |
Where the context comes from: manual, github-issue, skill or mcp, as source or source:ref, such as github-issue:42 |
--repo <id> |
task create |
The project of the task. Default: the project of the NATAMUX_TASK_ID task, or the only project |
--attach <path> |
task create |
A file for the agents to read, such as a document or a screenshot. Repeat for more. At most 20 files, 20 MB each and 50 MB together |
--prompt <text> |
agent start |
First prompt. Default: the task title and notes |
--task <id> |
ask, done |
The task. Default: NATAMUX_TASK_ID |
--stage <id> |
stage, done, ask |
The stage, when two run side by side. For stage workflow and stage ci: the stage to change |
--tree <id> |
stage ci-approve |
The tree id shown in the approval |
--to <id> |
stage back |
The stage to go back to. Default: the last agent stage |
--reason <text> |
stage back, stage fail |
Why, for the agent and the log |
--issue <key> |
task link |
The issue or ticket, such as #42 or ABC-123 |
--url <address> |
task link |
Its address |
--provider <name> |
task link |
github, jira and so on. Default: github when the address contains github.com, else tracker |
--state <state> |
task list |
Only tasks in this state: draft, ready, running, idle, needs-input, review, blocked, failed, done, cancelled |
--source <name> |
event |
agent, human, git, ci or system. Default: human. In a task terminal the daemon records agent, whatever you pass |
--payload <json> |
event |
A JSON object sent with the event |
--base <branch> |
workspace create, agent start |
Start the new workspace from this local branch. Default: the default branch of the repository, such as main. Natamux fetches the base first (see Base branch) |
--branch <name> |
workspace create, agent start |
Name the branch of the new workspace. A local branch of that name is checked out, --base is ignored. A branch only on origin becomes a local branch that tracks it. See Branch name |
--yes |
workspace remove |
Confirm that the worktree folder is deleted |
--delete-branch |
workspace remove |
Also delete the branch, when it is merged |
--approve <hash> |
repo trust |
Approve the commands with this hash, as the list printed it |
--json |
most commands | Print JSON instead of text |
-h, --help |
all | Show the help |
natamux task create "Fix the login bug" --priority high --label bugnatamux task create "Add export" --depends-on T-41 --context github-issue:42natamux task create "Update the docs" --repo my-appnatamux task create "Part A" --parent T-42natamux task create "ABC-12: Fix the login bug"natamux task list --state runningnatamux task show T-42natamux task edit T-42 --title "Fix the login redirect" --label authnatamux task link T-42 --issue ABC-123 --url https://example.com/browse/ABC-123task createneeds a title. All words aftercreateform the title.- Without
--repo,task createuses the project of the task inNATAMUX_TASK_ID. Outside a task terminal it uses the only project. With more than one project, it fails and lists the project ids. task editneeds at least one of--title,--description,--priority,--labelor--depends-on.task showwithout an id shows the task of this terminal (NATAMUX_TASK_ID).task linkneeds--issueand--url.
agent start
Section titled “agent start”natamux agent start T-42natamux agent start T-42 --agent codex --prompt "Add tests for the parser"natamux agent start T-42 --base developThe agent is one of claude-code, codex, gemini, copilot, cursor, opencode, qwen, droid, amp, kimi, goose, aider, crush, cline, kiro or muse. If the task has no workspace, agent start creates one first, from --base when you give it. See Agents and hooks.
ask and done
Section titled “ask and done”Run these from an agent, inside a task’s terminal.
natamux ask "Keep the old CSV columns, or drop them?"natamux donenatamux done --stage implementasksends anagent.askedevent with your question. The task moves to needs input.donereports that the stage is done. The daemon then runs the stage’s checks.- Without
--task, the task comes fromNATAMUX_TASK_ID. If neither is set, the command exits with code 2.
natamux stage approve T-42natamux stage back T-42 --to spec --reason "The spec misses the error case"natamux stage fail T-42 --reason "Tests do not pass"back goes to the stage named with --to. It cannot be used with --stage. See Stages.
skip skips the current stage. Marking a stage that the task has not reached yet, so it is skipped when the task gets there (Skip and Will be skipped in the dashboard), is not a command. Use the dashboard or PUT /tasks/:id/skip in the HTTP API. The API action reopen has no command either. back is the command that sends a task to an earlier stage.
natamux stage workflow T-42 on --stage implementnatamux stage workflow T-42 off --stage implementworkflow chooses whether a stage runs as a workflow the next time it starts. The project settings must offer it on the stage, and the agent of the task must be Claude Code. Turning it off always works. See Run a stage as a workflow.
natamux stage ci T-42 on --stage implementci chooses whether a stage waits for CI before it passes: Natamux pushes the work to natamux-ci/<branch> and waits for its runs. The project settings must offer it on the stage. See Check a stage on CI.
natamux stage ci-approve implement --task T-42 --tree 4b825dc6ci-approve approves a CI push under Strict ciPush: approved-snapshot. Give the tree id from the stage.ci-approval-needed event; if the work changed, the daemon refuses the old id, and it refuses once the task is done or cancelled. Only a person can approve: the agent token of a task gets 403.
event and events
Section titled “event and events”natamux event T-42 agent.asked --source agent --payload '{"question":"Which database?"}'natamux events T-42Event types you can send:
task.readied, task.blocked, task.unblocked, task.retried, task.cancelled, agent.started, agent.asked, agent.resumed, agent.finished, agent.failed, agent.waiting, review.approved, review.changes-requested, state.overridden, pr.merged, stage.started, stage.reported, stage.check-failed, stage.checked, stage.approved, stage.passed, stage.failed, stage.reopened, stage.skipped.
With the agent token in a task terminal, stage.started, stage.checked, stage.reopened and pr.merged are refused: only the daemon sends them. The daemon records the other event types itself. An event that does not fit the task’s state is logged as not accepted, and the task does not change.
workspace
Section titled “workspace”natamux workspace create T-42 --base mainnatamux workspace remove T-42 --yes --delete-branchworkspace remove deletes the worktree folder, so it needs --yes. Git refuses when the worktree has uncommitted files.
repo trust
Section titled “repo trust”natamux repo trust my-appnatamux repo trust my-app --approve 3f1c…A project’s commands (stage checks, command stages, path conditions, stage args and the setup script) run only after you approve them. See Approve the project’s commands.
- Without
--approve, it prints each command with where it comes from, the setup scripts, and the hash. A project you never approved gets the linemy-app is not trusted yet: Natamux asks once per project.In Personal mode the approval also covers later changes of the project; Strict mode asks again. - With
--approve <hash>, it approves them. The daemon refuses a hash that is no longer current: the commands changed since you read them, so read them again. - It needs the daemon’s own token. The token of a task terminal gets 403.
security
Section titled “security”natamux securitynatamux security --jsonPrints the security mode (Personal or Strict), the warning when security.json changed outside Natamux, each Strict key with its value and what it blocks, and how task shells are isolated in this daemon run (GET /security). It only reads: change the settings in the app, Settings > Security. Any token may run it, also the token of a task terminal. See Strict mode.
support-bundle
Section titled “support-bundle”natamux support-bundlenatamux support-bundle --out ~/Desktop/natamux.jsonSaves the support bundle (GET /support-bundle) to natamux-support-bundle.json, or the --out file, readable only by you. It holds the versions, OS, uptime, the security state, the number of tasks in each state and the last 200 daemon log lines with secrets masked and typed input left out (only for the app’s own daemon, not one you start by hand). It holds no task text, events or environment. Read it before you send it. The token of a task terminal gets 403.
purge-data
Section titled “purge-data”natamux purge-datanatamux purge-data --yesRemoves Natamux’s task data from this machine: the task files, events, screens and attachments, the index, the logs, the launch scripts, the sandbox folders, and the app’s token and port files. Worktrees and settings stay. Without --yes it lists what it would remove. It refuses while a worktree in the data folder has uncommitted or untracked files (and lists them), while the app’s daemon runs, in a task’s terminal, and when the data folder is not an absolute path or holds no index.sqlite. It needs no token. Running it again changes nothing. See the data inventory.
hooks and hook
Section titled “hooks and hook”claude --settings "$(natamux hooks claude-code)"natamux hook codexnatamux hook copilot agentStophooks opencode,hooks qwenandhooks droidprint the hook file that Natamux writes into each task’s worktree, to use in a folder of your own. They need no token and do not call the daemon.hooks claude-codeprints settings JSON. It needs no token and does not call the daemon. Use it only outside a task terminal, or when the worktree’s.claude/settings.local.jsonis your own: a task terminal already has the hooks, and both would send each event twice.hook <agent> [event]is for an agent’s own hook. It reads JSON on stdin and posts it to the daemon. It prints nothing ({}forcursorandgemini), always exits 0, and does nothing withoutNATAMUX_TOKEN. Even a usage mistake exits 0, because agents treat exit code 2 as “block this action”. See Other agents.
JSON output
Section titled “JSON output”Add --json to print JSON. Tasks come as task objects, task list as an array, events as an array of stored events, event and ask as { task, accepted }, workspace remove as { task, branchDeleted }.
natamux task list --jsonExit codes
Section titled “Exit codes”| Code | Meaning |
|---|---|
| 0 | Done |
| 1 | The request failed. The error is on stderr |
| 2 | The command line is wrong, a task id is missing, or NATAMUX_TOKEN is not set |
Environment
Section titled “Environment”| Variable | Meaning |
|---|---|
NATAMUX_TOKEN |
The daemon’s token. The CLI reads the app’s saved token when it is available. Required for a separate daemon, except for hooks claude-code. In a task terminal it is the task’s own token, and the saved token is never read there |
NATAMUX_URL |
The daemon’s address. The CLI reads the app’s saved daemon-port when it is available, then falls back to http://127.0.0.1:4317 |
NATAMUX_TASK_ID |
The task of this terminal. Used by ask, done, task show, task create (for its project) and hooks. Natamux terminals set it |
NATAMUX_TERMINAL |
The terminal of the task. Tells the daemon which stage done is about. Natamux terminals set it |
NATAMUX_STAGE_TICKET |
Set by the script of a command stage, so its stage pass gets through once. stage pass and stage fail send it in the X-Natamux-Stage-Ticket header |
NATAMUX_DEBUG |
natamux hook only. Any value prints problems to stderr |
See Environment variables for the daemon’s variables.