feat: add --headless flag for unattended operation
This commit is contained in:
@@ -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"]);
|
||||
|
||||
Reference in New Issue
Block a user