Skip to content

Commands Reference

All available CLI commands with options, arguments, and usage examples.


Global Flags

These flags apply to all commands:

FlagDefaultDescription
--model <id>Provider defaultOverride the AI model (e.g., claude-opus-4-6, gemini-2.5-pro)
--provider <name>claudeAI provider: claude, gemini, codex, openrouter
--debugfalseShow full stack traces on errors
bash
# Use a different model
reygent run --spec spec.md --model claude-opus-4-6

# Use a different provider
reygent agent dev --provider gemini

# Debug mode for troubleshooting
reygent run --spec spec.md --debug

reygent init

Initialize a .reygent/ config folder in your project.

bash
reygent init

What it does:

  • Creates .reygent/config.json with all built-in agent definitions
  • Warns if .reygent/ already exists
  • Skips creation if config.json already exists

When to use: First time setting up reygent on a project so you can customize agent prompts and tools.


reygent generate-spec

Generate a full markdown spec from a short description.

bash
reygent generate-spec [description] [--output <file>] [--skip-clarification]
Argument/OptionDescription
descriptionShort description of the feature (prompted interactively if omitted)
--output <file>File path to write the spec to (prompted interactively if omitted)
--skip-clarificationSkip clarifying questions and generate spec directly

Example:

bash
reygent generate-spec "Add dark mode toggle to settings" --output dark-mode-spec.md

The planner agent generates a structured spec with Title, Overview, Requirements, Acceptance Criteria, and Constraints sections.


reygent spec <source>

Load and display a parsed spec from any supported source.

bash
reygent spec <source> [--clarify]
Argument/OptionDescription
sourcePath to .md file, issue key (PROJ-123), or Linear URL
--clarifyRun the planner with an interactive clarification loop

Examples:

bash
# Load from markdown
reygent spec ./feature-spec.md

# Load from Jira
reygent spec PROJ-123

# Load from Linear
reygent spec https://linear.app/team/issue/ENG-456

# Load and run planner clarification
reygent spec ENG-456 --clarify

Without --clarify, outputs the raw spec as JSON. With --clarify, runs the planner agent and displays a structured plan with goals, tasks, constraints, and definition of done.


reygent agent [name]

Start an interactive agent session. Spawns the Claude CLI with the agent's system prompt injected.

bash
reygent agent [name] [--spec <source>]
Argument/OptionDescription
nameAgent name: dev, qe, planner, security-reviewer, pr-reviewer, adhoc (prompted interactively if omitted)
--spec <source>Path to .md file, issue key, or Linear URL — appended to the agent's system prompt

Examples:

bash
# Pick agent interactively
reygent agent

# Start interactive session with dev agent
reygent agent dev

# Interactive session with spec context
reygent agent qe --spec ./feature-spec.md

# Use a skill from the registry
reygent agent code-reviewer

reygent run

Run the full reygent workflow from spec to reviewed PR.

bash
reygent run --spec <source> [options]
OptionDefaultDescription
--spec <source>(required)Path to .md file, issue key, or Linear URL
--dry-runfalsePrint workflow stages as a tree diagram without executing
--security-threshold <level>HIGHMinimum severity to fail security review (CRITICAL, HIGH, MEDIUM, LOW)
--auto-approvefalseAuto-approve all file edits and actions without prompting
--insecurefalseSkip SSL certificate verification for API calls
--skip-clarificationfalseSkip planner clarification questions; make assumptions instead
--max-retries <count>2Maximum retry attempts when gate tests fail
--verbosefalseShow detailed token/cost breakdown per agent, including input/output tokens and estimated cost

Examples:

bash
# Full reygent workflow with interactive prompts
reygent run --spec feature.md

# Fully autonomous — no prompts at all
reygent run --spec ENG-123 --auto-approve --skip-clarification

# Preview what workflow stages would run
reygent run --spec feature.md --dry-run

# Strict security — fail on any finding
reygent run --spec feature.md --security-threshold LOW

# More retries for flaky tests
reygent run --spec feature.md --max-retries 5

# Corporate network with self-signed certs
reygent run --spec feature.md --insecure

# Show detailed token/cost breakdown
reygent run --spec feature.md --verbose

Verbose output example:

┌─ Detailed Usage (--verbose)
│  planner (plan)  $0.45  12s  3 turns  2,500 in / 850 out
│    cache: { cached: 1,200, saved: $0.08, provider: claude }
│  dev (implement)  $0.32  8s  2 turns  1,800 in / 600 out
│  qe (implement)  $0.19  5s  1 turn  900 in / 400 out
│    cache: { cached: 300, saved: $0.02, provider: claude }
│  pr-review (pr-review)  $0.12  4s  1 turn  600 in / 250 out
└─

Shows individual agent calls with stage names, duration, turn count, tokens, and cache metadata.

Reygent Workflow Stages

#StageAgent(s)What happens
1PlanplannerBreaks spec into goals, tasks, constraints, definition of done
2Implementdev + qeDev writes code + unit tests; QE writes functional tests
3Unit Test GatedevRuns unit tests; retries dev agent on failure
4Functional Test GateqeRuns functional tests; retries dev + qe agents on failure
5Security Reviewsecurity-reviewerScans for OWASP Top 10 vulnerabilities
6PR Createpr-reviewerCreates branch, commits, pushes, opens PR
7PR Reviewpr-reviewerReviews diff, posts review comment on PR

Interactive Prompts

When running without --auto-approve, you'll be prompted for:

  1. Auto-approve mode — whether to let agents edit files freely
  2. Clarification preference — whether the planner should ask questions or make assumptions
  3. Retry decisions — when a test gate fails, whether to retry
  4. Security bypass — when the security review fails, whether to continue

reygent review-work

Review the current branch's changes and optionally post the review to an open PR or MR.

bash
reygent review-work [--spec <source>] [--insecure]
OptionDescription
--spec <source>Optional spec to review the diff against (provides context for the review)
--insecureSkip SSL certificate verification for GitLab API calls

What it does:

  1. Detects the current branch and git platform (GitHub or GitLab)
  2. Checks for an open PR/MR on the current branch
  3. Gets the diff between the current branch and the default branch
  4. Runs the pr-reviewer agent to review the diff
  5. If a PR/MR exists, posts the review as a comment

Examples:

bash
# Review current branch
reygent review-work

# Review with spec context
reygent review-work --spec feature-spec.md

# Review on GitLab with self-signed certs
reygent review-work --insecure

Platform behavior:

  • GitHub: Uses gh pr view to detect PRs and gh pr comment to post reviews
  • GitLab: Uses the GitLab API to detect MRs and post review notes
  • No PR/MR found: Review is printed to the console only

reygent review-comments

Fetch review comments from an open PR/MR and run the dev agent to address them.

bash
reygent review-comments [--insecure] [--auto-approve]
OptionDescription
--insecureSkip SSL certificate verification for GitLab API calls
--auto-approveSkip plan approval prompt and execute immediately

What it does:

  1. Detects the current branch and git platform
  2. Finds the open PR/MR and fetches all review comments
  3. Displays a summary of the comments
  4. Runs the planner agent to create a plan addressing the comments
  5. Presents the plan for approval (unless --auto-approve)
  6. Runs the dev agent to implement the fixes
  7. Commits and pushes the changes

Examples:

bash
# Address review comments interactively
reygent review-comments

# Fully autonomous — no approval prompt
reygent review-comments --auto-approve

# GitLab with self-signed certs
reygent review-comments --insecure

Approval loop: When not using --auto-approve, you can:

  • Approve — execute the plan
  • Provide feedback — regenerate the plan with your notes
  • Reject — exit without changes

reygent config

Interactively configure provider, model, and per-agent overrides.

bash
reygent config

What it does:

  1. Shows current provider and model settings
  2. Checks which providers are available on your machine (green checkmark or red cross)
  3. Prompts you to select a default provider (claude, gemini, codex, openrouter)
  4. Prompts you to select a default model from that provider's supported list
  5. Walks through each agent, grouped by category (Development, Testing & Review, Planning), and shows:
    • Role badge, description, and available tools
    • Current provider and model
    • Three choices: Keep current, Customize (pick a different provider/model), or Clear overrides (remove per-agent overrides)
  6. Writes the updated config to .reygent/config.json

Requires a .reygent/ directory. Run reygent init first if you haven't already.

Example agent grouping output:

── Development ──

Dev  developer
  Implementation agent for writing code
  Tools: read, write, edit
  Provider: claude
  Model:    claude-sonnet-4-5
? Configure Dev: (Use arrow keys)
❯ Keep current
  Customize
  Clear overrides

── Testing & Review ──

QE  quality-engineer
  Writes and runs functional tests
  Tools: read, write, bash
  Provider: claude
  Model:    claude-opus-4-6
? Configure QE: (Use arrow keys)
❯ Keep current
  Customize
  Clear overrides

── Planning ──

Planner  planner
  Creates implementation plans
  Tools: read, grep, glob
  Provider: claude
  Model:    claude-sonnet-4-5

Available Claude models:

Model IDLabel
claude-sonnet-4-5-20250929Sonnet 4.5 (recommended)
claude-opus-4-6Opus 4.6
claude-haiku-4-5-20251001Haiku 4.5
claude-sonnet-4-20250514Sonnet 4
claude-3-5-sonnet-202410223.5 Sonnet
claude-3-5-haiku-202410223.5 Haiku
claude-3-opus-202402293 Opus

Short aliases are supported (e.g., claude-sonnet-4-5 resolves to claude-sonnet-4-5-20250929).

Example:

bash
# Initialize, then configure
reygent init
reygent config

Per-agent overrides allow mixing providers — for example, use Claude for the dev agent but Gemini for the planner:

json
{
  "provider": "claude",
  "model": "claude-sonnet-4-5-20250929",
  "agents": [
    {
      "name": "planner",
      "provider": "gemini",
      "model": "gemini-2.5-pro",
      "..."
    }
  ]
}

For providers with no fixed model list (like OpenRouter), you'll be prompted to type a model ID instead of selecting from a list.


reygent skills

Manage skills from the reygent-skills registry.

reygent skills list

List all available skills in the registry.

bash
reygent skills list

Shows each skill's name, description, version, and license. Already-installed skills display an [installed] badge. Checks both local .reygent/skills/ and global ~/.reygent/skills/.

reygent skills add <name>

Install a skill from the registry.

bash
reygent skills add <name> [--global]
Argument/OptionDescription
nameSkill name to install (e.g., code-reviewer)
--globalInstall to ~/.reygent/skills/ instead of local .reygent/skills/

Examples:

bash
# Install to local project
reygent skills add code-reviewer

# Install globally (available to all projects)
reygent skills add code-reviewer --global

Checks compatibility with your reygent version before installing. Warns (but still installs) if the skill requires a newer version.

Requires a local .reygent/ directory for local installs. Run reygent init first, or use --global.

reygent skills remove <name>

Remove an installed skill.

bash
reygent skills remove <name> [--global]
Argument/OptionDescription
nameSkill name to remove
--globalRemove from ~/.reygent/skills/ instead of local

Examples:

bash
reygent skills remove code-reviewer
reygent skills remove code-reviewer --global

reygent telemetry

Manage telemetry data and configuration. Telemetry captures workflow execution details, agent calls, costs, and errors to help debug failures and optimize workflows.

bash
reygent telemetry [command]

Subcommands

reygent telemetry status

Show telemetry configuration and storage status.

bash
reygent telemetry status

Displays:

  • Current telemetry level (minimal, standard, verbose)
  • Database location and size
  • Number of runs stored
  • Retention policy

reygent telemetry runs

List recent telemetry runs.

bash
reygent telemetry runs [--limit <count>] [--failed] [--successful]
OptionDescription
--limit <count>Max number of runs to show (default: 10)
--failedShow only failed runs
--successfulShow only successful runs

Displays table with:

  • Run ID
  • Timestamp
  • Command
  • Status (success/failure)
  • Duration
  • Total cost

reygent telemetry show <runId>

Show detailed event log for a specific run.

bash
reygent telemetry show <runId>

Displays full event log including:

  • All agent calls with timestamps
  • Input/output tokens
  • Costs per agent
  • Errors and warnings
  • Stage transitions

reygent telemetry export <runId>

Export run data to JSON or CSV.

bash
reygent telemetry export <runId> [--format <type>] [--output <file>]
OptionDescription
--format <type>Export format: json or csv (default: json)
--output <file>Output file path (default: stdout)

reygent telemetry prune

Delete old telemetry data.

bash
reygent telemetry prune [--older-than <days>] [--keep-count <count>]
OptionDescription
--older-than <days>Delete runs older than N days
--keep-count <count>Keep only the N most recent runs

reygent telemetry enable

Enable telemetry in configuration.

bash
reygent telemetry enable

Sets telemetry.enabled = true in .reygent/config.json.

reygent telemetry disable

Disable telemetry in configuration.

bash
reygent telemetry disable

Sets telemetry.enabled = false in .reygent/config.json.


reygent analyze

Analyze telemetry data for insights into failures, successes, costs, and performance.

bash
reygent analyze [command]

Subcommands

reygent analyze failures

Show common failure patterns from telemetry.

bash
reygent analyze failures [--limit <count>] [--since <date>]
OptionDescription
--limit <count>Max number of failures to analyze (default: 20)
--since <date>Only analyze failures since date (ISO format)

Identifies:

  • Common error messages
  • Failing stages (unit tests, functional tests, security)
  • Agent-specific failures
  • Suggested fixes based on patterns

reygent analyze success

Extract patterns from successful runs.

bash
reygent analyze success [--limit <count>] [--since <date>]
OptionDescription
--limit <count>Max number of successful runs to analyze (default: 20)
--since <date>Only analyze runs since date (ISO format)

Identifies:

  • Average completion time per stage
  • Token usage patterns
  • Cost efficiency metrics
  • Common spec characteristics

reygent analyze costs

Cost breakdown and optimization recommendations.

bash
reygent analyze costs [--since <date>] [--by-agent] [--by-stage]
OptionDescription
--since <date>Only analyze costs since date (ISO format)
--by-agentGroup costs by agent
--by-stageGroup costs by workflow stage

Shows:

  • Total cost breakdown
  • Cost per run (average, min, max)
  • Most expensive agents/stages
  • Token usage efficiency
  • Caching effectiveness (if supported by provider)
  • Recommendations for cost reduction

reygent analyze agents

Agent-specific performance breakdown.

bash
reygent analyze agents [--agent <name>] [--since <date>]
OptionDescription
--agent <name>Focus on specific agent (dev, qe, planner, etc.)
--since <date>Only analyze runs since date (ISO format)

Shows per-agent:

  • Average duration
  • Token usage (input/output)
  • Cost per invocation
  • Success rate
  • Common failure modes

reygent last

Show details of the most recent run.

bash
reygent last [options]
OptionDescription
--verboseShow full event log with timestamps and details
--outputShow only the final output from the run
--errorsShow only errors from the run
--jsonOutput as JSON for machine parsing

Examples:

bash
# Quick summary of last run
reygent last

# Full event log with timestamps
reygent last --verbose

# Just show errors
reygent last --errors

# Get structured JSON (useful for scripts)
reygent last --json

Default output includes:

  • Run ID
  • Command
  • Status (success/failure)
  • Duration
  • Total cost
  • High-level summary of stages completed

reygent knowledge

Manage living documentation in .reygent/knowledge/. The knowledge system automatically learns from telemetry data to improve future runs. See docs/knowledge.md for full details.

bash
reygent knowledge [command]

Subcommands

reygent knowledge list

List all knowledge files.

bash
reygent knowledge list

Shows:

  • File names
  • File sizes
  • Last modified dates
  • Number of entries (for structured files)

reygent knowledge show <file>

Show specific knowledge file.

bash
reygent knowledge show <file>

Displays full contents of:

  • failures.md — documented failure patterns and solutions
  • patterns.md — successful workflow patterns
  • optimizations.md — performance and cost optimizations
  • Custom knowledge files

reygent knowledge search <query>

Search knowledge files for a query.

bash
reygent knowledge search <query>

Full-text search across all knowledge files. Highlights matches and shows surrounding context.

reygent knowledge edit <file>

Edit knowledge file in $EDITOR.

bash
reygent knowledge edit <file>

Opens specified knowledge file in your configured editor. Falls back to vi if $EDITOR not set.

reygent knowledge add-failure

Document a failure pattern interactively.

bash
reygent knowledge add-failure [--from-run <runId>]
OptionDescription
--from-run <runId>Pre-populate from a specific telemetry run

Interactive prompts:

  1. Error pattern — what went wrong
  2. Root cause — why it happened
  3. Solution — how to fix it
  4. Prevention — how to avoid it in future

Appends structured entry to .reygent/knowledge/failures.md.

reygent knowledge add-pattern

Document a success pattern interactively.

bash
reygent knowledge add-pattern [--from-run <runId>]
OptionDescription
--from-run <runId>Pre-populate from a specific telemetry run

Interactive prompts:

  1. Pattern description — what worked well
  2. Context — when to apply this pattern
  3. Implementation — how to replicate
  4. Benefits — why it's effective

Appends structured entry to .reygent/knowledge/patterns.md.

reygent knowledge stats

Show knowledge base statistics and effectiveness.

bash
reygent knowledge stats [--since <date>]
OptionDescription
--since <date>Only analyze effectiveness since date (ISO format)

Displays:

  • Total number of documented patterns/failures
  • Knowledge base growth over time
  • Success rate improvement (before/after knowledge addition)
  • Most referenced knowledge entries
  • Suggested knowledge gaps based on recent failures

Environment Variables

Set these in a .env file in your project root (or export in your shell).

VariableUsed For
LINEAR_API_KEYLinear issue tracker integration
JIRA_URLJira instance URL (e.g., https://company.atlassian.net)
JIRA_EMAILJira account email
JIRA_API_TOKENJira API token
GITHUB_TOKENGitHub API authentication for reygent skills commands (raises rate limit from 60 to 5,000 req/hr)
GIT_SSL_NO_VERIFYSkip SSL verification globally
NODE_TLS_REJECT_UNAUTHORIZEDNode.js TLS override (set to 0 to skip)

Released under the Apache-2.0 License.