use clap::{Parser, ValueEnum};
use serde::Deserialize;
use std::path::PathBuf;
#[derive(Clone, Debug, ValueEnum, Deserialize, PartialEq)]
#[serde(rename_all = "lowercase")]
pub enum ProviderChoice {
Anthropic,
Openai,
Ollama,
Mock,
}
#[derive(Parser, Debug)]
#[command(
name = "tkmy",
version,
about = "Tokenectomy CLI 🕵️♂️ - AI-Powered Debugger & MCP Server",
after_help = "EXAMPLES:\n $ python3 app.py 2>&1 | tkmy\n $ tkmy --file error.log\n $ tkmy --local-only\n $ tkmy --mcp\n"
)]
pub struct Cli {
#[arg(short, long, help = "File to read error log from (reads from stdin if not provided)")]
pub file: Option<PathBuf>,
#[arg(short, long, help = "Context lines to extract above/below the error line")]
pub context_lines: Option<usize>,
#[arg(long, help = "Disable colored output")]
pub no_color: bool,
#[arg(long, help = "Run as an MCP Server (JSON-RPC over stdio)")]
pub mcp: bool,
#[arg(long, help = "Force using local provider (Ollama)")]
pub local_only: bool,
#[arg(short, long, help = "Skip security prompts (automatically approve)")]
pub yes: bool,
#[arg(long, help = "Maximum characters to extract for source code context")]
pub max_context_chars: Option<usize>,
#[arg(long, value_enum, help = "AI provider to use [possible values: anthropic, openai, ollama, mock]", hide_possible_values = true)]
pub provider: Option<ProviderChoice>,
}