Skip to content

Codex CLI

Codex CLI is OpenAI’s official command-line agent. Agentslan dispatches it via codex exec, piping prompts on stdin, with a per-company managed CODEX_HOME so each company’s auth and skills stay isolated.

The adapter type inside Agentslan is codex_local and the menu label is Codex (local).

Install the CLI globally and verify it’s on your PATH:

Terminal window
npm install -g @openai/codex
codex --version

If codex is installed at a non-standard path, point the adapter’s command field at the full path.

Run codex once to complete the OAuth flow; credentials are then cached on disk and headless runs work without prompts:

Terminal window
codex

You can also use an API key by exporting OPENAI_API_KEY in the host environment or through the adapter’s env map.

  1. Open the Agentslan desktop app.
  2. Go to Agents → Add agent.
  3. Pick Codex (local) as the adapter type.
  4. Set a model. Built-in options:
    • gpt-5.4
    • gpt-5.3-codex (default)
    • gpt-5.3-codex-spark
    • gpt-5
    • o3, o4-mini, o3-mini
    • gpt-5-mini, gpt-5-nano
    • codex-mini-latest
  5. Save.
FieldTypeNotes
cwdstring, optionalDefault absolute working directory for the agent process.
instructionsFilePathstring, optionalAbsolute path to a Markdown instructions file. Contents are prepended to the stdin prompt on every run.
modelstring, optionalCodex model ID. Defaults to gpt-5.3-codex.
modelReasoningEffortstring, optionalReasoning effort override (minimal, low, medium, high, xhigh), passed via -c model_reasoning_effort=.... Some model/tool combinations reject specific levels (e.g. minimal with web search).
promptTemplatestring, optionalRun prompt template.
searchboolean, optionalRun with --search.
fastModeboolean, optionalEnable Codex Fast mode. Only supported on gpt-5.4 and consumes credits faster. When enabled, Agentslan applies service_tier="fast" and features.fast_mode=true.
dangerouslyBypassApprovalsAndSandboxboolean, optionalRun with the bypass flag (defaults true).
commandstring, optionalDefaults to codex.
extraArgsstring[], optionalAdditional CLI arguments.
envobject, optionalExtra environment variables.
workspaceStrategyobject, optionalCurrently supports { type: "git_worktree", baseRef?, branchTemplate?, worktreeParentDir? }.
timeoutSecnumber, optionalRun timeout in seconds.
graceSecnumber, optionalSIGTERM grace period before SIGKILL.
  • Prompts are piped to Codex via stdin; Codex receives - as the prompt argument.
  • If instructionsFilePath is configured, Agentslan prepends its contents to the stdin prompt for every run.
  • codex exec automatically applies repo-scoped AGENTS.md instructions from the active workspace. Agentslan cannot suppress that discovery, so repo AGENTS.md files apply on top of any explicit instructionsFilePath.
  • Agentslan injects per-company skills into the effective CODEX_HOME/skills/ at execution time so Codex can discover them without polluting the project working directory.
  • Unless CODEX_HOME is overridden in the adapter config, Agentslan runs Codex with a per-company managed CODEX_HOME and seeds auth from your shared Codex home (CODEX_HOME env var, when set, otherwise ~/.codex).