Skip to main content

release_kit/cli/
init.rs

1//! Arguments for `rk init`.
2
3use camino::Utf8PathBuf;
4use clap::Args;
5
6/// Land a technology's deterministic files into a target repository.
7#[derive(Debug, Args)]
8pub struct InitArgs {
9    /// The technology whose files land; one of the bindings.
10    #[arg(long)]
11    pub tech: String,
12
13    /// The repository the files land into.
14    #[arg(long)]
15    pub target: Utf8PathBuf,
16
17    /// The forge whose files land: github or gitlab. Defaults to detection
18    /// from the target's git remote; an unrecognized host refuses.
19    #[arg(long)]
20    pub forge: Option<String>,
21
22    /// The project path on the forge, substituted into the rendered files
23    /// and recorded as the landing parameter. Defaults to detection from
24    /// the target's git remote; an apply with neither refuses.
25    #[arg(long)]
26    pub repo: Option<String>,
27
28    /// The working-copy mode this project chooses: worktree (every
29    /// code-changing branch in a linked worktree, the main checkout
30    /// commits nothing) or branches (branches worked in the main
31    /// checkout, worktrees optional beside them). Recorded as a landing
32    /// parameter and rendered into the landed blocks.
33    #[arg(long, default_value = "worktree")]
34    pub workflow: String,
35
36    /// The release style this project chooses: trunk (the bot's release
37    /// request carries auto-merge from creation, so a green trunk ships
38    /// itself) or lines (every request waits for a human's merge).
39    /// Recorded as a landing parameter and rendered into the landed
40    /// release workflow.
41    #[arg(long, default_value = "trunk")]
42    pub style: String,
43
44    /// Opt the landing into the Nix capability: a seeded package
45    /// expression, a seed flake pair where the target has none, and the
46    /// workflow that proves the build. Recorded as a landing parameter;
47    /// off by default, because a packaging surface is a decision, not a
48    /// default.
49    #[arg(long)]
50    pub nix: bool,
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}