1pub mod audit;
2pub mod commit;
3pub mod config_cmd;
4pub mod drift;
5pub mod import;
6pub mod init;
7pub mod plan;
8pub mod policy;
9pub mod protection;
10pub mod repos;
11pub mod rollback;
12pub mod rulesets;
13pub mod security;
14pub mod settings;
15pub mod teams;
16pub mod template_cmd;
17pub mod tui;
18
19use clap::Parser;
20
21#[derive(Parser)]
22#[command(
23 name = "ward",
24 about = "GitHub repository management for developers. Plan, apply, verify.",
25 version,
26 propagate_version = true
27)]
28pub struct Cli {
29 #[command(subcommand)]
30 pub command: Command,
31
32 #[arg(long, global = true)]
34 pub org: Option<String>,
35
36 #[arg(long, global = true)]
38 pub system: Option<String>,
39
40 #[arg(long, global = true)]
42 pub repo: Option<String>,
43
44 #[arg(long, global = true, default_value_t = false)]
46 pub json: bool,
47
48 #[arg(long, global = true, default_value_t = 5)]
50 pub parallelism: usize,
51
52 #[arg(long, global = true)]
54 pub config: Option<String>,
55
56 #[arg(short, long, global = true, action = clap::ArgAction::Count)]
58 pub verbose: u8,
59}
60
61#[derive(clap::Subcommand)]
62pub enum Command {
63 Repos(repos::ReposCommand),
65
66 Security(security::SecurityCommand),
68
69 Settings(settings::SettingsCommand),
71
72 Commit(commit::CommitCommand),
74
75 Protection(protection::ProtectionCommand),
77
78 Drift(drift::DriftCommand),
80
81 Rulesets(rulesets::RulesetsCommand),
83
84 Teams(teams::TeamsCommand),
86
87 Rollback(rollback::RollbackCommand),
89
90 Audit(audit::AuditCommand),
92
93 Import(import::ImportCommand),
95
96 Plan(plan::PlanCommand),
98
99 Policy(policy::PolicyCommand),
101
102 Tui,
104
105 Init(init::InitCommand),
107
108 Config(config_cmd::ConfigCommand),
110
111 Template(template_cmd::TemplateCommand),
113
114 #[command(hide = true)]
116 Completions {
117 #[arg(value_enum)]
119 shell: clap_complete::Shell,
120 },
121}