Skip to content

CLI Reference

Chief provides a minimal but powerful CLI. All commands operate on the current working directory's .chief/ folder.

Usage

chief [command] [flags]

Available Commands:

CommandDescription
(default)Run the Ralph Loop on the active PRD
newCreate a new PRD in the current project
editOpen the PRD for editing
statusShow current PRD progress
listList all PRDs in the project
updateUpdate Chief to the latest version

Commands

chief (default)

Launch the TUI dashboard for the active PRD. This opens Chief in Ready state—press s to start the Ralph Loop, which then reads your PRD, selects stories, and invokes the agent iteratively.

bash
chief [name]

Arguments:

ArgumentDescription
namePRD name to run (optional, auto-detects if omitted)

Flags:

FlagDescriptionDefault
--max-iterations <n>, -nMaximum loop iterationsDynamic
--no-retryDisable auto-retry on agent crashesfalse
--verboseShow raw agent output in logfalse

Examples:

bash
# Run with auto-detected PRD
chief

# Run a specific PRD by name
chief auth-system

# Increase iteration limit for large PRDs
chief --max-iterations 200

# Combine flags
chief auth-system -n 50 --verbose

Dynamic iteration limit

When --max-iterations is not specified, Chief calculates a dynamic limit based on the number of remaining stories plus a buffer. You can adjust the limit at runtime with +/- in the TUI.

TIP

If your project has only one PRD, Chief auto-detects it. Pass a name when you have multiple PRDs.


chief new

Create a new PRD in the current project. This command launches the agent CLI with a preloaded prompt to help you define your project requirements interactively.

bash
chief new [name] [context]

Arguments:

ArgumentDescription
namePRD name (optional, defaults to main). Must contain only letters, numbers, hyphens, and underscores.
contextAdditional context to pass to the agent (optional). Included in the PRD creation prompt.

How it works:

  1. Chief launches the agent CLI with a specialized PRD-creation prompt
  2. You describe your project, goals, and user stories conversationally
  3. The agent helps structure your requirements and writes prd.md
  4. When done, type /exit to leave the agent session
  5. Chief parses prd.md and generates prd.json

What it creates:

.chief/
└── prds/
    └── <name>/
        ├── prd.md       # Markdown PRD (written with the agent)
        └── prd.json     # Structured stories (generated by Chief)

Examples:

bash
# Create a new PRD (defaults to name "main")
chief new

# Create a named PRD
chief new auth-system

# Create a PRD with additional context
chief new auth-system "We use Express.js with JWT tokens"

# The agent opens - describe what you want to build
# Type /exit when done - Chief generates the PRD files

INFO

Run chief new from the root of your project. Chief creates the .chief/ directory if it doesn't exist.


chief edit

Open an existing PRD for editing via the agent CLI.

bash
chief edit

Launches the agent with your PRD loaded, allowing you to refine requirements, add stories, or update prd.md conversationally. When you /exit, Chief regenerates prd.json from the updated prd.md.

Arguments:

ArgumentDescription
namePRD name to edit (optional, auto-detects if omitted)

Flags:

FlagDescription
--mergeAuto-merge progress on conversion conflicts
--forceAuto-overwrite on conversion conflicts

Examples:

bash
# Edit the auto-detected PRD
chief edit

# Edit a specific PRD
chief edit auth-system

# Edit and auto-merge progress
chief edit auth-system --merge

chief status

Show progress for the current PRD. Displays a summary of story completion at a glance.

bash
chief status

Output includes:

  • Current PRD name
  • Total number of stories
  • Completed / In Progress / Pending counts
  • Next story to be worked on

Examples:

bash
# Check progress on the auto-detected PRD
chief status

# Example output:
#   PRD: auth-system
#   Stories: 8 total
#     ✓ 5 completed
#     → 1 in progress
#     ○ 2 pending
#   Next: US-006 - Password Reset Flow

chief list

List all PRDs in the current project.

bash
chief list

Scans .chief/prds/ and shows each PRD with its completion status.

Examples:

bash
# List all PRDs
chief list

# Example output:
#   auth-system    5/8 stories complete
#   landing-page   12/12 stories complete ✓
#   api-v2         0/6 stories complete

chief update

Update Chief to the latest version. Downloads and installs the newest release from GitHub.

bash
chief update

Chief checks the GitHub releases API, compares your current version to the latest, and downloads the appropriate binary for your platform if an update is available.

Examples:

bash
# Update to latest version
chief update

# Example output:
#   Checking for updates...
#   Downloading v0.5.2 (you have v0.4.0)...
#   Updated to v0.5.2.

Automatic update check

Chief performs a non-blocking version check every time you launch the TUI. If a newer version is available, you'll see a message like:

Chief v0.5.2 available (you have v0.5.1). Run 'chief update' to upgrade.

Keyboard Shortcuts (TUI)

When Chief is running, the TUI provides real-time feedback and interactive controls:

Loop Control

KeyAction
sStart the loop (when Ready, Paused, Stopped, or Error)
pPause the loop (finishes current iteration gracefully)
xStop the loop immediately (kills agent process)

View Switching

KeyAction
tToggle between Dashboard and Log views
dToggle Diff view (shows the selected story's commit diff)

PRD Management

KeyAction
nOpen PRD picker in create mode (switch PRDs or create new)
lOpen PRD picker in selection mode (switch between existing PRDs)
1-9Quick switch to PRD tabs 1-9
eEdit current PRD (from any main view)
mMerge completed PRD's branch into main (in picker or completion screen)
cClean worktree and optionally delete branch (in picker or completion screen)

Settings

KeyAction
,Open Settings overlay (from any view)
KeyAction
j / Move down (stories in Dashboard, scroll in Log/Diff)
k / Move up (stories in Dashboard, scroll in Log/Diff)
Ctrl+D / PgDnPage down (Log/Diff view)
Ctrl+U / PgUpPage up (Log/Diff view)
gJump to top (Log/Diff view)
GJump to bottom (Log/Diff view)
+ / =Increase max iterations by 5
- / _Decrease max iterations by 5

General

KeyAction
?Show help overlay (context-aware)
EscClose modals/overlays
qQuit (gracefully stops all loops)
Ctrl+CForce quit

TIP

The TUI has three views: Dashboard showing stories and progress, Log streaming the agent's output in real time, and Diff showing the commit diff for the selected story. Press t to toggle Dashboard/Log, or d to open the Diff view.

Exit Codes

Chief uses standard exit codes:

CodeMeaning
0Success
1Error