1use crate::resolve::AgentSelectionError;
2use crate::runtime::RuntimeError;
3use aether_auth::OAuthError;
4use aether_core::mcp::ParseError;
5use aether_project::SettingsError;
6use aether_telemetry::TelemetryInitError;
7use std::io;
8use thiserror::Error;
9
10#[derive(Debug, Error)]
11pub enum CliError {
12 #[error("No prompt provided. Pass a prompt as an argument or pipe via stdin.")]
13 NoPrompt,
14 #[error("{0}")]
15 ConflictingArgs(String),
16 #[error("Invalid --options-json: {0}")]
17 InvalidOptionsJson(#[source] serde_json::Error),
18 #[error(transparent)]
19 ConflictingSettingsSources(#[from] crate::settings_args::ConflictingSettingsSources),
20 #[error("Failed to load settings: {0}")]
21 Settings(#[from] SettingsError),
22 #[error("Failed to initialize telemetry: {0}")]
23 Telemetry(#[from] TelemetryInitError),
24 #[error(transparent)]
25 AgentSelection(#[from] AgentSelectionError),
26 #[error("Invalid MCP config: {0}")]
27 McpConfig(#[from] ParseError),
28 #[error(transparent)]
29 Runtime(#[from] RuntimeError),
30 #[error("IO error: {0}")]
31 IoError(#[from] io::Error),
32 #[error("Agent stopped before receiving the prompt")]
33 AgentStopped,
34 #[error("Credential store error: {0}")]
35 CredentialStore(#[from] OAuthError),
36}