pub trait CommandRunner: Send + Sync {
// Required methods
fn run_claude(
&self,
prompt: &str,
allowed_tools: &[String],
working_dir: &Path,
max_turns: Option<u32>,
) -> impl Future<Output = Result<AgentResult>> + Send;
fn run_gh(
&self,
args: &[String],
working_dir: &Path,
) -> impl Future<Output = Result<CommandOutput>> + Send;
}Expand description
Trait for running external commands.
Enables mocking in tests so we never call real CLIs.
Uses String slices rather than &str slices for mockall compatibility.
Required Methods§
fn run_claude( &self, prompt: &str, allowed_tools: &[String], working_dir: &Path, max_turns: Option<u32>, ) -> impl Future<Output = Result<AgentResult>> + Send
fn run_gh( &self, args: &[String], working_dir: &Path, ) -> impl Future<Output = Result<CommandOutput>> + Send
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.