1use std::fmt::Display;
2use std::io;
3
4#[derive(Debug)]
5pub enum CliError {
6 NoPrompt,
7 ConflictingArgs(String),
8 ModelError(String),
9 McpError(String),
10 IoError(io::Error),
11 AgentError(String),
12}
13
14impl Display for CliError {
15 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
16 match self {
17 Self::NoPrompt => write!(f, "No prompt provided. Pass a prompt as an argument or pipe via stdin."),
18 Self::ConflictingArgs(e) => write!(f, "{e}"),
19 Self::ModelError(e) => write!(f, "Model error: {e}"),
20 Self::McpError(e) => write!(f, "MCP error: {e}"),
21 Self::IoError(e) => write!(f, "IO error: {e}"),
22 Self::AgentError(e) => write!(f, "Agent error: {e}"),
23 }
24 }
25}
26
27impl std::error::Error for CliError {}