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    /// Where the planning tool writes entry documents: a repository-relative
29    /// path, `untracked:<PATH>`, `env`, or `none`. Write `./none` or `./env`
30    /// for a directory carrying either name. Omitted, the recorded value
31    /// stays.
32    #[arg(long, value_name = "VALUE")]
33    pub plan_zone: Option<String>,
34
35    /// A path no delivered gate judges, recorded under `reserved:` in the
36    /// instance's declaration. Repeatable.
37    ///
38    /// Use it for a region another tool owns. Omitted, a recorded value
39    /// stays.
40    #[arg(long, value_name = "PATH")]
41    pub reserve: Vec<String>,
42
43    /// Where material that is not a statement yet is kept, as a path that may
44    /// leave the repository, or `none` to clear a recorded value. Omitted,
45    /// the recorded value stays.
46    #[arg(long, value_name = "PATH")]
47    pub docs_scratch: Option<String>,
48
49    /// Where the writing style comes from: `builtin` routes authors to
50    /// `sdd method writing-style`, `project:<PATH>` routes them to the
51    /// project's own document, and `none` installs no route and imposes no
52    /// conversion obligation. Recorded in the instance's declaration.
53    /// Omitted, the recorded value stays.
54    #[arg(long, value_name = "SELECTION")]
55    pub writing_style: Option<String>,
56}