Skip to main content

spec_driven_docs/cli/
stage.rs

1//! `stage` subcommand: parse-shape.
2//!
3//! Holds the clap derive structs only. No I/O, no business logic.
4
5use camino::Utf8PathBuf;
6
7use crate::domain::profile::ProfileId;
8
9/// Render this binary's candidate into a stage an agent reads.
10#[derive(Debug, clap::Args)]
11pub struct StageArgs {
12    /// What to do. Rendering a stage is the default.
13    #[command(subcommand)]
14    pub command: Option<StageCommand>,
15
16    /// The repository to render a candidate for; absolute, or the working directory.
17    #[arg(long, default_value = ".")]
18    pub target: Utf8PathBuf,
19
20    /// The profile to project.
21    #[arg(long, value_enum, default_value_t = ProfileId::Codebase)]
22    pub profile: ProfileId,
23
24    /// Where to write the stage; absolute.
25    #[arg(long)]
26    pub output: Option<Utf8PathBuf>,
27
28    /// The documentation scratch the candidate would record, or `none`.
29    #[arg(long)]
30    pub docs_scratch: Option<String>,
31
32    /// A path to record under `reserved:` in the declaration. Repeatable.
33    #[arg(long)]
34    pub reserve: Vec<String>,
35
36    /// The writing-style selection the candidate would record.
37    #[arg(long)]
38    pub writing_style: Option<String>,
39
40    /// Print one JSON object instead of text.
41    #[arg(long)]
42    pub json: bool,
43}
44
45/// The verbs `sdd stage` offers beyond rendering one.
46#[derive(Debug, clap::Subcommand)]
47pub enum StageCommand {
48    /// Remove one stage this tool wrote.
49    Clean(StageCleanArgs),
50}
51
52/// Remove one stage this tool wrote.
53#[derive(Debug, clap::Args)]
54pub struct StageCleanArgs {
55    /// The stage directory to remove; absolute.
56    pub path: Utf8PathBuf,
57
58    /// Print one JSON object instead of text.
59    #[arg(long)]
60    pub json: bool,
61}