pub struct ClaudeCliBuilder { /* private fields */ }Expand description
Builder for creating Claude CLI commands in JSON streaming mode
This builder automatically configures Claude to use:
--printmode for non-interactive operation--output-format stream-jsonfor streaming JSON responses--input-format stream-jsonfor JSON input--replay-user-messagesto echo back user messages
Implementations§
Source§impl ClaudeCliBuilder
impl ClaudeCliBuilder
Sourcepub fn debug<S: Into<String>>(self, filter: Option<S>) -> Self
pub fn debug<S: Into<String>>(self, filter: Option<S>) -> Self
Enable debug mode with optional filter
Sourcepub fn dangerously_skip_permissions(self, skip: bool) -> Self
pub fn dangerously_skip_permissions(self, skip: bool) -> Self
Skip all permission checks (dangerous!)
Sourcepub fn allowed_tools<I, S>(self, tools: I) -> Self
pub fn allowed_tools<I, S>(self, tools: I) -> Self
Add allowed tools
Sourcepub fn disallowed_tools<I, S>(self, tools: I) -> Self
pub fn disallowed_tools<I, S>(self, tools: I) -> Self
Add disallowed tools
Sourcepub fn mcp_config<I, S>(self, configs: I) -> Self
pub fn mcp_config<I, S>(self, configs: I) -> Self
Add MCP configuration
Sourcepub fn append_system_prompt<S: Into<String>>(self, prompt: S) -> Self
pub fn append_system_prompt<S: Into<String>>(self, prompt: S) -> Self
Append a system prompt
Sourcepub fn permission_mode(self, mode: PermissionMode) -> Self
pub fn permission_mode(self, mode: PermissionMode) -> Self
Set permission mode
Sourcepub fn continue_conversation(self, continue_conv: bool) -> Self
pub fn continue_conversation(self, continue_conv: bool) -> Self
Continue the most recent conversation
Sourcepub fn resume<S: Into<String>>(self, session_id: Option<S>) -> Self
pub fn resume<S: Into<String>>(self, session_id: Option<S>) -> Self
Resume a specific conversation
Sourcepub fn fallback_model<S: Into<String>>(self, model: S) -> Self
pub fn fallback_model<S: Into<String>>(self, model: S) -> Self
Set fallback model for overload situations
Sourcepub fn add_directories<I, P>(self, dirs: I) -> Self
pub fn add_directories<I, P>(self, dirs: I) -> Self
Add directories for tool access
Sourcepub fn strict_mcp_config(self, strict: bool) -> Self
pub fn strict_mcp_config(self, strict: bool) -> Self
Use only MCP servers from config
Sourcepub fn session_id<S: Into<String>>(self, id: S) -> Self
pub fn session_id<S: Into<String>>(self, id: S) -> Self
Set a specific session ID
Sourcepub fn build_command(self) -> Command
pub fn build_command(self) -> Command
Build a Command without spawning (for testing or manual execution)
Trait Implementations§
Source§impl Clone for ClaudeCliBuilder
impl Clone for ClaudeCliBuilder
Source§fn clone(&self) -> ClaudeCliBuilder
fn clone(&self) -> ClaudeCliBuilder
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ClaudeCliBuilder
impl Debug for ClaudeCliBuilder
Auto Trait Implementations§
impl Freeze for ClaudeCliBuilder
impl RefUnwindSafe for ClaudeCliBuilder
impl Send for ClaudeCliBuilder
impl Sync for ClaudeCliBuilder
impl Unpin for ClaudeCliBuilder
impl UnwindSafe for ClaudeCliBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more