harness
Reference

CLI Reference

Complete reference for all harness commands and flags

harness run

Run a coding agent task.

harness run [OPTIONS] [--prompt <PROMPT> | --prompt-file <FILE>]

Options

FlagShortDescription
--agent <AGENT>-aAgent to use: claude, codex, opencode, cursor
--prompt <TEXT>-pPrompt text (or pipe from stdin)
--prompt-file <FILE>Read prompt from a file
--model <MODEL>-mModel name or alias
--permissions <MODE>full-access (default) or read-only
--format <FMT>-fOutput format: ndjson (default), text, json, markdown
--output-file <FILE>-oWrite events to a file in addition to stdout
--cwd <DIR>Working directory for the agent
--timeout <SECS>Timeout in seconds
--system-prompt <TEXT>Override the agent's system prompt
--append-system-prompt <TEXT>Append to the agent's system prompt
--max-turns <N>Maximum agentic turns
--max-budget-usd <N>Maximum spend in USD
--resume <SESSION>Resume a previous session
--binary <PATH>Explicit path to the agent binary
--extra-args <ARGS>Extra arguments passed to the agent
--dry-runShow resolved command without executing

Prompt sources (in priority order)

  1. --prompt <TEXT> — inline prompt
  2. --prompt-file <FILE> — read from file
  3. stdin — if input is piped (not a terminal)

Examples

# Basic run
harness run --agent claude --prompt "explain main.rs"

# With model alias and output file
harness run -a claude -m sonnet -p "fix the bug" -o session.ndjson

# Dry-run to see resolved command
harness run --agent claude --model opus --prompt "hello" --dry-run

# Read-only mode
harness run --agent claude --permissions read-only --prompt "analyze this"

# Pipe from stdin
cat task.md | harness run --agent claude

harness list

List available agents with their installation status.

harness list [OPTIONS]
FlagDescription
--jsonOutput as JSON

harness check

Check if a specific agent is installed and working.

harness check <AGENT> [OPTIONS]
FlagDescription
--capabilitiesShow agent capabilities

harness config

Manage configuration.

harness config <SUBCOMMAND>
SubcommandDescription
initCreate harness.toml in the current directory
showDisplay resolved configuration
pathPrint the config file path

harness models

Manage the model registry.

harness models <SUBCOMMAND>
SubcommandDescription
listList all model aliases
list --agent <AGENT>List models for a specific agent
list --jsonOutput as JSON
resolve <ALIAS> --agent <AGENT>Resolve alias to model ID
updateRefresh the cached registry from GitHub
pathPrint the registry file path

Global options

FlagDescription
--versionPrint version
--helpPrint help

On this page