1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
//! CLI arguments for runner management commands.
//!
//! Responsibilities:
//! - Define RunnerArgs and RunnerCommand enums for Clap.
//! - Delegate command execution to commands/runner/ module.
//!
//! Not handled here:
//! - Capability data retrieval (see commands/runner/capabilities.rs).
//! - Binary detection logic (see commands/runner/detection.rs).
use anyhow::Result;
use clap::{Args, Subcommand, ValueEnum};
/// Arguments for the `ralph runner` command.
#[derive(Args)]
pub struct RunnerArgs {
#[command(subcommand)]
pub command: RunnerCommand,
}
#[derive(Subcommand)]
pub enum RunnerCommand {
/// Show capabilities for a specific runner (models, features, binary status).
Capabilities(CapabilitiesArgs),
/// List all available runners with brief descriptions.
List(ListArgs),
}
/// Output format for runner commands.
#[derive(Debug, Clone, Copy, Default, ValueEnum)]
pub enum RunnerFormat {
/// Human-readable text output (default).
#[default]
Text,
/// Machine-readable JSON output for scripting/CI.
Json,
}
#[derive(Args)]
pub struct CapabilitiesArgs {
/// Runner to inspect (codex, opencode, gemini, claude, cursor, kimi, pi, or plugin id).
pub runner: String,
/// Output format (text or json).
#[arg(long, value_enum, default_value = "text")]
pub format: RunnerFormat,
}
#[derive(Args)]
pub struct ListArgs {
/// Output format (text or json).
#[arg(long, value_enum, default_value = "text")]
pub format: RunnerFormat,
}
pub fn handle_runner_capabilities(args: CapabilitiesArgs) -> Result<()> {
crate::commands::runner::capabilities::handle_capabilities(&args.runner, args.format)
}
pub fn handle_runner_list(args: ListArgs) -> Result<()> {
crate::commands::runner::list::handle_list(args.format)
}