mirror of
https://github.com/openai/codex.git
synced 2026-04-24 14:45:27 +00:00
40 lines
1.3 KiB
Rust
40 lines
1.3 KiB
Rust
use clap::Parser;
|
||
use codex_common::ApprovalModeCliArg;
|
||
use codex_common::CliConfigOverrides;
|
||
use codex_common::CommonCli;
|
||
|
||
#[derive(Parser, Debug)]
|
||
#[command(version)]
|
||
pub struct Cli {
|
||
#[clap(flatten)]
|
||
pub common: CommonCli,
|
||
|
||
/// Optional user prompt to start the session.
|
||
#[arg(value_name = "PROMPT", value_hint = clap::ValueHint::Other)]
|
||
pub prompt: Option<String>,
|
||
|
||
// Internal controls set by the top-level `codex resume` subcommand.
|
||
// These are not exposed as user flags on the base `codex` command.
|
||
#[clap(skip)]
|
||
pub resume_picker: bool,
|
||
|
||
#[clap(skip)]
|
||
pub resume_last: bool,
|
||
|
||
/// Internal: resume a specific recorded session by id (UUID). Set by the
|
||
/// top-level `codex resume <SESSION_ID>` wrapper; not exposed as a public flag.
|
||
#[clap(skip)]
|
||
pub resume_session_id: Option<String>,
|
||
|
||
/// Configure when the model requires human approval before executing a command.
|
||
#[arg(long = "ask-for-approval", short = 'a')]
|
||
pub approval_policy: Option<ApprovalModeCliArg>,
|
||
|
||
/// Enable web search (off by default). When enabled, the native Responses `web_search` tool is available to the model (no per‑call approval).
|
||
#[arg(long = "search", default_value_t = false)]
|
||
pub web_search: bool,
|
||
|
||
#[clap(skip)]
|
||
pub config_overrides: CliConfigOverrides,
|
||
}
|