omni_dev/cli/
mod.rs

1//! CLI interface for omni-dev
2
3use anyhow::Result;
4use clap::{Parser, Subcommand};
5
6pub mod commands;
7pub mod config;
8pub mod git;
9pub mod help;
10
11/// omni-dev: A comprehensive development toolkit
12#[derive(Parser)]
13#[command(name = "omni-dev")]
14#[command(about = "A comprehensive development toolkit", long_about = None)]
15#[command(version)]
16pub struct Cli {
17    /// The main command to execute
18    #[command(subcommand)]
19    pub command: Commands,
20}
21
22/// Main command categories
23#[derive(Subcommand)]
24pub enum Commands {
25    /// Git-related operations
26    Git(git::GitCommand),
27    /// Command template management
28    Commands(commands::CommandsCommand),
29    /// Configuration and model information
30    Config(config::ConfigCommand),
31    /// Display comprehensive help for all commands
32    #[command(name = "help-all")]
33    HelpAll(help::HelpCommand),
34}
35
36impl Cli {
37    /// Execute the CLI command
38    pub fn execute(self) -> Result<()> {
39        match self.command {
40            Commands::Git(git_cmd) => git_cmd.execute(),
41            Commands::Commands(commands_cmd) => commands_cmd.execute(),
42            Commands::Config(config_cmd) => config_cmd.execute(),
43            Commands::HelpAll(help_cmd) => help_cmd.execute(),
44        }
45    }
46}