feat: Added a --dangerously-skip-permissions flag to skip permission prompts for tool invocations
This commit is contained in:
@@ -91,6 +91,9 @@ pub struct Cli {
|
|||||||
/// Disable memory for this invocation
|
/// Disable memory for this invocation
|
||||||
#[arg(long)]
|
#[arg(long)]
|
||||||
pub no_memory: bool,
|
pub no_memory: bool,
|
||||||
|
/// Skip permission prompts by setting AUTO_CONFIRM for all tools (dangerous!)
|
||||||
|
#[arg(long)]
|
||||||
|
pub dangerously_skip_permissions: bool,
|
||||||
/// Bootstrap a memory marker so coyote begins loading memory next run
|
/// Bootstrap a memory marker so coyote begins loading memory next run
|
||||||
#[arg(long, value_name = "SCOPE", value_enum)]
|
#[arg(long, value_name = "SCOPE", value_enum)]
|
||||||
pub init_memory: Option<MemoryScope>,
|
pub init_memory: Option<MemoryScope>,
|
||||||
@@ -424,6 +427,18 @@ mod tests {
|
|||||||
assert!(cli.build_tools);
|
assert!(cli.build_tools);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn parse_dangerously_skip_permissions_flag() {
|
||||||
|
let cli = parse(&["--dangerously-skip-permissions"]);
|
||||||
|
assert!(cli.dangerously_skip_permissions);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn parse_dangerously_skip_permissions_default_off() {
|
||||||
|
let cli = parse(&[]);
|
||||||
|
assert!(!cli.dangerously_skip_permissions);
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn parse_sync_models_flag() {
|
fn parse_sync_models_flag() {
|
||||||
let cli = parse(&["--sync-models"]);
|
let cli = parse(&["--sync-models"]);
|
||||||
|
|||||||
@@ -56,6 +56,12 @@ async fn main() -> Result<()> {
|
|||||||
CompleteEnv::with_factory(Cli::command).complete();
|
CompleteEnv::with_factory(Cli::command).complete();
|
||||||
let cli = Cli::parse();
|
let cli = Cli::parse();
|
||||||
|
|
||||||
|
if cli.dangerously_skip_permissions {
|
||||||
|
unsafe {
|
||||||
|
env::set_var("AUTO_CONFIRM", "true");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if let Some(shell) = cli.completions {
|
if let Some(shell) = cli.completions {
|
||||||
let mut cmd = Cli::command();
|
let mut cmd = Cli::command();
|
||||||
shell.generate_completions(&mut cmd);
|
shell.generate_completions(&mut cmd);
|
||||||
|
|||||||
Reference in New Issue
Block a user