Skip to main content

apr_cli/
pipeline_commands.rs

1
2/// ALB-028: Pipeline orchestration subcommands — wraps forjar DAG engine.
3///
4/// `apr pipeline plan/apply/status/validate` maps to forjar commands,
5/// keeping sovereign stack tools decoupled.
6#[derive(Subcommand, Debug)]
7pub enum PipelineCommands {
8    /// Show execution plan — validate manifest, display DAG and resource estimates.
9    Plan {
10        /// Path to forjar pipeline manifest (YAML)
11        #[arg(value_name = "MANIFEST")]
12        manifest: PathBuf,
13
14        /// Target specific machine
15        #[arg(short, long)]
16        machine: Option<String>,
17
18        /// Filter to resources with this tag
19        #[arg(short, long)]
20        tag: Option<String>,
21
22        /// Show estimated change cost per resource type
23        #[arg(long)]
24        cost: bool,
25    },
26
27    /// Execute the pipeline — converge all resources to desired state.
28    Apply {
29        /// Path to forjar pipeline manifest (YAML)
30        #[arg(value_name = "MANIFEST")]
31        manifest: PathBuf,
32
33        /// Target specific machine
34        #[arg(short, long)]
35        machine: Option<String>,
36
37        /// Filter to resources with this tag
38        #[arg(short, long)]
39        tag: Option<String>,
40
41        /// Number of parallel SSH sessions (default: 5)
42        #[arg(short, long)]
43        parallel: Option<u32>,
44
45        /// Continue past failures (best-effort mode)
46        #[arg(long)]
47        keep_going: bool,
48    },
49
50    /// Show current pipeline state — converged, pending, or failed resources.
51    Status {
52        /// Path to forjar pipeline manifest (YAML)
53        #[arg(value_name = "MANIFEST")]
54        manifest: PathBuf,
55    },
56
57    /// Validate pipeline manifest without connecting to machines.
58    Validate {
59        /// Path to forjar pipeline manifest (YAML)
60        #[arg(value_name = "MANIFEST")]
61        manifest: PathBuf,
62    },
63}