Skip to main content

release_kit/
cli.rs

1//! Command-line surface: clap derive types only, one module per
2//! subcommand's arguments. No behavior lives here; each variant routes to
3//! its handler in `commands`.
4
5pub mod adopt;
6pub mod assess;
7pub mod branches;
8pub mod completions;
9pub mod depend;
10pub mod devshell;
11pub mod doctor;
12pub mod guide;
13pub mod init;
14pub mod lines;
15pub mod message;
16pub mod payload;
17pub mod read;
18pub mod runs;
19pub mod setup;
20pub mod skill;
21pub mod status;
22pub mod upgrade;
23pub mod versions;
24pub mod worktree;
25
26use clap::{Parser, Subcommand};
27
28/// The release-kit CLI: reads the canon and lands the deterministic files.
29#[derive(Debug, Parser)]
30#[command(name = "rk", version, about, propagate_version = true)]
31pub struct Cli {
32    /// Which subcommand to run.
33    #[command(subcommand)]
34    pub command: Commands,
35}
36
37/// Every subcommand the binary offers.
38#[derive(Debug, Subcommand)]
39pub enum Commands {
40    /// Read the technology-agnostic method chapters.
41    Method(read::ReadArgs),
42    /// Read the per-technology bindings.
43    Binding(read::ReadArgs),
44    /// Read the deterministic files a binding lands.
45    Snippet(read::ReadArgs),
46    /// Print a runbook with what detection knows filled in.
47    Guide(guide::GuideArgs),
48    /// Read the per-forge documents.
49    Forge(read::ReadArgs),
50    /// Print the pinned-tool registry, with --check as its online freshness report.
51    Versions(versions::VersionsArgs),
52    /// Report the payload this binary carries, with its digests.
53    Payload(payload::PayloadArgs),
54    /// Land a technology's files into a target repository.
55    Init(init::InitArgs),
56    /// Report what landed in a target and whether it drifted.
57    Status(status::StatusArgs),
58    /// Take a landed target to this binary's payload.
59    Upgrade(upgrade::UpgradeArgs),
60    /// Record a target landed before the record existed.
61    Adopt(adopt::AdoptArgs),
62    /// Classify a target before anything lands: greenfield, brownfield, or needs-decision.
63    Assess(assess::AssessArgs),
64    /// Execute the repository-side setup against the detected forge.
65    Setup(setup::SetupArgs),
66    /// Report and prune local branches the forge already merged.
67    Branches(branches::BranchesArgs),
68    /// Open, inventory, and retire the release lines.
69    Lines(lines::LinesArgs),
70    /// Judge a commit message, title, or body against the content guards.
71    Message(message::MessageArgs),
72    /// Inspect, create, and prune the linked worktrees beside a checkout.
73    Worktree(worktree::WorktreeArgs),
74    /// Inspect and prune the run journals.
75    Runs(runs::RunsArgs),
76    /// Manage the agent skills at user scope.
77    Skill(skill::SkillArgs),
78    /// Wire release-kit as a consumer's devshell dependency and keep its pin fresh.
79    Devshell(devshell::DevshellArgs),
80    /// Add another project as a dependency of a target, from how the source distributes itself.
81    Depend(depend::DependArgs),
82    /// Run every environment probe and report by class.
83    Doctor(doctor::DoctorArgs),
84    /// Print the whole command surface in one call.
85    Usage,
86    /// Print the license terms the binary carries.
87    License,
88    /// Generate shell completions.
89    Completions(completions::CompletionsArgs),
90}