Skip to content

CLI

moor is the operator’s and contributor’s tool. moor-machine-agent runs on each paired machine. moor help COMMAND and moor-machine-agent help COMMAND print every flag.

moor

Where a command runs

A command goes to a controller when one is configured. moor picks the first of these that is set:

  1. MOOR_CONTROLLER, a socket path.
  2. controller.ssh in the user config. moor runs ssh -T DESTINATION moor controller attach.
  3. controller.socket in the user config. moor up sets it.

With none set, the command runs in its own process on the local state.

The state directory is the first of --state-dir, MOOR_STATE_DIR, $XDG_STATE_HOME/moor, and ~/.local/state/moor.

Global flags

Flag Effect
--json Print one JSON envelope on stdout.
--quiet Leave warnings out of text output.
--state-dir DIR Use DIR as the state directory.

Boxes

Command What it does
moor start NAME Creates a Box to work in by hand on the branch moor/ID-NAME, or attaches to the open Box of that name. It runs the repo’s setup and no agent.
moor ask --repo OWNER/NAME TEXT Starts a task, or a question, in an agent place. Its agent starts work Boxes when the task needs code run. Repeat --repo for more repos, the task’s own first.
moor show [NAME] Shows all open Boxes, or one in detail. list is an alias.
moor inspect NAME Shows the agent’s state, why it looks stuck, its latest messages, and the end of its terminal.
moor run NAME CMD... Runs a command in the Box’s work tree and records the run.
moor exec NAME CMD... Runs a command with stdin, stdout, and stderr passed byte for byte, and exits with its code. Records no run.
moor forward NAME PORT Serves port PORT of the Box on this computer’s localhost until Ctrl-C. A development tool. It needs a controller on the same computer and has no sign-in. Teammates have no forward from their own computer for now.
moor steer NAME [TEXT] Sends text, a menu choice, or an interrupt to the agent.
moor wait NAME Waits until the Box reaches a state.
moor wait-events BOXES... Waits for events from one or more Boxes.
moor cp NAME SRC DEST Copies a file or directory out of the Box to the host.
moor end NAME Ends the agent Session and keeps the Box open.
moor sleep NAME, moor wake NAME Puts the Box to sleep, or wakes it.
moor retry NAME Runs the setup of a Box in setup_failed again.
moor close NAME Closes the Box and releases its VM.
moor close-failed Closes every Box of yours in setup_failed.

moor start flags:

Flag Effect
--repo OWNER/NAME A repo to clone, as OWNER/NAME or a github.com URL. Repeat for more, first one first. The Box’s branch is on the first, and the rest are cloned beside it. Two or more replace box.also. The default is the current checkout’s origin.
--base REF The ref to branch from. The default is the repo’s default branch.
--node NAME A node of yours, or a shared one, in place of your default.
--config FILE A partial repo config for this Box only, laid over the repo’s. - reads stdin. See Override for one Box.
--no-setup Skip the repo’s setup lines, also on a later machine and in moor retry. The Box is ready once the repos are cloned.
--parent ID The parent Session. The default is MOOR_SESSION.

A start reads the repo from GitHub with the requester’s github secret. Changes that are not pushed are not in the Box, and the CLI warns about them. The start refuses when the user lacks a secret the Box needs, and names each one.

Other flags:

Command Flag Effect
show --agent, --events N, --reports, --pane Add the agent state, the last N events, the Reports, or the end of the terminal.
show --session ID Show one Session and its child Sessions.
inspect --lines N, --said N Terminal lines, 40 by default and 200 at most. Agent messages, 5 by default and 20 at most.
run --record NAME Record the run as the gate NAME for moor gate check.
exec -i Forward stdin from a terminal too.
forward --local-port N Listen on N of this computer instead of the Box’s port.
steer --menu N, --interrupt Send a menu choice, or the agent’s interrupt key.
wait --for STATE, --timeout S idle, done, input, or run. 1800 seconds by default.
wait-events --kind KIND, --all, --since N, --timeout S Match kinds, wait for every Box, start after an event id.
close, close-failed --force Close despite commits that are not pushed or files that are not committed. That work is lost.

Sessions

Command What it does
moor session open NAME --seed TEXT Starts a new agent Session on an open Box. --seed-file PATH reads the prompt from a file.
moor session open --host --workdir DIR Opens a host Session with no Box. --agent and --agent-session-id set its agent.
moor session set ID Changes the agent or agent session recorded on a host Session.
moor session end ID Ends a host Session.

Your user

These act as your local identity through the controller.

Command What it does
moor user enroll Creates your user, or shows it.
moor user secret set NAME Stores a secret, read from stdin.
moor user secret ls, rm NAME Lists secret names, or deletes one.
moor user mcp add NAME URL Adds an MCP server of yours. --header names the header for its key.
moor user mcp finish URL, ls, rm NAME Finishes an OAuth sign-in, lists servers, or removes one.
moor user machine ls, status NAME, rm NAME Lists your machines, asks one for its state, or removes one.
moor user profile set URL[#REF], show, check [URL], rm Sets, shows, or clears your agent profile repo. check reads it, or URL, through GitHub and reports what it installs and what failed. It writes nothing.
moor user webhook add URL Adds a webhook. --event KIND and --header NAME narrow it.
moor user webhook setup ID, finish ID, ls, rm ID Shows the setup with its key, finishes it, lists, or removes.
moor whoami Shows your identity, its user, and the user’s linked identities.
moor node ls Lists the shared nodes and yours, with their load. A node with no cap reads (no cap).
moor node set NAME [--max-boxes N | --no-cap] [--label L ... | --no-labels] [--expected-revision N] Sets a node’s cap or labels. You change your own node, and the operator changes a shared one. The next start reads it.
moor box-config NAME Replaces an open Box’s config override with --file FILE, or stdin, or removes it with --remove.
moor repo config get OWNER/NAME Prints the repo’s stored config as YAML; --json adds its revision and last editor.
moor repo config set OWNER/NAME Replaces the config with --file FILE, or stdin. It needs push access to the repo. --expected-revision N refuses a write after someone else’s save.
moor repo rules get OWNER/NAME Prints the repo’s Proxy rules text, or the default text at revision 0. See Proxy rules.
moor repo rules set OWNER/NAME Replaces the rules text, as repo config set does.

The host

Command What it does
moor up Sets the host up with a controller and a Docker node, as Self-host on one machine describes. A rerun changes nothing.
moor down [--force] Stops and removes the units moor up wrote. These are the controller, the runner, and the agent. Config, state, and secrets stay. It refuses while Boxes are open and running, and it names them. Close each with moor close NAME, or pass --force to stop anyway.
moor doctor [--public-url URL] Checks the setup, one ok, warn, or fail line per check, each with its fix. Exits 1 when a check failed. It fails when an image the agent needs is neither on this host nor in its registry. A source build’s default image is one of those. moor up only warns. A registry that cannot be reached is a warning.
moor env [OWNER/NAME] [--base REF] Previews the settings and credentials a Box of that repo would get. Operator only.
moor controller serve --config FILE Runs the controller.
moor controller attach [--socket PATH] Connects stdin and stdout to the controller socket, for use over ssh.
moor store migrate Brings the store to this release’s schema and exits.
moor store copy --to URL Copies the SQLite store into an empty Postgres database and exits.
moor events Prints stored events as JSON lines. --since, --box, --kind, --parent, and --follow filter them.
moor gate check SHA NAME Exits 0 when a run recorded as NAME passed on commit SHA.
moor call Runs one JSON request read from stdin.
moor version Prints the version, the commit, and the envelope schema.

A local client of a remote moor

These sign in to a moor server over OIDC and keep one sign-in per server for every local tool. --server takes the origin or the /mcp address and falls back to MOOR_SERVER.

Command What it does
moor login --server URL Signs in in the browser. --no-browser prints the address and reads the pasted return.
moor logout --server URL Forgets the sign-in and revokes it.
moor status [--server URL] Shows who is signed in and how long the token has left.
moor token --server URL Prints a fresh access token. --headers prints it as a headers helper expects.
moor mcp --server URL Relays MCP over stdio to the server, with a fresh token on each call.
moor listen --server URL [--box NAME] Prints one line per Box event that needs a person. See Events.

Exit codes

Code Meaning
0 Success.
1 The command failed, or a start or retry kept the Box after a failed setup line.
2 The command line or request was not valid.
3 moor refused the command.
124 moor wait timed out.
125 moor run did not start the command.
130 The command moor run started was interrupted.

moor run and moor exec otherwise exit with the command’s own code. moor exec exits 255 for its own failure.

JSON envelope

With --json, every command prints one envelope:

{"schema": "moor/1", "cmd": "version", "class": "ok", "value": {}, "warnings": [], "error": null}

class is ok, failed, usage, or refused. error is null on success, else {kind, message, hints, context}.

moor-machine-agent

Command What it does
up --server URL Pairs the machine, checks that Docker works, and installs a user service that runs the agent. Rerun it to apply new flags.
down Stops and removes the user service. The machine stays paired.
run Keeps the machine linked to its server. The user service runs it.
update --version VERSION Installs a release in place, after checking its checksum and signature.

up flags:

Flag Default Effect
--server URL MOOR_SERVER The moor server.
--token TOKEN MOOR_PAIR_TOKEN Pair with a one-use token from Settings, Machines, with no code to confirm.
--name NAME the host name The machine’s name.
--labels a,b none Labels a Box can ask for.
--allow-exec off Host no Boxes. Run the exec commands Boxes send.
--agent-image IMAGE this release’s The image of a Box’s agent place. MOOR_AGENT_IMAGE also sets it.
--work-image IMAGE this release’s The image of a Box’s work place. MOOR_WORK_IMAGE also sets it.
--cache-max-age AGE 30d How long a repo’s cache volumes may sit unused before the machine deletes them. Use 30d, 12h, 20s, or a bare number of days. 0 keeps them. MOOR_CACHE_MAX_AGE also sets it.

run takes --allow-exec, --agent-image, --work-image, --cache-max-age, and --auto-update, which installs the release the server names, then restarts. The user service runs it with the image flags up was given.