Skip to main content

spec_driven_docs/cli/
init.rs

1//! `init` subcommand: parse-shape.
2//!
3//! Holds the clap derive struct only. No I/O, no business logic.
4
5use camino::Utf8PathBuf;
6
7use crate::domain::profile::ProfileId;
8
9/// Install the payload into a target repository.
10#[derive(Debug, clap::Args)]
11pub struct InitArgs {
12    /// The target repository; must be an absolute path.
13    #[arg(long)]
14    pub target: Utf8PathBuf,
15
16    /// The profile to install.
17    #[arg(long, value_enum)]
18    pub profile: ProfileId,
19
20    /// Write into a non-empty target that has no instance yet.
21    #[arg(long, conflicts_with = "dry_run")]
22    pub apply: bool,
23
24    /// Preview only; write nothing.
25    #[arg(long)]
26    pub dry_run: bool,
27
28    /// A path no delivered gate judges, recorded under `reserved:` in the
29    /// instance's declaration. Repeatable.
30    ///
31    /// Use it for a region another tool owns. Omitted, a recorded value
32    /// stays.
33    #[arg(long, value_name = "PATH")]
34    pub reserve: Vec<String>,
35
36    /// Where material that is not a statement yet is kept, as a path that may
37    /// leave the repository, or `none` to clear a recorded value. Omitted,
38    /// the recorded value stays.
39    #[arg(long, value_name = "PATH")]
40    pub docs_scratch: Option<String>,
41
42    /// Where the writing style comes from: `builtin` routes authors to
43    /// `sdd method writing-style`, `project:<PATH>` routes them to the
44    /// project's own document, and `none` installs no route and imposes no
45    /// conversion obligation. Recorded in the instance's declaration.
46    /// Omitted, the recorded value stays.
47    #[arg(long, value_name = "SELECTION")]
48    pub writing_style: Option<String>,
49}