The Motir CLI
Install it, sign in, point it at your project, and hand one work item to your own coding agent — in about five minutes, without cloning anything.
Before you start
A Motir account, and Node >=22. That is the list. You do not need a checkout of Motir itself, and you do not need to mint a token by hand — step 2 signs you in from the terminal.
1Install
Motir ships as a global npm package. pnpm add -g and yarn global add install the same thing. Runtime: Node >=22, ESM.
npm install -g @motir/cli motir --help
2Sign in
motir login prints a short code, opens Motir in your browser, and waits for you to approve it there. Nothing has to exist on this machine first — no token to mint, no file to create.
motir login
MOTIR_TOKEN instead, and there is no login step and no file at all.3Link your workspace root
Your workspace root is the folder your repo checkouts live under — a Motir project usually spans several repositories, and the work loop runs across all of them. Linking that folder writes a .motir.json there, and every command finds it by walking upward, so any command works from inside any checkout.
cd ~/work # the folder holding your checkouts motir link --project ACME
If your workspace has exactly one project, motir link on its own is the whole step. .motir.json holds no secret — server, workspace, project — so it is safe to commit. Linking also brings the code down: it reads the project’s repositories and clones the ones that are missing, one reported line each, never writing into a path that already exists. Run it again any time — nothing already there is re-cloned, and a repository added to the project later arrives. Pass --no-clone to bind and nothing else. An empty folder is first class: bind it and the code is there. The one thing binding cannot fetch is a repository that does not exist anywhere yet — that is what a scaffold work item creates.
4Check it
One read-only pass that answers *is my setup correct?* before a dispatch stops halfway through — your credential, the link, the project, your agent binary and its own sign-in.
motir doctor
It exits non-zero when a hard check fails, so motir doctor && motir auto is a usable gate, and --json emits the same report machine-readably. It never reads your secret: the credential checks ask only whether a path exists or an env var is set.
5See what is ready
Get your bearings before you pick anything up: where the project stands, what the current sprint holds, and what can actually start right now.
motir status # ready / in-flight counts + the active sprint motir sprint # the active sprint, and what blocks what motir ready # what can be picked up right now
motir sprint and motir ready print dependency edges in their own columns, so you can see which item unblocks the most before choosing one.
6Dispatch one item
Read the card first. motir show gives you the whole thing — its fields, its readiness, its dependency edges and, for a story, its children in build order. That is where you notice the item assumes something that does not exist yet.
motir show MOTIR-42 # the item you are about to hand an agent motir next --print # claim the top item, print its prompt
--print writes the prompt to stdout and everything else — the repo, the resolved path, the workflow mode — to stderr, so motir next --print | pbcopy copies the prompt alone while you still see the context. Paste it into whatever agent you like. When its pull request is merged, close the item out:
motir done --via in_review MOTIR-42
motir next --agent "<your agent command>" runs it on the prompt, and motir auto drains the whole ready set unattended. Motir is BYOK: you bring your own agent and your own model key, and Motir never reads either.motir auto run, one merge closes every card that branch carries.Where Motir keeps things
Motir keeps exactly two files, and only one of them holds a secret.
files
| Path | What it holds |
|---|---|
~/.config/motir/config.json | Secret — never commit. The credential store, chmod 600 inside a 0700 directory, keyed by server URL. |
.motir.json (workspace root) | No secret — safe to commit. The link: server, workspace, project, and the optional repo checkout-path overrides. |
- Path
~/.config/motir/config.json- What it holds
- Secret — never commit. The credential store,
chmod 600inside a0700directory, keyed by server URL.
- Path
.motir.json(workspace root)- What it holds
- No secret — safe to commit. The link: server, workspace, project, and the optional repo checkout-path overrides.
The CLI talks to https://app.motir.co unless you tell it otherwise. Self-hosting? --server <url> beats everything on any command, and motir help environment prints the whole resolution ladder from the shipped code.
Every command
Derived from the CLI’s own command record, so a command the tool gains appears here with no edit to this page. Run motir help <command> for its flags.
setup
| Command | What it does |
|---|---|
motir login | Connect this terminal: shows a code, opens Motir, waits for your approval. |
motir logout | Disconnect this terminal: remove the stored token for a server. |
motir auth | Authenticate to a Motir server with a PAT. |
motir auth login | Validate and store a personal access token for a server. |
motir auth status | Show the resolved server, token prefix, and owning user. |
motir auth logout | Remove the stored token for a server. |
motir link | Bind this workspace-root folder to a project, and clone the repositories it is missing. |
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 doctor | Preflight your BYOK setup: auth, project link, agent binary, credential presence. |
- Command
motir login- What it does
- Connect this terminal: shows a code, opens Motir, waits for your approval.
- Command
motir logout- What it does
- Disconnect this terminal: remove the stored token for a server.
- Command
motir auth- What it does
- Authenticate to a Motir server with a PAT.
- Command
motir auth login- What it does
- Validate and store a personal access token for a server.
- Command
motir auth status- What it does
- Show the resolved server, token prefix, and owning user.
- Command
motir auth logout- What it does
- Remove the stored token for a server.
- Command
motir link- What it does
- Bind this workspace-root folder to a project, and clone the repositories it is missing.
- Command
motir link add <repo> <path>- What it does
- Add a repo checkout-path override (relative to the link root, or absolute).
- Command
motir link remove <repo>- What it does
- Remove a repo checkout-path override.
- Command
motir doctor- What it does
- Preflight your BYOK setup: auth, project link, agent binary, credential presence.
read
| Command | What it does |
|---|---|
motir ready | List the linked project’s ready set (every dependency satisfied). |
motir status | Show the project pulse: ready / in-flight counts + the active sprint. |
motir sprints | List the project’s sprints: state, item count, points, window. |
motir sprint [ref] | List ONE sprint’s work items (defaults to the active sprint). |
motir show <key> | Read one work item (e.g. ACME-7): fields, readiness, children, edges, body. |
motir open <key> | Open a work item (e.g. ACME-7) in the browser; prints the URL. |
- Command
motir ready- What it does
- List the linked project’s ready set (every dependency satisfied).
- Command
motir status- What it does
- Show the project pulse: ready / in-flight counts + the active sprint.
- Command
motir sprints- What it does
- List the project’s sprints: state, item count, points, window.
- Command
motir sprint [ref]- What it does
- List ONE sprint’s work items (defaults to the active sprint).
- Command
motir show <key>- What it does
- Read one work item (e.g. ACME-7): fields, readiness, children, edges, body.
- Command
motir open <key>- What it does
- Open a work item (e.g. ACME-7) in the browser; prints the URL.
work loop
| Command | What it does |
|---|---|
motir next | Dispatch the next ready work item: claim it and deliver its prompt. |
motir run <scope> | Run a scope: one work item, a whole story, or sprint for the active one. |
motir auto | Drain the ready set unattended: one item at a time onto a session branch. |
motir batch | Implement a FROZEN snapshot of the ready set: one pull request per item. |
motir plan [args...] | Plan by talking: resume the project’s planning conversation, add turns, submit. |
motir done [key] | Close out a merged item — or a whole merged session branch. |
- Command
motir next- What it does
- Dispatch the next ready work item: claim it and deliver its prompt.
- Command
motir run <scope>- What it does
- Run a scope: one work item, a whole story, or
sprintfor the active one.
- Command
motir auto- What it does
- Drain the ready set unattended: one item at a time onto a session branch.
- Command
motir batch- What it does
- Implement a FROZEN snapshot of the ready set: one pull request per item.
- Command
motir plan [args...]- What it does
- Plan by talking: resume the project’s planning conversation, add turns, submit.
- Command
motir done [key]- What it does
- Close out a merged item — or a whole merged session branch.
help
| Command | What it does |
|---|---|
motir help [command...] | Show help for a command, or read a help topic. |
- Command
motir help [command...]- What it does
- Show help for a command, or read a help topic.
What next
You have a working CLI and one item dispatched. Three places to go from here, and each owns something this page deliberately does not.
hand-offs
| Read this | For |
|---|---|
docs/cli.md | The reference: every flag, the three run shapes, session branches, the failure policy, agent wiring, troubleshooting. |
| The agent sandbox guide | Running an agent unattended inside a confined container, so a loop cannot reach the rest of your machine. |
| The API reference | Driving Motir over HTTP instead of from a terminal — the same work loop, as /api/v1. |
- Read this
docs/cli.md- For
- The reference: every flag, the three run shapes, session branches, the failure policy, agent wiring, troubleshooting.
- Read this
- The agent sandbox guide
- For
- Running an agent unattended inside a confined container, so a loop cannot reach the rest of your machine.
- Read this
- The API reference
- For
- Driving Motir over HTTP instead of from a terminal — the same work loop, as
/api/v1.
Next: Agent sandbox · API reference · Getting started