Skip to main content

CommandRunner

Trait CommandRunner 

Source
pub trait CommandRunner: Send + Sync {
    // Required methods
    fn run_claude(
        &self,
        prompt: &str,
        allowed_tools: &[String],
        working_dir: &Path,
        max_turns: Option<u32>,
        model: Option<String>,
    ) -> 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§

Source

fn run_claude( &self, prompt: &str, allowed_tools: &[String], working_dir: &Path, max_turns: Option<u32>, model: Option<String>, ) -> impl Future<Output = Result<AgentResult>> + Send

Source

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.

Implementors§