1use anyhow::Result;
4use clap::{Parser, Subcommand};
5
6pub mod ai;
7pub mod commands;
8pub mod config;
9pub mod git;
10pub mod help;
11
12#[derive(Parser)]
14#[command(name = "omni-dev")]
15#[command(about = "A comprehensive development toolkit", long_about = None)]
16#[command(version)]
17pub struct Cli {
18 #[command(subcommand)]
20 pub command: Commands,
21}
22
23#[derive(Subcommand)]
25pub enum Commands {
26 Ai(ai::AiCommand),
28 Git(git::GitCommand),
30 Commands(commands::CommandsCommand),
32 Config(config::ConfigCommand),
34 #[command(name = "help-all")]
36 HelpAll(help::HelpCommand),
37}
38
39impl Cli {
40 pub async fn execute(self) -> Result<()> {
42 match self.command {
43 Commands::Ai(ai_cmd) => ai_cmd.execute().await,
44 Commands::Git(git_cmd) => git_cmd.execute().await,
45 Commands::Commands(commands_cmd) => commands_cmd.execute(),
46 Commands::Config(config_cmd) => config_cmd.execute(),
47 Commands::HelpAll(help_cmd) => help_cmd.execute(),
48 }
49 }
50}