Skip to main content

release_kit/cli/
init.rs

1//! Arguments for `rk init`.
2
3use camino::Utf8PathBuf;
4use clap::Args;
5
6use super::profile_flags::ProfileFlags;
7
8/// Land the files the target configuration selects into a repository.
9#[derive(Debug, Clone, Args)]
10#[expect(
11    clippy::struct_excessive_bools,
12    reason = "each field is one clap flag, and an opt-in capability's flag is a boolean by design; a state machine would hide the command line this struct describes"
13)]
14pub struct InitArgs {
15    /// The project profile and the Git workflow.
16    #[command(flatten)]
17    pub profile: ProfileFlags,
18
19    /// The repository the files land into.
20    #[arg(long)]
21    pub target: Utf8PathBuf,
22
23    /// Opt the landing into the Nix capability: a seeded package
24    /// expression and a seed flake pair where the target has none.
25    /// Recorded as a capability request; off by default, because a
26    /// packaging surface is a decision, not a default.
27    #[arg(long, alias = "nix")]
28    pub nix_packaging: bool,
29
30    /// Request the landed vulnerability reporting policy, `SECURITY.md`.
31    /// An automatic release requests it by default; a release-less
32    /// profile asks for it with this flag.
33    #[arg(long)]
34    pub reporting_policy: bool,
35
36    /// Opt the landing into the Scorecard capability: a workflow that
37    /// computes an `OpenSSF` Scorecard result and publishes it to the public
38    /// Scorecard API. GitHub only. Recorded as a capability request; off by
39    /// default, because publishing a score is a decision, not a default.
40    #[arg(long)]
41    pub scorecard: bool,
42
43    /// Opt the landing into code scanning, naming the provider: codeql,
44    /// GitHub's own analyzer, whose terms cover an open-source codebase so
45    /// the landing reads the driver's declared licence and refuses the pair
46    /// where it is not OSI-approved; or semgrep, which carries no licence
47    /// condition and runs on either forge. Recorded as a capability
48    /// request; off by default, because a scanning surface is a decision.
49    #[arg(long, value_name = "PROVIDER")]
50    pub code_scanning: Option<String>,
51
52    /// Write the files; without it the destinations are listed and nothing
53    /// is touched.
54    #[arg(long)]
55    pub apply: bool,
56
57    /// Emit one JSON object on stdout instead of the human report.
58    #[arg(long)]
59    pub json: bool,
60}