claude_wrapper/command/mod.rs
1pub mod agents;
2pub mod auth;
3pub mod doctor;
4pub mod marketplace;
5pub mod mcp;
6pub mod plugin;
7pub mod query;
8pub mod raw;
9pub mod version;
10
11use std::future::Future;
12
13use crate::Claude;
14use crate::error::Result;
15
16/// Trait implemented by all claude CLI command builders.
17///
18/// Each command defines its own `Output` type and builds its argument
19/// list via `args()`. Execution is dispatched through the shared `Claude`
20/// client which provides binary path, environment, and timeout config.
21pub trait ClaudeCommand: Send + Sync {
22 /// The typed result of executing this command.
23 type Output: Send;
24
25 /// Build the CLI argument list for this command.
26 fn args(&self) -> Vec<String>;
27
28 /// Execute the command using the given claude client.
29 fn execute(&self, claude: &Claude) -> impl Future<Output = Result<Self::Output>> + Send;
30}