pub enum BashCommandAction {
Command {
command: String,
is_background: bool,
allow_multi: bool,
},
StatusCheck {
status_check: bool,
bg_command_id: Option<String>,
scrollback_lines: Option<usize>,
verbose: bool,
},
SendText {
send_text: String,
bg_command_id: Option<String>,
submit: bool,
},
SendSpecials {
send_specials: Vec<SpecialKey>,
bg_command_id: Option<String>,
submit: bool,
},
SendAscii {
send_ascii: Vec<u8>,
bg_command_id: Option<String>,
submit: bool,
},
Screen {
screen: bool,
bg_command_id: Option<String>,
lines: Option<usize>,
diff: bool,
},
WaitForTurn {
wait_for_turn: bool,
bg_command_id: Option<String>,
recognizer: Option<String>,
quiet_ms: Option<u64>,
timeout_seconds: Option<f32>,
lines: Option<usize>,
wait_through_busy: bool,
},
}Expand description
Types of actions that can be performed with the BashCommand tool
Variants§
Command
Execute a shell command
Fields
allow_multi: boolOpt out of the single-top-level-statement guard. By default winx
rejects multi-statement commands (a; b, a && b; c, etc.) so the
agent has to be explicit about what it’s running. Set this to true
when you knowingly want to run a composite command without
wrapping it in bash -lc '...'.
StatusCheck
Check the status of a running command.
By default returns only what changed since the previous call — agents
driving long-lived TUIs do not need the cumulative buffer on every poll.
Set verbose: true to receive a fresh snapshot regardless of the dedup
hash, or scrollback_lines: Some(N) to also pull the last N lines from
the PTY ringbuffer.
Fields
SendText
Send text to a running command. Set submit to true to append a carriage
return after the bytes so the target program receives the input as a
completed line (matches what hitting Enter would do in a TUI).
Fields
SendSpecials
Send special keys to a running command. submit works the same as in
SendText.
SendAscii
Send ASCII characters to a running command. submit works the same as in
SendText.
Screen
Snapshot the live, stable screen of a shell’s terminal: the consolidated
view a human would see right now (cursor moves, redraws, alternate-screen
and synchronized-output already applied), ANSI stripped. Unlike
status_check, it never stacks redraw generations and never waits — a
point-in-time photo, ideal for reading an interactive TUI’s current frame
(the claude CLI, vim, htop, fzf).
Fields
WaitForTurn
Block until an interactive TUI finishes its turn and is ready for input.
Combines generic quiescence (the screen stopped changing for quiet_ms)
with a per-app recognizer, then returns the stable snapshot plus the
detected turn state (busy / awaiting_input / awaiting_approval).
Fields
recognizer: Option<String>Recognizer hint: auto (default, claude+codex), generic, or any
bundled agent-manifest id/alias — claude, codex, gemini,
antigravity (aka agy), cursor, opencode, copilot, grok,
amp, droid, kimi, pi, qwen, and more.
quiet_ms: Option<u64>Quiet window in ms — the screen must be unchanged this long to count as idle (default 600).
wait_through_busy: boolBy default wait_for_turn returns as soon as it confirms the app is
actively working (busy), instead of blocking until the turn ends or
timeout_seconds elapses — so a long-running child never pins the
caller for the whole cap (poll again to keep watching). Set this to
true for the old behavior: block through busy until the app is
ready for input (or the timeout fires).
Trait Implementations§
Source§impl Clone for BashCommandAction
impl Clone for BashCommandAction
Source§impl Debug for BashCommandAction
impl Debug for BashCommandAction
Source§impl<'de> Deserialize<'de> for BashCommandAction
impl<'de> Deserialize<'de> for BashCommandAction
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for BashCommandAction
impl JsonSchema for BashCommandAction
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreAuto Trait Implementations§
impl Freeze for BashCommandAction
impl RefUnwindSafe for BashCommandAction
impl Send for BashCommandAction
impl Sync for BashCommandAction
impl Unpin for BashCommandAction
impl UnsafeUnpin for BashCommandAction
impl UnwindSafe for BashCommandAction
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<T> ErasedDestructor for Twhere
T: 'static,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more