pub struct ApplyFlagSettingsRequest {
pub settings: Map<String, Value>,
}Expand description
Body of an apply_flag_settings control request.
The CLI merges settings into its flag-settings layer (the layer
--settings writes) and updates the active configuration; a key set to
null is removed from that layer. The CLI acknowledges with a
control_response for the same request_id, or an error response if a
value is rejected.
settings is an open map, so keys this crate has no setter for (and keys
added by newer CLIs) can still be sent with set and survive
a round trip. Typed setters cover the per-session effort controls:
use claude_codes::{ApplyFlagSettingsRequest, EffortLevel};
let req = ApplyFlagSettingsRequest::new()
.effort_level(EffortLevel::Xhigh)
.ultracode(false);
assert_eq!(req.get_effort_level(), Some(EffortLevel::Xhigh));
assert_eq!(
serde_json::to_value(&req).unwrap(),
serde_json::json!({"settings": {"effortLevel": "xhigh", "ultracode": false}})
);A remote-control bridge applies only effortLevel and ultracode and
errors when neither is present; a local CLI accepts other settings keys
too.
Fields§
§settings: Map<String, Value>Settings keys (camelCase, as in settings.json) to merge.
Implementations§
Source§impl ApplyFlagSettingsRequest
impl ApplyFlagSettingsRequest
Sourcepub fn effort_level(self, level: EffortLevel) -> Self
pub fn effort_level(self, level: EffortLevel) -> Self
Set effortLevel, the session’s effort level.
Sourcepub fn clear_effort_level(self) -> Self
pub fn clear_effort_level(self) -> Self
Clear effortLevel from the flag layer (sends null), so the
effort falls back to the lower settings layers / model default.
Sourcepub fn ultracode(self, on: bool) -> Self
pub fn ultracode(self, on: bool) -> Self
Set ultracode: standing dynamic-workflow orchestration for the
session, independent of the effort level.
Sourcepub fn set(self, key: impl Into<String>, value: Value) -> Self
pub fn set(self, key: impl Into<String>, value: Value) -> Self
Set any settings key to a raw JSON value (Value::Null clears it).
Sourcepub fn get_effort_level(&self) -> Option<EffortLevel>
pub fn get_effort_level(&self) -> Option<EffortLevel>
The effortLevel being set, if any (None when absent or cleared).
Sourcepub fn get_ultracode(&self) -> Option<bool>
pub fn get_ultracode(&self) -> Option<bool>
The ultracode value being set, if any.