CLI
@motir/cli · version 0.12.0 · 32 commands
The Motir CLI talks to the same MCP server the hosted agents use. It automates the planning-and-execution loop over a workspace-scoped token: a run claims the next ready work item, fetches the server-generated prompt, and dispatches an agent in a sandbox to execute it. The card is the system of record; the CLI is the driver.
Install
Node >=22. Install it globally, or run it once without installing.
install
npm install -g @motir/cli # or, without installing: npx @motir/cli --help
Authenticate
The device flow is the shortest path: it shows a code, opens Motir, and waits for you to approve it. If you already hold a personal access token, hand it over directly instead. Either way the CLI talks to https://app.motir.co unless you point it somewhere else.
authenticate
motir login # or with a token you already hold: motir auth login --server https://app.motir.co --token <pat> # or from the environment: export MOTIR_SERVER=https://app.motir.co export MOTIR_TOKEN=<pat>
Then bind a folder to a project, and check the setup before the first run.
link and check
motir link --project ACME motir doctor
Commands
Every command the CLI registers, in the order motir help prints them, generated from the catalogue the binary itself declares — so this list cannot fall behind a release. It describes @motir/cli@0.12.0.
SETUP COMMANDS:
motir loginConnect this terminal: shows a code, opens Motir, waits for your approval.
- --server <url>
- Server base URL, e.g. https://app.motir.co
- --no-browser
- Do not launch a browser — just print the code and the URL to open anywhere.
motir logoutDisconnect this terminal: remove the stored token for a server.
- --server <url>
- Server to log out of (defaults to the linked / single server).
motir authAuthenticate to a Motir server with a PAT.
motir auth loginValidate and store a personal access token for a server.
- --server <url>
- Server base URL, e.g. https://app.motir.co
- --token <pat>
- Personal access token (or set MOTIR_TOKEN; prompted if omitted).
motir auth statusShow the resolved server, token prefix, and owning user.
- --server <url>
- Server to report (defaults to the linked / single server).
motir auth logoutRemove the stored token for a server.
- --server <url>
- Server to log out of (defaults to the linked / single server).
motir linkBind this workspace-root folder to a project, and clone the repositories it is missing.
- --server <url>
- Server base URL (defaults to the existing link / single server).
- --workspace <slug>
- Workspace slug (defaults to the token’s active workspace).
- --project <key>
- Project key, e.g. ACME. Omit it and the workspace’s only project is used.
- --repo <name>
- Mark THIS directory as a single repo’s checkout (writes a "." override).
- --no-clone
- Bind only — do not clone the project’s missing checkouts.
motir link add <repo> <path>Add a repo checkout-path override (relative to the link root, or absolute).
motir link remove <repo>Remove a repo checkout-path override.
motir doctorPreflight your BYOK setup: auth, project link, agent binary, credential presence.
- --agent <cmd>
- Check THIS agent command instead of the configured one.
- --json
- Emit the check results as JSON.
READ COMMANDS:
motir readyList the linked project’s ready leaves, grouped under their runnable containers — or, with --parent / --bug, the other two ready lanes.
- --kinds <list>
- Comma-separated kinds: epic,story,task,bug,subtask.
- --parent
- List the runnable containers — what `motir next --parent` runs.
- --bug
- List the ready bugs instead of the leaves.
- --assignee <id>
- Filter by assignee: a user id, "me", or "unassigned".
- --json
- Emit the ready items as JSON.
motir statusShow the project pulse: ready / in-flight counts + the active sprint.
- --json
- Emit the pulse as JSON.
motir sprintsList the project’s sprints: state, item count, points, window.
- --state <state>
- Only sprints in this state: planned, active, or complete.
- --json
- Emit the sprint rows as JSON.
motir sprint [ref]List ONE sprint’s work items (defaults to the active sprint).
- --kinds <list>
- Comma-separated kinds: epic,story,task,bug,subtask.
- --json
- Emit the sprint and its items as JSON.
motir show <key>Read one work item (e.g. ACME-7): fields, readiness, children, edges, body.
- --json
- Emit the get_work_item payload as JSON.
- --activity
- Also print the activity stream: comments and history, one page.
- --comments
- Also print the comment threads only, one page.
motir open <key>Open a work item (e.g. ACME-7) in the browser; prints the URL.
- Print the URL only; do not launch a browser.
WORK LOOP COMMANDS:
motir nextDispatch the next ready leaf (never a bug): claim it and deliver its prompt. --parent runs the next runnable container; --bug takes the next bug.
- --kinds <list>
- Comma-separated kinds: epic,story,task,bug,subtask.
- --parent
- Run the next runnable container (a story, task or bug whose children are all leaves) as a parent run — as `motir run <KEY>` would.
- --bug
- Take the next ready bug instead of the next leaf.
- Print the prompt to stdout INSTEAD of launching an agent (default). Not --print-prompt.
- --print-prompt
- ALSO echo the assembled prompt to stderr as it is sent, and still run the agent.
- --agent <cmd>
- Run THIS agent command on the prompt (overrides MOTIR_AGENT).
- --reset
- Clear this project’s session exclude list before picking.
- --disable-log-bug
- Do not let the agent file a bug for a defect it finds elsewhere; it comments instead.
- --disable-replan
- Do not let the agent submit a re-plan for a wrong work item; it comments and stops.
- --auto-approve-replan
- Not supported — approving a submitted re-plan and continuing is a `motir auto` flag.
- --report-log
- ALSO send your agent’s output to Motir, so a failed run shows its tail on the run page. OFF by default — only the lifecycle is sent, never file contents, paths or diffs.
motir run <scope>Run a scope: one work item, a whole story, or `sprint` for the active one.
- Print the prompt to stdout INSTEAD of launching an agent (default). One item; not --print-prompt.
- --print-prompt
- Echo each assembled prompt to stderr as it is sent, alongside the run (2> prompts.log).
- --agent <cmd>
- Run THIS agent command on the prompt (overrides MOTIR_AGENT).
- --force
- Dispatch even though the item is not ready (dependencies unmet). One work item only.
- --allow-soft-block
- Run an item held only by an ancestor's block (a SOFT block). Still refuses one with its own open blocker (a HARD block — only --force passes that).
- --disable-log-bug
- Do not let the agent file a bug for a defect it finds elsewhere; it comments instead.
- --disable-replan
- Do not let the agent submit a re-plan for a wrong work item; it comments and stops.
- --auto-approve-replan
- Not supported — approving a submitted re-plan and continuing is a `motir auto` flag.
- --max <n>
- Stop after dispatching n work items from the scope.
- --keep-going
- Continue past a failed agent instead of halting on the first one.
- --include-planning
- Trigger an AI expansion for an unexpanded story instead of refusing it. Never waits: the plan needs your approval.
- --kinds <list>
- Not supported — a scoped run drains the whole claimed set, not a filtered subset.
- --report-log
- ALSO send your agent’s output to Motir, so a failed run shows its tail on the run page. OFF by default — only the lifecycle is sent, never file contents, paths or diffs.
- --run-id <id>
- Adopt a run Motir already opened (a hosted run) instead of opening one. Env: MOTIR_DISPATCH_RUN_ID.
motir fix <key>Hand a work item whose pull requests are failing, whose merge could not land because of its code, or whose acceptance video was sent back to re-run, to your agent, on their own branches.
- --agent <cmd>
- Run THIS agent command on the fix (overrides MOTIR_AGENT).
- --report-log
- ALSO send your agent’s output to Motir, so a failed run shows its tail on the run page. OFF by default — only the lifecycle is sent, never file contents, paths or diffs.
motir continue <key>Carry on a work item whose last run died, on the branch it left — from any machine, without starting it over.
- --agent <cmd>
- Run THIS agent command on the continue (overrides MOTIR_AGENT).
- --max <n>
- A parent: stop after dispatching n more work items.
- --keep-going
- A parent: continue past a failed agent instead of halting.
- --report-log
- ALSO send your agent’s output to Motir, so a failed run shows its tail on the run page. OFF by default — only the lifecycle is sent, never file contents, paths or diffs.
motir review <key>Hosted only: review a work item’s pull requests at the version under review and submit ONE verdict — never pushes, never posts to GitHub.
motir autoDrain the ready set unattended: one item at a time onto a session branch.
- --agent <cmd>
- Run THIS agent command on every prompt (overrides MOTIR_AGENT).
- --kinds <list>
- Comma-separated kinds: epic,story,task,bug,subtask.
- --max <n>
- Stop after dispatching n work items.
- --keep-going
- Continue past a failed agent instead of halting on the first one.
- --reset
- Clear this project’s session exclude list before starting.
- --include-planning
- Trigger an AI expansion for each unexpanded epic/story instead of skipping it. Never waits: the plan needs your approval.
- Not supported — an unattended loop has nobody to paste a prompt. --print-prompt IS.
- --print-prompt
- Echo each assembled prompt to stderr as it is sent, alongside the run (2> prompts.log).
- --disable-log-bug
- Do not let the agent file a bug for a defect it finds elsewhere; it comments instead.
- --disable-replan
- Do not let the agent submit a re-plan for a wrong work item; it comments and stops.
- --auto-approve-replan
- Approve a re-plan the agent submitted and keep looping, instead of stopping for you.
- --report-log
- ALSO send your agent’s output to Motir, so a failed run shows its tail on the run page. OFF by default — only the lifecycle is sent, never file contents, paths or diffs.
motir batchImplement a FROZEN snapshot of the ready set: one pull request per item.
- --agent <cmd>
- Run THIS agent command on every prompt (overrides MOTIR_AGENT).
- --kinds <list>
- Comma-separated kinds: epic,story,task,bug,subtask.
- --max <n>
- Stop after dispatching n work items.
- --keep-going
- Continue past a failed agent instead of halting on the first one.
- --reset
- Clear this project’s session exclude list before snapshotting.
- Not supported — a frozen snapshot has nobody to paste a prompt. --print-prompt IS.
- --print-prompt
- Echo each assembled prompt to stderr as it is sent, alongside the run (2> prompts.log).
- --disable-log-bug
- Do not let the agent file a bug for a defect it finds elsewhere; it comments instead.
- --disable-replan
- Do not let the agent submit a re-plan for a wrong work item; it comments and stops.
- --auto-approve-replan
- Not supported — approving a submitted re-plan and continuing is a `motir auto` flag.
- --report-log
- ALSO send your agent’s output to Motir, so a failed run shows its tail on the run page. OFF by default — only the lifecycle is sent, never file contents, paths or diffs.
motir plan [args...]Plan by talking: resume the project’s planning conversation, add turns, submit.
- --detach
- Submit and return with the job/plan ids; do not wait for the planner.
motir done [key]Close out a merged item — or a whole merged session branch.
- --session <branch>
- Bulk close-out: flip every item on this session branch.
- --via <status>
- Move through this status first (e.g. in_review).
ADDITIONAL COMMANDS:
motir agent-terminalThe terminal server inside a Motir agent image.
motir agent-terminal serveServe this agent’s shell to Motir’s relay over WebSocket.
- --port <port>
- Port to listen on, on every interface (default 7681).
motir agent-terminal run <key>Open a run session for a card in this agent’s terminal server, and return its id at once.
- --run-id <id>
- The run to open a session for (its credentials are read on stdin).
motir agent-terminal stopStop a run’s session: SIGTERM, then SIGKILL after 10 seconds.
- --run-id <id>
- The run whose session to stop.
motir agent-terminal statusReport whether a run’s session is running, or how it exited.
- --run-id <id>
- The run whose session to report.
motir agent-terminal signinPrint whether this agent’s coding agent is signed in, as JSON.
- --json
- Print JSON (the only format; accepted for scripts that ask for it).
HELP TOPICS:
motir help [command...]Show help for a command, or read a help topic.
Where Motir keeps things
Three files, and only one of them holds a secret — it is not the one that lives in your repository. Every path below can be relocated; motir help files prints them from the binary you actually installed, with the variable that moves each one.
- ~/.config/motir/config.json — secret, never commit
- The credential store: the only file a personal access token is ever written to,
chmod 600inside a0700directory, keyed by server URL so one machine can hold tokens for several Motir servers. It also holds the agent command you configured. Relocate it withMOTIR_CONFIG_HOMEorXDG_CONFIG_HOME. - .motir.json — no secret, safe to commit
- The project link at your workspace root: the server, workspace and project this folder is bound to, plus an optional repository override map. It carries no credential, so it belongs in version control. Every command resolves it by walking UPWARD from the current directory, so any command works from inside any checkout under the root.
- ~/.local/state/motir/session-excludes.json — no secret
- The session exclude list: the work items whose dispatch FAILED, so the next run moves past them instead of re-picking the same failure. State rather than a credential, which is why it does not sit beside the token — the sandbox mounts the config directory read-only, and a run must never die because it could not write this file. If it is unwritable Motir warns once and continues. Relocate it with
MOTIR_STATE_HOME.
Where a run executes
A dispatched agent runs inside a container with your checkouts and your own agent credential — what it provides, what its token refuses, and the failures a first run hits are on the Sandbox page rather than restated here. Wiring an agent to Motir without the CLI is Servidor MCP, and driving the same work loop over HTTP is the Referencia de la API. The full command reference — the three run shapes, session branches, the failure policy and troubleshooting — is docs/cli.md in motir-core.