feat: load defaults into Config and introduce ConfigOverrides

This commit is contained in:
Michael Bolin
2025-04-25 19:34:19 -07:00
parent b0ba65a936
commit 70097dbaa1
17 changed files with 147 additions and 106 deletions
+5 -4
View File
@@ -18,14 +18,15 @@ pub struct Cli {
pub model: Option<String>,
/// Configure when the model requires human approval before executing a command.
#[arg(long = "ask-for-approval", short = 'a', value_enum, default_value_t = ApprovalModeCliArg::OnFailure)]
pub approval_policy: ApprovalModeCliArg,
/// Overrides the value in ~/.codex/config.toml if provided.
#[arg(long = "ask-for-approval", short = 'a', value_enum)]
pub approval_policy: Option<ApprovalModeCliArg>,
/// Configure the process restrictions when a command is executed.
///
/// Uses OS-specific sandboxing tools; Seatbelt on OSX, landlock+seccomp on Linux.
#[arg(long = "sandbox", short = 's', value_enum, default_value_t = SandboxModeCliArg::NetworkAndFileWriteRestricted)]
pub sandbox_policy: SandboxModeCliArg,
#[arg(long = "sandbox", short = 's')]
pub sandbox_policy: Option<SandboxModeCliArg>,
/// Allow running Codex outside a Git repository.
#[arg(long = "skip-git-repo-check", default_value_t = false)]