CLI Overview
The full AgentRail command surface, grouped by what you're doing.
agentrail is the command-line control plane. Run it with no arguments to see
the live command list, or agentrail doctor to check your install. Every
command is documented across the pages below.
Login is required for all commands. The only exempt commands are login,
logout, whoami, and --help.
The --target DIR flag
Most commands operate on the current working directory. Pass --target DIR to
point a command at a different project directory instead of cd-ing into it.
It's accepted broadly; the pages below call out the other notable flags per
command rather than repeating --target everywhere.
Command groups
| Group | Command | What it does |
|---|---|---|
| Team & Runner | login / logout / whoami | Sign this machine in and out of a workspace (login is required). |
| Team & Runner | runner | Run the local worker that claims and executes queued issues. |
| Team & Runner | console | Open the interactive console. |
| Project | init / install | Initialise or install a project (build the local index). |
| Project | init claude|cursor|codex | Initialise for a specific agent. |
| Project | upgrade | Upgrade agentrail in this project. |
| Project | cleanup | Clean up worktrees and sessions. |
| Project | status | Show worktree / session status. |
| Project | doctor | Check installation health. |
| Run | run | Run a workflow. |
| Run | run issue NUMBER | Run a workflow for a specific issue. |
| Run | resume | Resume a paused session. |
| Run | link | Link a worktree to a session. |
| AFK | afk | Run the AFK queue / worktree loop. |
| Context | context sources | List what the index covers. |
| Context | context index | Build the context index. |
| Context | context query | Query the index for a task. |
| Context | context def|callers|impact|ast | Structural code-graph navigation. |
| Memory & Skills | memory recall | Recall stored memory for a topic. |
| Memory & Skills | memory capture | Capture a new memory item. |
| Memory & Skills | skills list | List available skills. |
| Memory & Skills | skills resolve | Resolve skills for a task. |
| Planning | prd create | Convert an idea into a published PRD. |
| Planning | milestone create | Convert a PRD into milestone files. |
| Planning | issue create | Create house-template issues. |
| Planning | grill-me | Stress-test a plan with the grill-me skill. |
| Planning | prompt issue / prompt review | Print an agent-ready prompt. |
| Planning | labels sync | Manage / sync labels. |
| Diagnostics | doctor | Check installation health. |
| Diagnostics | status | Show worktree / session status. |
| Diagnostics | timeline | Show session timeline. |
| Diagnostics | heartbeat run / heartbeat serve | Run the Heartbeat dispatcher loop. |
| Cost | cost | Per-issue real-dollar cost from the AFK journal. |
| Cost | cost RUN_ID --recommend | Cost-saving recommendations for a run. |
Internal plumbing
agentrail internal <subcommand> exposes internal plumbing used by the
workflow itself. It is not part of the day-to-day surface and is not documented
here.