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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
/// Unified config initialization flags.
#[derive(Parser, Debug, Default)]
pub struct UnifiedInitFlags {
/// Smart initialization: creates setup based on current state
///
/// This is the RECOMMENDED way to get started with Ralph.
///
/// Behavior:
/// --init (no value) → Smart mode: infers what you need
/// --init bug-fix (with value) → Create PROMPT.md from specific Work Guide
///
/// Smart mode (no value):
/// - No config? Creates config at ~/.config/ralph-workflow.toml
/// - Config exists, no PROMPT.md? Creates or prompts for PROMPT.md
/// - Both exist? Shows helpful status message and exits
///
/// Work Guides (for PROMPT.md):
/// quick, bug-fix, feature-spec, refactor, test, docs, cli-tool, web-api,
/// performance-optimization, security-audit, api-integration, database-migration,
/// dependency-update, data-pipeline, ui-component, code-review, debug-triage,
/// release, tech-debt, onboarding
///
/// Note: These are Work Guides for YOUR work descriptions, NOT Agent Prompts.
/// See --help for details on the difference.
#[arg(
long,
conflicts_with_all = ["init_global", "init_config"],
help = "Smart init: create config or PROMPT.md (infers from current state)",
value_name = "TEMPLATE",
num_args = 0..=1,
default_missing_value = "",
// Cannot use possible_values here due to Option<String> type with optional value
// Completion is handled via --generate-completion
)]
pub init: Option<String>,
/// Force overwrite existing PROMPT.md when using --init
#[arg(
long = "force-overwrite",
visible_alias = "overwrite",
help = "Overwrite existing PROMPT.md without prompting (use with --init)",
hide = true
)]
pub force_init: bool,
/// Initialize unified config file and exit (explicit alias for config creation)
#[arg(
long,
conflicts_with_all = ["init", "init_global"],
help = "Create ~/.config/ralph-workflow.toml with default settings (recommended)",
hide = true
)]
pub init_config: bool,
/// Initialize unified config file and exit
#[arg(
long,
conflicts_with_all = ["init", "init_config"],
help = "Create ~/.config/ralph-workflow.toml with default settings (recommended)",
hide = true
)]
pub init_global: bool,
/// Initialize local project config file and exit
#[arg(
long,
conflicts_with_all = ["init", "init_config", "init_global"],
help = "Create .agent/ralph-workflow.toml for project-specific overrides"
)]
pub init_local_config: bool,
/// Validate configuration and show effective settings
#[arg(
long,
help = "Validate config files and display effective merged settings"
)]
pub check_config: bool,
}
/// Work Guide listing flag.
#[derive(Parser, Debug, Default)]
pub struct WorkGuideListFlag {
/// List available PROMPT.md Work Guides and exit
#[arg(
long = "list-work-guides",
visible_alias = "list-templates",
help = "Show all available Work Guides for PROMPT.md"
)]
pub list_work_guides: bool,
}