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    /// Where material that is not a statement yet is kept, as a path that may
36    /// leave the repository, or `none` to clear a recorded value. Omitted,
37    /// the recorded value stays.
38    #[arg(long, value_name = "PATH")]
39    pub docs_scratch: Option<String>,
40}