Skip to main content

SessionConfig

Struct SessionConfig 

Source
pub struct SessionConfig {
Show 33 fields pub query: String, pub resume_session_id: Option<String>, pub explicit_session_id: Option<String>, pub continue_last_session: bool, pub fork_session: bool, pub model: Option<Model>, pub fallback_model: Option<Model>, pub output_format: OutputFormat, pub input_format: Option<InputFormat>, pub mcp_config: Option<MCPConfig>, pub strict_mcp_config: bool, pub permission_mode: Option<PermissionMode>, pub dangerously_skip_permissions: bool, pub allow_dangerously_skip_permissions: bool, pub system_prompt: Option<String>, pub append_system_prompt: Option<String>, pub tools: Option<Vec<String>>, pub allowed_tools: Option<Vec<String>>, pub disallowed_tools: Option<Vec<String>>, pub json_schema: Option<String>, pub include_partial_messages: bool, pub replay_user_messages: bool, pub settings: Option<String>, pub setting_sources: Option<Vec<String>>, pub additional_dirs: Vec<PathBuf>, pub plugin_dirs: Vec<PathBuf>, pub ide: bool, pub agents: Option<String>, pub debug: bool, pub debug_filter: Option<String>, pub working_dir: Option<PathBuf>, pub env: Option<HashMap<String, String>>, pub verbose: bool,
}
Expand description

Configuration for a Claude CLI session

Fields§

§query: String

The query/prompt to send to Claude

§resume_session_id: Option<String>

Resume a specific session (maps to –resume)

§explicit_session_id: Option<String>

Use a specific session ID (maps to –session-id)

§continue_last_session: bool

Continue the last session (maps to –continue)

§fork_session: bool

Fork an existing session (maps to –fork-session)

§model: Option<Model>

Primary model to use

§fallback_model: Option<Model>

Fallback model if primary is unavailable (maps to –fallback-model)

§output_format: OutputFormat

Output format (maps to –output-format)

§input_format: Option<InputFormat>

Input format (maps to –input-format)

§mcp_config: Option<MCPConfig>

MCP server configuration (maps to –mcp-config)

§strict_mcp_config: bool

Strict MCP config validation (maps to –strict-mcp-config)

§permission_mode: Option<PermissionMode>

Permission mode (maps to –permission-mode)

§dangerously_skip_permissions: bool

Skip permission checks dangerously (maps to –dangerously-skip-permissions)

§allow_dangerously_skip_permissions: bool

Allow dangerous permission skipping (maps to –allow-dangerously-skip-permissions)

§system_prompt: Option<String>

System prompt override (maps to –system-prompt)

§append_system_prompt: Option<String>

Append to system prompt (maps to –append-system-prompt)

§tools: Option<Vec<String>>

Specific tools to enable (maps to –tools)

§allowed_tools: Option<Vec<String>>

Tools to allow (maps to –allowedTools)

§disallowed_tools: Option<Vec<String>>

Tools to disallow (maps to –disallowedTools)

§json_schema: Option<String>

JSON schema for structured output (maps to –json-schema)

§include_partial_messages: bool

Include partial messages in stream (maps to –include-partial-messages)

§replay_user_messages: bool

Replay user messages (maps to –replay-user-messages)

§settings: Option<String>

Settings JSON (maps to –settings)

§setting_sources: Option<Vec<String>>

Setting sources (maps to –setting-sources)

§additional_dirs: Vec<PathBuf>

Additional directories to add to context (maps to –add-dir, repeatable)

§plugin_dirs: Vec<PathBuf>

Plugin directories (maps to –plugin-dir, repeatable)

§ide: bool

IDE mode (maps to –ide)

§agents: Option<String>

Agents configuration JSON (maps to –agents)

§debug: bool

Enable debug mode (maps to –debug)

§debug_filter: Option<String>

Debug filter pattern

§working_dir: Option<PathBuf>

Working directory for the Claude process

§env: Option<HashMap<String, String>>

Environment variables to inject into the Claude process

§verbose: bool

Enable verbose output

Implementations§

Trait Implementations§

Source§

impl Clone for SessionConfig

Source§

fn clone(&self) -> SessionConfig

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SessionConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for SessionConfig

Source§

fn default() -> SessionConfig

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more