Expand description
claude_runner crate / clr binary — Claude Code CLI + command schema constants.
This crate has two roles:
-
Library — exports
COMMANDS_YAML, the path to the.claudecommand schema, for use by YAML consumers at compile time or runtime. -
Binary (
clr) — Standalone CLI that mirrors Claude Code’s native--flag valuesyntax and executes viaclaude_runner_core. Session continuation (-c) is applied by default; use--new-sessionto 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 mapThis 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_runnercommands into an existing registry. - run_cli
- Run the
clr/claude_runnerCLI.