1use std::{ffi::OsString, path::PathBuf};
2
3use crate::secrets_cli::SecretsCommand;
4use clap::{Args, Parser, Subcommand};
5
6#[derive(Parser, Debug)]
7#[command(name = "greentic-dev")]
8#[command(version)]
9#[command(about = "Greentic developer tooling CLI")]
10pub struct Cli {
11 #[command(subcommand)]
12 pub command: Command,
13}
14
15#[derive(Subcommand, Debug)]
16pub enum Command {
17 Flow(PassthroughArgs),
19 Pack(PassthroughArgs),
21 Component(PassthroughArgs),
23 #[command(subcommand)]
25 Config(ConfigCommand),
26 #[command(subcommand)]
28 Mcp(McpCommand),
29 Gui(PassthroughArgs),
31 #[command(subcommand)]
33 Secrets(SecretsCommand),
34 Cbor(CborArgs),
36}
37
38#[derive(Args, Debug, Clone)]
39#[command(disable_help_flag = true)]
40pub struct PassthroughArgs {
41 #[arg(
43 value_name = "ARGS",
44 trailing_var_arg = true,
45 allow_hyphen_values = true
46 )]
47 pub args: Vec<OsString>,
48}
49
50#[derive(Subcommand, Debug)]
51pub enum McpCommand {
52 Doctor(McpDoctorArgs),
54}
55
56#[derive(Args, Debug)]
57pub struct McpDoctorArgs {
58 pub provider: String,
60 #[arg(long = "json")]
62 pub json: bool,
63}
64
65#[derive(Subcommand, Debug)]
66pub enum ConfigCommand {
67 Set(ConfigSetArgs),
69}
70
71#[derive(Args, Debug)]
72pub struct ConfigSetArgs {
73 pub key: String,
75 pub value: String,
77 #[arg(long = "file")]
79 pub file: Option<PathBuf>,
80}
81
82#[derive(Args, Debug)]
83pub struct CborArgs {
84 #[arg(value_name = "PATH")]
86 pub path: PathBuf,
87}