pub mod config;
pub mod mode;
pub mod local;
use clap::Subcommand;
#[derive(Subcommand)]
pub enum Commands {
Config {
#[command(subcommand)]
command: config::Commands,
},
Mode {
#[command(subcommand)]
command: mode::Commands,
},
Local {
#[command(subcommand)]
command: local::Commands,
},
GenerateSecretSignaturePair,
}
impl Commands {
pub async fn handle(self, cli_config: &crate::Config, handle: &objectiveai_cli_sdk::output::Handle) -> Result<(), crate::error::Error> {
match self {
Commands::Config { command } => command.handle(cli_config, handle).await,
Commands::Mode { command } => command.handle(cli_config, handle).await,
Commands::Local { command } => command.handle(cli_config, handle).await,
Commands::GenerateSecretSignaturePair => {
let pair = objectiveai_sdk::filesystem::config::generate_viewer_secret_signature_pair();
crate::config::emit_value(&pair, handle).await;
Ok(())
}
}
}
}