Skip to main content

omni_dev/cli/
ai.rs

1//! AI commands.
2
3mod chat;
4mod claude;
5pub(crate) mod jev;
6
7pub use chat::{run_chat, ChatCommand};
8pub use claude::skills::{run_clean, run_status, run_sync, OutputFormat, SkillsFormat};
9
10use anyhow::Result;
11use clap::{Parser, Subcommand};
12
13/// AI operations.
14#[derive(Parser)]
15pub struct AiCommand {
16    /// The AI subcommand to execute.
17    #[command(subcommand)]
18    pub command: AiSubcommands,
19}
20
21/// AI subcommands.
22#[derive(Subcommand)]
23pub enum AiSubcommands {
24    /// Interactive AI chat session.
25    Chat(ChatCommand),
26    /// Claude Code diagnostics and inspection.
27    Claude(claude::ClaudeCommand),
28    /// TypeSafe Jev typed judgments (choice, score, yes/no).
29    Jev(jev::JevCommand),
30}
31
32impl AiCommand {
33    /// Executes the AI command.
34    pub async fn execute(self) -> Result<()> {
35        match self.command {
36            AiSubcommands::Chat(cmd) => cmd.execute().await,
37            AiSubcommands::Claude(cmd) => cmd.execute(),
38            AiSubcommands::Jev(cmd) => cmd.execute().await,
39        }
40    }
41}