1pub mod audit;
2pub mod commit;
3pub mod config_cmd;
4pub mod doctor;
5pub mod drift;
6pub mod import;
7pub mod init;
8pub mod plan;
9pub mod policy;
10pub mod protection;
11pub mod repos;
12pub mod rollback;
13pub mod rulesets;
14pub mod security;
15pub mod settings;
16pub mod teams;
17pub mod template_cmd;
18pub mod tui;
19
20use clap::Parser;
21
22#[derive(Parser)]
23#[command(
24 name = "ward",
25 about = "GitHub repository management for developers. Plan, apply, verify.",
26 version,
27 propagate_version = true
28)]
29pub struct Cli {
30 #[command(subcommand)]
31 pub command: Command,
32
33 #[arg(long, global = true)]
35 pub org: Option<String>,
36
37 #[arg(long, global = true)]
39 pub system: Option<String>,
40
41 #[arg(long, global = true)]
43 pub repo: Option<String>,
44
45 #[arg(long, global = true, default_value_t = false)]
47 pub json: bool,
48
49 #[arg(long, global = true, default_value_t = 5)]
51 pub parallelism: usize,
52
53 #[arg(long, global = true)]
55 pub config: Option<String>,
56
57 #[arg(short, long, global = true, action = clap::ArgAction::Count)]
59 pub verbose: u8,
60}
61
62#[derive(clap::Subcommand)]
63pub enum Command {
64 Repos(repos::ReposCommand),
66
67 Security(security::SecurityCommand),
69
70 Settings(settings::SettingsCommand),
72
73 Commit(commit::CommitCommand),
75
76 Protection(protection::ProtectionCommand),
78
79 Drift(drift::DriftCommand),
81
82 Rulesets(rulesets::RulesetsCommand),
84
85 Teams(teams::TeamsCommand),
87
88 Rollback(rollback::RollbackCommand),
90
91 Audit(audit::AuditCommand),
93
94 Import(import::ImportCommand),
96
97 Plan(plan::PlanCommand),
99
100 Policy(policy::PolicyCommand),
102
103 Doctor(doctor::DoctorCommand),
105
106 Tui,
108
109 Init(init::InitCommand),
111
112 Config(config_cmd::ConfigCommand),
114
115 Template(template_cmd::TemplateCommand),
117
118 #[command(hide = true)]
120 Completions {
121 #[arg(value_enum)]
123 shell: clap_complete::Shell,
124 },
125}