pub struct RunOptions {Show 16 fields
pub cli: Option<CliName>,
pub task: String,
pub system_prompt: Option<String>,
pub system_prompt_file: Option<String>,
pub mcp_servers: Option<HashMap<String, McpServer>>,
pub cwd: Option<String>,
pub model: Option<String>,
pub idle_timeout_ms: Option<u64>,
pub total_timeout_ms: Option<u64>,
pub max_consecutive_tool_failures: Option<u32>,
pub env: Option<HashMap<String, String>>,
pub executable_path: Option<String>,
pub resume_session_id: Option<String>,
pub max_output_bytes: Option<usize>,
pub skip_permissions: bool,
pub providers: Option<ProviderOptions>,
}Expand description
Options passed to run().
Fields§
§cli: Option<CliName>Which CLI to use. If None, auto-discovers the first available.
task: StringThe task/prompt to send to the agent.
system_prompt: Option<String>System prompt (where supported).
system_prompt_file: Option<String>Path to a system prompt file (alternative to inline system_prompt).
mcp_servers: Option<HashMap<String, McpServer>>MCP servers to connect.
cwd: Option<String>Working directory for the CLI process.
model: Option<String>Model name (e.g. “sonnet”, “opus”, “o3”).
idle_timeout_ms: Option<u64>Idle timeout in milliseconds. Default: 300_000 (5 minutes).
total_timeout_ms: Option<u64>Total timeout in milliseconds. No default.
max_consecutive_tool_failures: Option<u32>Max consecutive tool failures before aborting. Default: 3.
env: Option<HashMap<String, String>>Extra environment variables for the CLI process.
executable_path: Option<String>Explicit path to the CLI executable (skips discovery).
resume_session_id: Option<String>Session ID to resume a previous conversation.
max_output_bytes: Option<usize>Maximum bytes to buffer from CLI stdout before aborting.
Prevents OOM if the CLI produces unexpectedly large output.
Defaults to 10 MB when None.
skip_permissions: boolSkip permission prompts and run in fully autonomous mode.
When true, passes provider-specific flags to bypass interactive approval
(e.g. --dangerously-skip-permissions for Claude). Use with caution —
the agent will be able to execute tools without human confirmation.
Defaults to false.
providers: Option<ProviderOptions>Provider-specific options.
Trait Implementations§
Source§impl Clone for RunOptions
impl Clone for RunOptions
Source§fn clone(&self) -> RunOptions
fn clone(&self) -> RunOptions
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more