feat: add --headless flag for unattended operation

This commit is contained in:
2026-07-27 17:17:56 -06:00
parent af5c34fde5
commit f1415067f2
5 changed files with 162 additions and 1 deletions
+15
View File
@@ -230,6 +230,10 @@ pub struct Cli {
/// Start the sandbox with a clean slate. No copied config or tokens; LLM credentials injected via sbx proxy
#[arg(long, requires = "sandbox", help_heading = "Sandbox")]
pub fresh: bool,
/// Declare that no human is present. All user-interaction tools return structured JSON instead of
/// prompting. Implies --dangerously-skip-permissions. Incompatible with REPL mode (requires a prompt).
#[arg(long, help_heading = "Sandbox")]
pub headless: bool,
/// Display information
#[arg(long, help_heading = "Diagnostics & Tools")]
pub info: bool,
@@ -490,6 +494,17 @@ mod tests {
assert!(!cli.dangerously_skip_permissions);
}
#[test]
fn parse_headless_flag() {
let cli = parse(&["--headless", "do something"]);
assert!(cli.headless);
}
#[test]
fn parse_headless_default_off() {
assert!(!parse(&[]).headless);
}
#[test]
fn parse_sync_models_flag() {
let cli = parse(&["--sync-models"]);