mod config;
mod mcp;
pub mod memory;
pub mod oauth_defaults;
mod pairing;
pub mod status;
mod tool;
pub use config::{ConfigCommand, run_config_command};
pub use mcp::{McpCommand, run_mcp_command};
pub use memory::MemoryCommand;
#[cfg(feature = "postgres")]
pub use memory::run_memory_command;
pub use memory::run_memory_command_with_db;
pub use pairing::{PairingCommand, run_pairing_command, run_pairing_command_with_store};
pub use status::run_status_command;
pub use tool::{ToolCommand, run_tool_command};
use clap::{Parser, Subcommand};
#[derive(Parser, Debug)]
#[command(name = "ironclaw")]
#[command(
about = "Secure personal AI assistant that protects your data and expands its capabilities"
)]
#[command(version)]
pub struct Cli {
#[command(subcommand)]
pub command: Option<Command>,
#[arg(long, global = true)]
pub cli_only: bool,
#[arg(long, global = true)]
pub no_db: bool,
#[arg(short, long, global = true)]
pub message: Option<String>,
#[arg(short, long, global = true)]
pub config: Option<std::path::PathBuf>,
#[arg(long, global = true)]
pub no_onboard: bool,
}
#[derive(Subcommand, Debug)]
pub enum Command {
Run,
Onboard {
#[arg(long)]
skip_auth: bool,
#[arg(long)]
channels_only: bool,
},
#[command(subcommand)]
Config(ConfigCommand),
#[command(subcommand)]
Tool(ToolCommand),
#[command(subcommand)]
Mcp(McpCommand),
#[command(subcommand)]
Memory(MemoryCommand),
#[command(subcommand)]
Pairing(PairingCommand),
Status,
Worker {
#[arg(long)]
job_id: uuid::Uuid,
#[arg(long, default_value = "http://host.docker.internal:50051")]
orchestrator_url: String,
#[arg(long, default_value = "50")]
max_iterations: u32,
},
ClaudeBridge {
#[arg(long)]
job_id: uuid::Uuid,
#[arg(long, default_value = "http://host.docker.internal:50051")]
orchestrator_url: String,
#[arg(long, default_value = "50")]
max_turns: u32,
#[arg(long, default_value = "sonnet")]
model: String,
},
}
impl Cli {
pub fn should_run_agent(&self) -> bool {
matches!(self.command, None | Some(Command::Run))
}
}