Skip to main content

ralph_workflow/cli/init/
extended_help.rs

1const EXTENDED_HELP_TEXT: &str = r#"RALPH EXTENDED HELP
2===============================================================================
3
4Ralph is a PROMPT-driven multi-agent orchestrator for git repos. It runs a
5developer agent for code implementation, then a reviewer agent for quality
6assurance and fixes (default), automatically staging and committing the final result.
7
8===============================================================================
9GETTING STARTED
10===============================================================================
11
12  1. Initialize config:
13       ralph --init                      # Smart init (infers what you need)
14
15  2. Create a PROMPT.md from a Work Guide:
16       ralph --init feature-spec         # Or: bug-fix, refactor, quick, etc.
17
18  3. Edit PROMPT.md with your task details
19
20  4. Run Ralph:
21       ralph "fix: my bug description"   # Commit message for the final commit
22
23===============================================================================
24WORK GUIDES VS AGENT PROMPTS
25===============================================================================
26
27  Ralph has two types of templates - understanding the difference is key:
28
29  1. WORK GUIDES (for PROMPT.md - YOUR task descriptions)
30     -------------------------------------------------
31     These are templates for describing YOUR work to the AI.
32     You fill them in with your specific task requirements.
33
34     Examples: quick, bug-fix, feature-spec, refactor, test, docs
35
36     Commands:
37       ralph --init <work-guide>      Create PROMPT.md from a Work Guide
38       ralph --list-work-guides       Show all available Work Guides
39
40  2. AGENT PROMPTS (backend AI behavior configuration)
41     -------------------------------------------------
42     These configure HOW the AI agents behave (internal system prompts).
43     You probably don't need to touch these unless customizing agent behavior.
44
45     Commands:
46       ralph --init-system-prompts    Create default Agent Prompts
47       ralph --list                   Show Agent Prompt templates
48       ralph --show <name>            Show a specific Agent Prompt
49
50===============================================================================
51PRESET MODES
52===============================================================================
53
54  Pick how thorough the AI should be:
55
56    -Q  Quick:      1 dev iteration  + 1 review   (typos, small fixes)
57    -U  Rapid:      2 dev iterations + 1 review   (minor changes)
58    -S  Standard:   5 dev iterations + 2 reviews  (default for most tasks)
59    -T  Thorough:  10 dev iterations + 5 reviews  (complex features)
60    -L  Long:      15 dev iterations + 10 reviews (most thorough)
61
62  Custom iterations:
63    ralph -D 3 -R 2 "feat: feature"   # 3 dev iterations, 2 review cycles
64    ralph -D 10 -R 0 "feat: no review"  # Skip review phase entirely
65
66===============================================================================
67COMMON OPTIONS
68===============================================================================
69
70  Iterations:
71    -D N, --developer-iters N   Set developer iterations
72    -R N, --reviewer-reviews N  Set review cycles (0 = skip review)
73
74  Agents:
75    -a AGENT, --developer-agent AGENT   Pick developer agent
76    -r AGENT, --reviewer-agent AGENT    Pick reviewer agent
77
78  Verbosity:
79    -q, --quiet          Quiet mode (minimal output)
80    -f, --full           Full output (no truncation)
81    -v N, --verbosity N  Set verbosity (0-4)
82
83  Other:
84    -d, --diagnose       Show system info and agent status
85
86===============================================================================
87ADVANCED OPTIONS
88===============================================================================
89
90  These options are hidden from the main --help to reduce clutter.
91
92  Initialization:
93    --force-overwrite            Overwrite PROMPT.md without prompting
94    -i, --interactive            Prompt for PROMPT.md if missing
95
96  Git Control:
97    --with-rebase                Enable automatic rebase to main branch (disabled by default)
98    --rebase-only                Only rebase, then exit (no pipeline)
99    --git-user-name <name>       Override git user name for commits
100    --git-user-email <email>     Override git user email for commits
101
102  Recovery:
103    --resume                     Resume from last checkpoint
104    --dry-run                    Validate setup without running agents
105
106  Agent Prompt Management:
107    --init-system-prompts        Create default Agent Prompt templates
108    --list                       List all Agent Prompt templates
109    --show <name>                Show Agent Prompt content
110    --validate                   Validate Agent Prompt templates
111    --variables <name>           Extract variables from template
112    --render <name>              Test render a template
113
114  Debugging:
115    --show-streaming-metrics     Show JSON streaming quality metrics
116    -c PATH, --config PATH       Use specific config file
117
118===============================================================================
119SHELL COMPLETION
120===============================================================================
121
122  Enable tab-completion for faster command entry:
123
124    Bash:
125      ralph --generate-completion=bash > ~/.local/share/bash-completion/completions/ralph
126
127    Zsh:
128      ralph --generate-completion=zsh > ~/.zsh/completion/_ralph
129
130    Fish:
131      ralph --generate-completion=fish > ~/.config/fish/completions/ralph.fish
132
133  Then restart your shell or source the file.
134
135===============================================================================
136TROUBLESHOOTING
137===============================================================================
138
139  Common issues:
140
141    "PROMPT.md not found"
142      -> Run: ralph --init <work-guide>  (e.g., ralph --init bug-fix)
143
144    "No agents available"
145      -> Run: ralph -d  (diagnose) to check agent status
146      -> Ensure at least one agent is installed (claude, codex, opencode)
147
148    "Config file not found"
149      -> Run: ralph --init  to create ~/.config/ralph-workflow.toml
150
151    Resume after interruption:
152      -> Run: ralph --resume  to continue from last checkpoint
153
154    Validate setup without running:
155      -> Run: ralph --dry-run
156
157===============================================================================
158EXAMPLES
159===============================================================================
160
161    ralph "fix: typo"                 Run with default settings
162    ralph -Q "fix: small bug"         Quick mode for tiny fixes
163    ralph -U "feat: add button"       Rapid mode for minor features
164    ralph -a claude "fix: bug"        Use specific agent
165    ralph --list-work-guides          See all Work Guides
166    ralph --init bug-fix              Create PROMPT.md from a Work Guide
167    ralph --init bug-fix --force-overwrite  Overwrite existing PROMPT.md
168
169===============================================================================
170"#;
171
172/// Handle the `--extended-help` / `--man` flag.
173///
174/// Displays comprehensive help including shell completion, all presets,
175/// troubleshooting information, and the difference between Work Guides and Agent Prompts.
176pub fn handle_extended_help() {
177    println!("{EXTENDED_HELP_TEXT}");
178}