miyabi_cli/
error.rs

1//! CLI error types
2
3use thiserror::Error;
4
5#[derive(Debug, Error)]
6pub enum CliError {
7    #[error("Invalid project name: {0}")]
8    InvalidProjectName(String),
9
10    #[error("Project directory already exists: {0}")]
11    ProjectExists(String),
12
13    #[error("Not in a git repository")]
14    NotGitRepository,
15
16    #[error("GitHub token not found. Set GITHUB_TOKEN environment variable")]
17    MissingGitHubToken,
18
19    #[error("Invalid agent type: {0}")]
20    InvalidAgentType(String),
21
22    #[error("Issue number required for agent execution")]
23    MissingIssueNumber,
24
25    #[error("Git configuration error: {0}")]
26    GitConfig(String),
27
28    #[error("Miyabi error: {0}")]
29    Miyabi(#[from] miyabi_types::error::MiyabiError),
30
31    #[error("IO error: {0}")]
32    Io(#[from] std::io::Error),
33
34    #[error("JSON error: {0}")]
35    Json(#[from] serde_json::Error),
36}
37
38pub type Result<T> = std::result::Result<T, CliError>;