Initial upload with CI/CD workflow
Some checks failed
CI / build (push) Has been cancelled
CI / test (push) Has been cancelled

This commit is contained in:
2026-02-03 09:41:15 +00:00
parent 9f305c589e
commit 3f24d7f1ef

48
app/src/cli/mod.rs Normal file
View File

@@ -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<PathBuf>,
},
#[command(about = "Launch interactive TUI for command exploration")]
Interactive {
#[arg(help = "Optional command to start with")]
command: Option<String>,
},
#[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())
}
}