id = "codex"
name = "Codex"
homepage = "https://developers.openai.com/codex/cli/"
description = "OpenAI's coding agent, running in the terminal."
icon = "theSVG:codex"
executables = ["codex"]
[dotfiles]
paths = [
"~/.codex/config.toml",
"~/.codex/hooks.json",
"~/.codex/AGENTS.md",
"~/.codex/prompts/",
"~/.codex/skills/",
]
exclude = [
"~/.codex/sessions/",
"~/.codex/session_index.jsonl",
"~/.codex/shell_snapshots/",
"~/.codex/worktrees/",
"~/.codex/vendor_imports/",
"~/.codex/visualizations/",
"~/.codex/thread-writer-locks/",
"~/.codex/tmp/",
"~/.codex/log/",
"~/.codex/sqlite/",
"~/.codex/*.sqlite",
"~/.codex/*.sqlite-shm",
"~/.codex/*.sqlite-wal",
"~/.codex/*.jsonl",
"~/.codex/.codex-global-state.json",
"~/.codex/.codex-global-state.json.bak",
"~/.codex/version.json",
]
secret = ["~/.codex/auth.json"]
[[dotfiles.machine_lines]]
file = "~/.codex/config.toml"
match = { key_path = ["mcp_servers.*.command", "mcp_servers.*.args", "mcp_servers.*.cwd"] }
scope = "backup"
[[dotfiles.machine_lines]]
file = "~/.codex/hooks.json"
match = { key_path = ["hooks.*.*.hooks.*.command"] }
scope = "backup"
[commands]
format = 1
label = "Start Codex"
description = "Start the interactive Codex agent with a prompt, model and sandbox choices. Config overrides, remote and feature flags are left out."
quality = "ai-draft"
base = "fig:codex"
parser = { end_of_options = "--", interleave = "permute", long_equals = true, short_attached = true, short_bundles = false }
[[commands.source]]
id = "fig"
kind = "completion"
url = "https://github.com/withfig/autocomplete/blob/master/src/codex.ts"
license = "MIT"
[[commands.field]]
id = "prompt"
label = "Prompt"
description = "Initial instructions for the agent."
type = "string"
position = 0
sources = ["fig"]
[[commands.field]]
id = "model"
label = "Model"
type = "string"
option = ["--model", "-m"]
sources = ["fig"]
[[commands.field]]
id = "sandbox"
label = "Sandbox"
type = "enum"
option = ["--sandbox", "-s"]
choices = [{ value = "read-only", label = "Read only" }, { value = "workspace-write", label = "Workspace write" }, { value = "danger-full-access", label = "Full access (dangerous)" }]
sources = ["fig"]
[[commands.field]]
id = "approval"
label = "Approval policy"
type = "enum"
option = ["--ask-for-approval", "-a"]
choices = [{ value = "untrusted", label = "Untrusted" }, { value = "on-failure", label = "On failure" }, { value = "on-request", label = "On request" }, { value = "never", label = "Never" }]
sources = ["fig"]
[[commands.field]]
id = "cd"
label = "Working directory"
type = "path"
option = ["--cd", "-C"]
path = { kind = "directory", role = "input", must_exist = true }
sources = ["fig"]
[[commands.field]]
id = "profile"
label = "Config profile"
type = "string"
option = ["--profile", "-p"]
sources = ["fig"]
[[commands.field]]
id = "image"
label = "Images"
type = "path"
option = ["--image", "-i"]
multiple = true
path = { kind = "file", role = "input", must_exist = true }
sources = ["fig"]
[[commands.field]]
id = "search"
label = "Live web search"
type = "boolean"
option = ["--search"]
sources = ["fig"]
[[commands.task]]
id = "start"
label = "Start a session"
fields = ["prompt", "model", "cd", "sandbox", "approval", "search"]
required = []
[[commands.task]]
id = "safe"
label = "Read-only session"
set = { sandbox = ["read-only"], approval = ["on-request"] }
fields = ["prompt", "model", "cd", "sandbox", "approval"]
required = []
[[commands.group]]
id = "basic"
label = "Basic"
fields = ["prompt", "model", "cd", "sandbox", "approval"]
[[commands.group]]
id = "advanced"
label = "Advanced"
fields = ["profile", "image", "search"]
[[commands.subcommand]]
path = ["exec"]
label = "Run non-interactively"
description = "Run Codex non-interactively with one prompt."
[[commands.subcommand.source]]
id = "fig"
kind = "completion"
url = "https://github.com/withfig/autocomplete/blob/master/src/codex.ts"
license = "MIT"
[[commands.subcommand.field]]
id = "prompt"
label = "Prompt"
type = "string"
position = 0
sources = ["fig"]
[[commands.subcommand.field]]
id = "model"
label = "Model"
type = "string"
option = ["--model", "-m"]
sources = ["fig"]
[[commands.subcommand.field]]
id = "sandbox"
label = "Sandbox"
type = "enum"
option = ["--sandbox", "-s"]
choices = [{ value = "read-only", label = "Read only" }, { value = "workspace-write", label = "Workspace write" }, { value = "danger-full-access", label = "Full access (dangerous)" }]
sources = ["fig"]
[[commands.subcommand.field]]
id = "cd"
label = "Working directory"
type = "path"
option = ["--cd", "-C"]
path = { kind = "directory", role = "input", must_exist = true }
sources = ["fig"]
[[commands.subcommand.field]]
id = "search"
label = "Live web search"
type = "boolean"
option = ["--search"]
sources = ["fig"]
[[commands.subcommand.task]]
id = "exec"
label = "Run a prompt"
fields = ["prompt", "model", "cd", "sandbox", "search"]
required = ["prompt"]
[[commands.subcommand.group]]
id = "basic"
label = "Basic"
fields = ["prompt", "model", "cd", "sandbox", "search"]