Skip to main content
This is the public CLI API used by the Miles skill. It is for agents and developers that need exact commands, flags, result types, and recovery behavior. Most people do not need to run these commands themselves. See Miles + Coding Agents for the collaborative workflow.

How the CLI works

The agent normally runs miles <command>. Commands operate on the active Miles site saved on that machine. Use miles sites to list known sites, miles site-attach <siteId> to resume one from anywhere, and miles use <siteId> to switch between locally known sites. Use --json when an agent needs a structured result. It is supported by the commands documented in this reference. Human-readable output is the default. The CLI is the supported API surface. The service routes it uses are not a separate public HTTP API.

Canonical commands

Use the canonical names below for new integrations. Earlier names remain as compatibility aliases and are listed in Lifecycle and compatibility.

Modes

Outcomes and exit codes

Long-running work returns an outcome. Do not treat printed text as proof that a request completed. wait-job --json returns a structured result with fields such as outcome, phase, milesMessage, question, approvalRequired, directions, siteReady, errorId, recovery, credits, and sessionMemory. Next: Authentication and account.