ralph_workflow/cli/
args.rs

1//! CLI argument definitions.
2//!
3//! Contains the `Args` struct with clap configuration for command-line parsing.
4
5use clap::Parser;
6
7/// Verbosity level shorthand flags (--quiet, --full).
8#[derive(Parser, Debug, Default)]
9pub struct VerbosityShorthand {
10    /// Shorthand for --verbosity=0 (minimal output)
11    #[arg(
12        short,
13        long,
14        conflicts_with = "verbosity",
15        help = "Quiet mode (same as -v0)"
16    )]
17    pub quiet: bool,
18
19    /// Shorthand for --verbosity=3 (no truncation)
20    #[arg(
21        long,
22        short,
23        conflicts_with = "verbosity",
24        help = "Full output mode, no truncation (same as -v3)"
25    )]
26    pub full: bool,
27}
28
29/// Debug verbosity flag.
30#[derive(Parser, Debug, Default)]
31pub struct DebugVerbosity {
32    /// Shorthand for --verbosity=4 (maximum verbosity with raw JSON)
33    #[arg(
34        long,
35        conflicts_with = "verbosity",
36        help = "Debug mode (same as -v4)",
37        hide = true
38    )]
39    pub debug: bool,
40}
41
42/// Quick preset mode flags.
43#[derive(Parser, Debug, Default)]
44pub struct QuickPresets {
45    /// Quick mode: 1 developer iteration, 1 review pass (fast turnaround)
46    #[arg(
47        long,
48        short = 'Q',
49        help = "Quick mode: 1 dev iteration + 1 review (for rapid prototyping)"
50    )]
51    pub quick: bool,
52
53    /// Rapid mode: 2 developer iterations, 1 review pass (between quick and standard)
54    #[arg(
55        long,
56        short = 'U',
57        help = "Rapid mode: 2 dev iterations + 1 review (fast but more thorough than quick)"
58    )]
59    pub rapid: bool,
60
61    /// Long mode: 15 developer iterations, 10 review passes (for thorough development)
62    #[arg(
63        long,
64        short = 'L',
65        help = "Long mode: 15 dev iterations + 10 reviews (for thorough development)"
66    )]
67    pub long: bool,
68}
69
70/// Standard preset mode flags.
71#[derive(Parser, Debug, Default)]
72pub struct StandardPresets {
73    /// Standard mode: 5 developer iterations, 2 review passes (default workflow)
74    #[arg(
75        long,
76        short = 'S',
77        help = "Standard mode: 5 dev iterations + 2 reviews (default workflow)"
78    )]
79    pub standard: bool,
80
81    /// Thorough mode: 10 developer iterations, 5 review passes (balanced but more than default)
82    #[arg(
83        long,
84        short = 'T',
85        help = "Thorough mode: 10 dev iterations + 5 reviews (balanced but thorough)"
86    )]
87    pub thorough: bool,
88}
89
90/// Unified config initialization flags.
91#[derive(Parser, Debug, Default)]
92pub struct UnifiedInitFlags {
93    /// Smart initialization: creates setup based on current state
94    ///
95    /// This is the RECOMMENDED way to get started with Ralph.
96    ///
97    /// Behavior:
98    ///   --init              (no value)   → Smart mode: infers what you need
99    ///   --init bug-fix      (with value) → Create PROMPT.md from specific Work Guide
100    ///
101    /// Smart mode (no value):
102    ///   - No config? Creates config at ~/.config/ralph-workflow.toml
103    ///   - Config exists, no PROMPT.md? Creates or prompts for PROMPT.md
104    ///   - Both exist? Shows helpful status message and exits
105    ///
106    /// Work Guides (for PROMPT.md):
107    ///   quick, bug-fix, feature-spec, refactor, test, docs, cli-tool, web-api,
108    ///   performance-optimization, security-audit, api-integration, database-migration,
109    ///   dependency-update, data-pipeline, ui-component, code-review, debug-triage,
110    ///   release, tech-debt, onboarding
111    ///
112    /// Note: These are Work Guides for YOUR work descriptions, NOT Agent Prompts.
113    /// See --help for details on the difference.
114    #[arg(
115        long,
116        conflicts_with_all = ["init_global", "init_config", "init_legacy", "init_prompt"],
117        help = "Smart init: create config or PROMPT.md (infers from current state)",
118        value_name = "TEMPLATE",
119        num_args = 0..=1,
120        default_missing_value = "",
121        // Cannot use possible_values here due to Option<String> type with optional value
122        // Completion is handled via --generate-completion
123    )]
124    pub init: Option<String>,
125
126    /// Initialize unified config file and exit (explicit alias for config creation)
127    #[arg(
128        long,
129        conflicts_with_all = ["init", "init_global", "init_legacy", "init_prompt"],
130        help = "Create ~/.config/ralph-workflow.toml with default settings (recommended)",
131        hide = true
132    )]
133    pub init_config: bool,
134
135    /// Initialize unified config file and exit
136    #[arg(
137        long,
138        conflicts_with_all = ["init", "init_config", "init_legacy", "init_prompt"],
139        help = "Create ~/.config/ralph-workflow.toml with default settings (recommended)",
140        hide = true
141    )]
142    pub init_global: bool,
143}
144
145/// Legacy initialization flag.
146#[derive(Parser, Debug, Default)]
147pub struct LegacyInitFlag {
148    /// Initialize legacy per-repo agents.toml and exit
149    #[arg(
150        long,
151        conflicts_with_all = ["init", "init_global", "init_prompt"],
152        help = "(Legacy) Create .agent/agents.toml with default settings (not recommended)",
153        hide = true
154    )]
155    pub init_legacy: bool,
156}
157
158/// Agent listing flags.
159#[derive(Parser, Debug, Default)]
160pub struct AgentListFlags {
161    /// List all configured agents and exit
162    #[arg(
163        long,
164        help = "Show all agents from registry and config file",
165        hide = true
166    )]
167    pub list_agents: bool,
168
169    /// List only agents found in PATH and exit
170    #[arg(
171        long,
172        help = "Show only agents that are installed and available",
173        hide = true
174    )]
175    pub list_available_agents: bool,
176}
177
178/// Provider listing flag.
179#[derive(Parser, Debug, Default)]
180pub struct ProviderListFlag {
181    /// List `OpenCode` provider types and their configuration
182    #[arg(
183        long,
184        help = "Show OpenCode provider types with model prefixes and auth commands",
185        hide = true
186    )]
187    pub list_providers: bool,
188}
189
190/// Shell completion generation flag.
191#[derive(Parser, Debug, Default)]
192pub struct CompletionFlag {
193    /// Generate shell completion script
194    #[arg(
195        long,
196        value_name = "SHELL",
197        value_enum,
198        help = "Generate shell completion script (bash, zsh, fish, elvish, powershell)"
199    )]
200    pub generate_completion: Option<Shell>,
201}
202
203/// Supported shell types for completion generation.
204#[derive(Debug, Clone, Copy, PartialEq, Eq, clap::ValueEnum)]
205pub enum Shell {
206    /// Bash shell
207    Bash,
208    /// Zsh shell
209    Zsh,
210    /// Fish shell
211    Fish,
212    /// Elvish shell
213    Elvish,
214    /// `pwsh` (`PowerShell`) shell
215    Pwsh,
216}
217
218/// Template listing flag.
219#[derive(Parser, Debug, Default)]
220pub struct TemplateListFlag {
221    /// List available PROMPT.md Work Guides and exit
222    #[arg(
223        long,
224        help = "Show all available Work Guides for PROMPT.md (templates for your tasks)"
225    )]
226    pub list_templates: bool,
227}
228
229/// Template management subcommands.
230#[derive(Parser, Debug, Default)]
231pub struct TemplateCommands {
232    /// Initialize user templates directory with Agent Prompts (backend AI prompts)
233    #[arg(
234        long = "init-system-prompts",
235        alias = "init-templates",
236        help = "Create ~/.config/ralph/templates/ with default Agent Prompts (backend AI behavior configuration, NOT Work Guides for PROMPT.md)",
237        default_missing_value = "false",
238        num_args = 0..=1,
239        require_equals = true
240    )]
241    pub init_templates: Option<bool>,
242
243    /// Force overwrite existing templates when initializing
244    #[arg(
245        long,
246        requires = "init_templates",
247        help = "Overwrite existing system prompt templates during init (use with caution)"
248    )]
249    pub force: bool,
250
251    /// Validate all templates for syntax errors
252    #[arg(long, help = "Validate all Agent Prompt templates for syntax errors")]
253    pub validate: bool,
254
255    /// Show template content and metadata
256    #[arg(
257        long,
258        value_name = "NAME",
259        help = "Show Agent Prompt template content and metadata"
260    )]
261    pub show: Option<String>,
262
263    /// List all prompt templates with their variables
264    #[arg(long, help = "List all Agent Prompt templates with their variables")]
265    pub list: bool,
266
267    /// Extract variables from a template
268    #[arg(
269        long,
270        value_name = "NAME",
271        help = "Extract variables from an Agent Prompt template"
272    )]
273    pub variables: Option<String>,
274
275    /// Test render a template with provided variables
276    #[arg(
277        long,
278        value_name = "NAME",
279        help = "Test render a system prompt template with provided variables"
280    )]
281    pub render: Option<String>,
282}
283
284impl TemplateCommands {
285    /// Check if --init-system-prompts or --init-templates flag was provided.
286    pub const fn init_templates_enabled(&self) -> bool {
287        self.init_templates.is_some()
288    }
289}
290
291/// Commit message plumbing flags.
292#[derive(Parser, Debug, Default)]
293pub struct CommitPlumbingFlags {
294    /// Generate commit message only (writes to .agent/commit-message.txt)
295    #[arg(
296        long,
297        help = "Run only the commit message generation phase, then exit",
298        hide = true
299    )]
300    pub generate_commit_msg: bool,
301
302    /// Apply commit using existing .agent/commit-message.txt
303    #[arg(
304        long,
305        help = "Stage all changes and commit using .agent/commit-message.txt",
306        hide = true
307    )]
308    pub apply_commit: bool,
309}
310
311/// Commit display plumbing flags.
312#[derive(Parser, Debug, Default)]
313pub struct CommitDisplayFlags {
314    /// Show the generated commit message and exit
315    #[arg(long, help = "Read and display .agent/commit-message.txt", hide = true)]
316    pub show_commit_msg: bool,
317
318    /// Reset the starting commit reference to current HEAD
319    #[arg(
320        long,
321        help = "Reset .agent/start_commit to current HEAD (for incremental diff generation)",
322        hide = true
323    )]
324    pub reset_start_commit: bool,
325}
326
327/// Recovery command flags.
328#[derive(Parser, Debug, Default)]
329pub struct RecoveryFlags {
330    /// Resume from last checkpoint after an interruption
331    #[arg(
332        long,
333        help = "Resume from last checkpoint (if one exists from a previous interrupted run)",
334        hide = true
335    )]
336    pub resume: bool,
337
338    /// Validate setup without running agents (dry run)
339    #[arg(
340        long,
341        help = "Validate configuration and PROMPT.md without running agents",
342        hide = true
343    )]
344    pub dry_run: bool,
345
346    /// Output comprehensive diagnostic information
347    #[arg(
348        long,
349        short = 'd',
350        help = "Show system info, agent status, and config for troubleshooting"
351    )]
352    pub diagnose: bool,
353}
354
355/// Rebase control flags.
356#[derive(Parser, Debug, Default)]
357pub struct RebaseFlags {
358    /// Skip automatic rebase before/after pipeline
359    #[arg(
360        long,
361        help = "Skip automatic rebase to main branch before and after pipeline"
362    )]
363    pub skip_rebase: bool,
364
365    /// Only perform rebase and exit
366    #[arg(
367        long,
368        help = "Only rebase to main branch, then exit (no pipeline execution)"
369    )]
370    pub rebase_only: bool,
371}
372
373/// Ralph: PROMPT-driven agent orchestrator for git repos
374#[derive(Parser, Debug)]
375#[command(name = "ralph")]
376#[command(about = "PROMPT-driven multi-agent orchestrator for git repos")]
377#[command(
378    long_about = "Ralph orchestrates AI coding agents to implement changes based on PROMPT.md.\n\n\
379    It runs a developer agent for code implementation, then a reviewer agent for\n\
380    quality assurance, automatically staging and committing the final result."
381)]
382#[command(version)]
383#[command(
384    after_help = "╺━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n\
385\n\
386NEW TO RALPH?\n\
387    Just want to get started? Run:\n\
388        ralph --init feature-spec         # Create PROMPT.md from a Task Template\n\
389        ralph \"fix: my bug\"              # Run with AI agents\n\
390\n\
391    WORK GUIDES IN RALPH (two different types):\n\
392\n\
393    1. Work Guides (for PROMPT.md - YOUR task descriptions)\n\
394       These are templates for describing YOUR work to the AI.\n\
395       Examples: bug-fix, feature-spec, refactor, test, docs, etc.\n\
396       \n\
397       Commands:\n\
398         ralph --init <template>       # Create PROMPT.md from a Work Guide\n\
399         ralph --list-templates        # Show all available Work Guides\n\
400         ralph --init-prompt <name>    # Same as --init (legacy alias)\n\
401\n\
402    2. Agent Prompts (backend AI behavior configuration)\n\
403       These configure HOW the AI agents behave (internal prompts).\n\
404       You probably don't need to touch these unless you're customizing agent behavior.\n\
405       \n\
406       Commands:\n\
407         ralph --init-system-prompts    # Create default Agent Prompts\n\
408         ralph --list                   # Show Agent Prompt templates\n\
409         ralph --show <name>            # Show a specific Agent Prompt\n\
410\n\
411╺━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n\
412\n\
413SHELL COMPLETION\n\
414    Enable tab-completion for faster command entry:\n\
415        ralph --generate-completion=bash  > ~/.local/share/bash-completion/completions/ralph\n\
416        ralph --generate-completion=zsh   > ~/.zsh/completion/_ralph\n\
417        ralph --generate-completion=fish  > ~/.config/fish/completions/ralph.fish\n\
418\n\
419    Then restart your shell or source the file.\n\
420\n\
421╺━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n\
422\n\
423PRESET MODES (pick how thorough AI should be):\n\
424    -Q  Quick:      1 dev + 1 review     (typos, small fixes)\n\
425    -U  Rapid:      2 dev + 1 review     (minor changes)\n\
426    -S  Standard:   5 dev + 2 reviews    (default for most tasks)\n\
427    -T  Thorough:  10 dev + 5 reviews    (complex features)\n\
428    -L  Long:      15 dev + 10 reviews   (most thorough)\n\
429\n\
430╺━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n\
431\n\
432COMMON SHORTHANDS:\n\
433    -D N, -R N       Set dev iterations and review cycles\n\
434    -a AGENT         Pick developer agent (claude, opencode, etc.)\n\
435    -r AGENT         Pick reviewer agent\n\
436    -v N / -q / -f   Set verbosity (quiet/normal/full)\n\
437    -d               Diagnose/show system info\n\
438    -i               Interactive mode (prompt if PROMPT.md missing)\n\
439    -c PATH          Use specific config file\n\
440\n\
441╺━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n\
442\n\
443QUICK EXAMPLES:\n\
444    ralph \"fix: typo\"                Run with default settings\n\
445    ralph -Q \"fix: small bug\"        Quick mode for tiny fixes\n\
446    ralph -U \"feat: add button\"      Rapid mode for minor features\n\
447    ralph -a claude \"fix: bug\"       Use specific agent\n\
448    ralph --list-templates            See all Work Guides\n\
449    ralph --init bug-fix              # Create PROMPT.md from a Work Guide\n\
450╺━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
451)]
452// CLI arguments naturally use many boolean flags. These represent independent
453// user choices, not a state machine, so bools are the appropriate type.
454pub struct Args {
455    /// Verbosity shorthand flags (--quiet, --full)
456    #[command(flatten)]
457    pub verbosity_shorthand: VerbosityShorthand,
458
459    /// Debug verbosity flag
460    #[command(flatten)]
461    pub debug_verbosity: DebugVerbosity,
462
463    /// Quick preset mode flags
464    #[command(flatten)]
465    pub quick_presets: QuickPresets,
466
467    /// Standard preset mode flags
468    #[command(flatten)]
469    pub standard_presets: StandardPresets,
470
471    /// Unified config initialization flags
472    #[command(flatten)]
473    pub unified_init: UnifiedInitFlags,
474
475    /// Legacy initialization flag
476    #[command(flatten)]
477    pub legacy_init: LegacyInitFlag,
478
479    /// Agent listing flags
480    #[command(flatten)]
481    pub agent_list: AgentListFlags,
482
483    /// Provider listing flag
484    #[command(flatten)]
485    pub provider_list: ProviderListFlag,
486
487    /// Shell completion generation flag
488    #[command(flatten)]
489    pub completion: CompletionFlag,
490
491    /// Template listing flag
492    #[command(flatten)]
493    pub template_list: TemplateListFlag,
494
495    /// Template management commands
496    #[command(flatten)]
497    pub template_commands: TemplateCommands,
498
499    /// Commit message plumbing flags
500    #[command(flatten)]
501    pub commit_plumbing: CommitPlumbingFlags,
502
503    /// Commit display plumbing flags
504    #[command(flatten)]
505    pub commit_display: CommitDisplayFlags,
506
507    /// Recovery command flags
508    #[command(flatten)]
509    pub recovery: RecoveryFlags,
510
511    /// Rebase control flags
512    #[command(flatten)]
513    pub rebase_flags: RebaseFlags,
514
515    /// Commit message for the final commit
516    #[arg(
517        default_value = "chore: apply PROMPT loop + review/fix/review",
518        help = "Commit message for the final commit"
519    )]
520    pub commit_msg: String,
521
522    /// Number of developer iterations (default: 5)
523    #[arg(
524        long = "developer-iters",
525        short = 'D',
526        env = "RALPH_DEVELOPER_ITERS",
527        value_name = "N",
528        help = "Number of developer agent iterations",
529        aliases = ["developer-iteration", "dev-iter", "d-iters"]
530    )]
531    pub developer_iters: Option<u32>,
532
533    /// Number of review-fix cycles (N=0 skips review, N=1 is one review-fix cycle, etc.)
534    #[arg(
535        long = "reviewer-reviews",
536        short = 'R',
537        env = "RALPH_REVIEWER_REVIEWS",
538        value_name = "N",
539        help = "Number of review-fix cycles (0=skip review, 1=one cycle, default: 2)",
540        aliases = ["reviewer-count", "reviewer-review"]
541    )]
542    pub reviewer_reviews: Option<u32>,
543
544    /// Preset for common agent combinations
545    #[arg(
546        long,
547        env = "RALPH_PRESET",
548        value_name = "NAME",
549        help = "Use a preset agent combination (default, opencode)",
550        hide = true
551    )]
552    pub preset: Option<super::presets::Preset>,
553
554    /// Developer/driver agent to use (from `agent_chain.developer`)
555    #[arg(
556        long,
557        short = 'a',
558        env = "RALPH_DEVELOPER_AGENT",
559        aliases = ["driver-agent", "dev-agent", "developer"],
560        value_name = "AGENT",
561        help = "Developer agent for code implementation (default: first in agent_chain.developer)"
562    )]
563    pub developer_agent: Option<String>,
564
565    /// Reviewer agent to use (from `agent_chain.reviewer`)
566    #[arg(
567        long,
568        short = 'r',
569        env = "RALPH_REVIEWER_AGENT",
570        aliases = ["rev-agent", "reviewer"],
571        value_name = "AGENT",
572        help = "Reviewer agent for code review (default: first in agent_chain.reviewer)"
573    )]
574    pub reviewer_agent: Option<String>,
575
576    /// Developer model/provider override (e.g., "-m opencode/glm-4.7-free")
577    #[arg(
578        long,
579        env = "RALPH_DEVELOPER_MODEL",
580        value_name = "MODEL_FLAG",
581        help = "Model flag for developer agent (e.g., '-m opencode/glm-4.7-free')",
582        hide = true
583    )]
584    pub developer_model: Option<String>,
585
586    /// Reviewer model/provider override (e.g., "-m opencode/claude-sonnet-4")
587    #[arg(
588        long,
589        env = "RALPH_REVIEWER_MODEL",
590        value_name = "MODEL_FLAG",
591        help = "Model flag for reviewer agent (e.g., '-m opencode/claude-sonnet-4')",
592        hide = true
593    )]
594    pub reviewer_model: Option<String>,
595
596    /// Developer provider override (e.g., "opencode", "zai", "anthropic", "openai")
597    /// Use this to switch providers at runtime without changing agent config.
598    /// Combined with the agent's model to form the full model flag.
599    /// Provider types: 'opencode' (Zen gateway), 'zai'/'zhipuai' (Z.AI direct), 'anthropic'/'openai' (direct API)
600    #[arg(
601        long,
602        env = "RALPH_DEVELOPER_PROVIDER",
603        value_name = "PROVIDER",
604        help = "Provider for developer agent: 'opencode' (Zen), 'zai'/'zhipuai' (Z.AI direct), 'anthropic'/'openai' (direct API)",
605        hide = true
606    )]
607    pub developer_provider: Option<String>,
608
609    /// Reviewer provider override (e.g., "opencode", "zai", "anthropic", "openai")
610    /// Use this to switch providers at runtime without changing agent config.
611    /// Combined with the agent's model to form the full model flag.
612    /// Provider types: 'opencode' (Zen gateway), 'zai'/'zhipuai' (Z.AI direct), 'anthropic'/'openai' (direct API)
613    #[arg(
614        long,
615        env = "RALPH_REVIEWER_PROVIDER",
616        value_name = "PROVIDER",
617        help = "Provider for reviewer agent: 'opencode' (Zen), 'zai'/'zhipuai' (Z.AI direct), 'anthropic'/'openai' (direct API)",
618        hide = true
619    )]
620    pub reviewer_provider: Option<String>,
621
622    /// JSON parser for the reviewer agent (overrides agent config)
623    /// Useful for testing different parsers with problematic agents
624    #[arg(
625        long,
626        env = "RALPH_REVIEWER_JSON_PARSER",
627        value_name = "PARSER",
628        help = "JSON parser for reviewer (claude, codex, gemini, opencode, generic); overrides agent config",
629        hide = true
630    )]
631    pub reviewer_json_parser: Option<String>,
632
633    /// Verbosity level (0=quiet, 1=normal, 2=verbose, 3=full, 4=debug)
634    #[arg(
635        short,
636        long,
637        value_name = "LEVEL",
638        value_parser = clap::value_parser!(u8).range(0..=4),
639        help = "Output verbosity (0=quiet, 1=normal, 2=verbose [default], 3=full, 4=debug); overrides RALPH_VERBOSITY"
640    )]
641    pub verbosity: Option<u8>,
642
643    /// Disable isolation mode (allow NOTES.md and ISSUES.md to persist)
644    #[arg(
645        long,
646        help = "Disable isolation mode: keep NOTES.md and ISSUES.md between runs",
647        hide = true
648    )]
649    pub no_isolation: bool,
650
651    /// Review depth level (standard, comprehensive, security, incremental)
652    #[arg(
653        long,
654        value_name = "LEVEL",
655        help = "Review depth: standard (balanced), comprehensive (thorough), security (OWASP-focused), incremental (changed files only)",
656        hide = true
657    )]
658    pub review_depth: Option<String>,
659
660    /// Path to configuration file (default: ~/.config/ralph-workflow.toml)
661    #[arg(
662        long,
663        short = 'c',
664        value_name = "PATH",
665        help = "Path to configuration file (default: ~/.config/ralph-workflow.toml)",
666        hide = true
667    )]
668    pub config: Option<std::path::PathBuf>,
669
670    /// Initialize PROMPT.md from a Task Template and exit
671    ///
672    /// This is a legacy alias for `--init <template>`. Consider using `--init` instead.
673    ///
674    /// Task Templates describe YOUR work to the AI (e.g., bug-fix, feature-spec).
675    /// These are different from System Prompts which configure AI behavior.
676    ///
677    /// Available Task Templates:
678    /// quick, bug-fix, feature-spec, refactor, test, docs, cli-tool, web-api,
679    /// performance-optimization, security-audit, api-integration, database-migration,
680    /// dependency-update, data-pipeline, ui-component, code-review, debug-triage,
681    /// release, tech-debt, onboarding
682    #[arg(
683        long,
684        value_name = "TEMPLATE",
685        help = "Create PROMPT.md from a Task Template (use --list-templates to see options)"
686    )]
687    pub init_prompt: Option<String>,
688
689    /// Interactive mode: prompt to create PROMPT.md from template when missing
690    #[arg(
691        long,
692        short = 'i',
693        help = "Interactive mode: prompt to create PROMPT.md from template when missing"
694    )]
695    pub interactive: bool,
696
697    /// Git user name override (highest priority in identity resolution chain)
698    #[arg(
699        long,
700        env = "RALPH_GIT_USER_NAME",
701        value_name = "NAME",
702        help = "Git user name for commits (overrides config, env, and git config)"
703    )]
704    pub git_user_name: Option<String>,
705
706    /// Git user email override (highest priority in identity resolution chain)
707    #[arg(
708        long,
709        env = "RALPH_GIT_USER_EMAIL",
710        value_name = "EMAIL",
711        help = "Git user email for commits (overrides config, env, and git config)"
712    )]
713    pub git_user_email: Option<String>,
714
715    /// Show streaming quality metrics at the end of agent output
716    #[arg(
717        long,
718        help = "Display streaming quality metrics (delta stats, repairs, violations) after agent completion"
719    )]
720    pub show_streaming_metrics: bool,
721}