diff --git a/app/src/cli/mod.rs b/app/src/cli/mod.rs new file mode 100644 index 0000000..7ac2b74 --- /dev/null +++ b/app/src/cli/mod.rs @@ -0,0 +1,48 @@ +use clap::{Parser, Args, Subcommand}; +use std::path::PathBuf; + +#[derive(Parser, Debug)] +#[command(name = "tui-generator")] +#[command(author = "TUI Generator Contributors")] +#[command(version = "0.1.0")] +#[command(about = "Generate beautiful, interactive terminal user interfaces for CLI tools", long_about = None)] +pub struct Cli { + #[command(subcommand)] + pub command: Commands, +} + +#[derive(Subcommand, Debug)] +pub enum Commands { + #[command(about = "Generate TUI from a CLI command's help output")] + Generate { + #[arg(help = "The CLI command to parse (e.g., 'git', 'kubectl get')")] + command: String, + #[arg(short, long, help = "Output file path for the configuration")] + output: Option, + }, + #[command(about = "Launch interactive TUI for command exploration")] + Interactive { + #[arg(help = "Optional command to start with")] + command: Option, + }, + #[command(about = "Export parsed command configuration")] + Export { + #[arg(help = "The CLI command to export")] + command: String, + #[arg(help = "Output file path")] + output: PathBuf, + }, + #[command(about = "List saved configurations")] + List, + #[command(about = "Run a saved configuration")] + Run { + #[arg(help = "Name of the saved configuration")] + name: String, + }, +} + +impl Cli { + pub fn parse() -> Self { + Self::parse_from(std::env::args_os()) + } +}