feat: bring back -s option to specify sandbox permissions

This commit is contained in:
Michael Bolin
2025-04-29 16:18:57 -07:00
parent 0a00b5ed29
commit f5fa188cb0
13 changed files with 213 additions and 31 deletions
+4
View File
@@ -1,5 +1,6 @@
use clap::Parser;
use clap::ValueEnum;
use codex_core::SandboxPermissionOption;
use std::path::PathBuf;
#[derive(Parser, Debug)]
@@ -17,6 +18,9 @@ pub struct Cli {
#[arg(long = "full-auto", default_value_t = false)]
pub full_auto: bool,
#[clap(flatten)]
pub sandbox: SandboxPermissionOption,
/// Allow running Codex outside a Git repository.
#[arg(long = "skip-git-repo-check", default_value_t = false)]
pub skip_git_repo_check: bool,
+2 -1
View File
@@ -28,6 +28,7 @@ pub async fn run_main(cli: Cli) -> anyhow::Result<()> {
images,
model,
full_auto,
sandbox,
skip_git_repo_check,
disable_response_storage,
color,
@@ -65,7 +66,7 @@ pub async fn run_main(cli: Cli) -> anyhow::Result<()> {
let sandbox_policy = if full_auto {
Some(SandboxPolicy::new_full_auto_policy())
} else {
None
sandbox.permissions.clone().map(Into::into)
};
// Load configuration and determine approval policy