Skip to main content

Crate claude_runner

Crate claude_runner 

Source
Expand description

claude_runner crate / clr binary — Claude Code CLI + command schema constants.

This crate has two roles:

  1. Library — exports COMMANDS_YAML, the path to the .claude command schema, for use by YAML consumers at compile time or runtime.

  2. Binary (clr) — Standalone CLI that mirrors Claude Code’s native --flag value syntax and executes via claude_runner_core. Session continuation (-c) is applied by default; use --new-session to start fresh.

§Two roles, two consumers

clr binary (standalone CLI)
  invoked directly: clr "Fix bug" --dir /path --model sonnet
    → parse_args() → ClaudeCommand builder → claude subprocess (with -c by default)
  message given → print mode (default); bare clr → interactive REPL

YAML consumers (e.g. consumer workspace's CLI, build.rs)
  aggregate: claude_runner::COMMANDS_YAML → registers .claude + .claude.help in PHF map

This lib has zero consumer workspace dependencies. Without enabled, it is a pure constants + types crate. With enabled, it also exposes register_commands (API consistency shim).

§Registering commands in other binaries

Build-time (PHF): Point build.rs at COMMANDS_YAML.

Runtime: Use MultiYamlAggregator with COMMANDS_YAML.

Re-exports§

pub use verbosity::VerbosityLevel;

Modules§

verbosity
VerbosityLevel — CLI output verbosity control.

Constants§

COMMANDS_YAML
Absolute path to this crate’s command definitions YAML.

Functions§

register_commands
Register claude_runner commands into an existing registry.
run_cli
Run the clr/claude_runner CLI.