Codex Settings

autospec supports Codex through the non-interactive Codex CLI command:

codex exec --json "<rendered autospec prompt>"

Authentication

autospec does not require OPENAI_API_KEY for Codex. Authentication is owned by the Codex CLI and may use ChatGPT login or API credentials.

Optional environment variables:

Variable Purpose
OPENAI_API_KEY API authentication when using API billing
OPENAI_BASE_URL API-compatible base URL override
CODEX_HOME Alternate Codex config and auth directory

Configuration Files

Codex user config lives at:

~/.codex/config.toml

Project-level autospec setup creates:

.codex/config.toml

The project file is intentionally minimal. autospec records project metadata only and does not write destructive defaults such as full-access sandboxing.

Models And Reasoning Effort

Set a persistent Codex model and reasoning effort in autospec config:

agent_preset: codex
model: gpt-6-sol
reasoning_effort: medium
models:
  specify: gpt-6-astra
  implement: gpt-6-sol
reasoning_efforts:
  specify: high
  implement: xhigh

Here specify uses its stage model and effort together, as does implement. Every workflow stage is supported: constitution, specify, clarify, plan, tasks, checklist, analyze, and implement.

The settings are independent. Configuring only one leaves the other on its own fallback chain:

models:
  plan: gpt-6-astra        # Plan model only; effort falls back.
reasoning_efforts:
  tasks: high              # Tasks effort only; model falls back.

Or override both for one workflow run:

autospec run -a "Add billing exports" --agent codex --model gpt-6-sol --reasoning-effort xhigh

Use the equivalent -e xhigh shorthand for faster typing.

Autospec invokes Codex with --model <model> and -c model_reasoning_effort=<effort>. Model IDs and effort values are passed through so the installed Codex CLI remains the source of truth.

Model precedence is CLI --model, the current stage’s models.<stage>, top-level model, then the Codex CLI default. Reasoning precedence is CLI -e/--reasoning-effort, the current stage’s reasoning_efforts.<stage>, top-level reasoning_effort, then the Codex model default. CLI overrides apply only to that invocation and do not rewrite either persistent setting.

The Codex 0.155.1 catalog reports these current models and efforts:

Model Default Supported efforts
gpt-6-astra, gpt-6-sol medium low, medium, high, xhigh, max, ultra
gpt-6-luna medium low, medium, high, xhigh, max

Older gpt-5.x models remain in the catalog for compatibility; prefer GPT-6. Run codex debug models to inspect the catalog available to your installed version.

Sandboxing And Approvals

Codex supports these controls for codex exec:

codex exec --sandbox workspace-write "task"
codex exec --ask-for-approval never "task"
codex exec --dangerously-bypass-approvals-and-sandbox "task"

autospec maps:

skip_permissions: true

to:

--dangerously-bypass-approvals-and-sandbox

This is autospec’s default because workflow runs are intended to complete unattended. Set skip_permissions: false if you want Codex sandbox and approval behavior controlled by ~/.codex/config.toml or explicit Codex flags.

Init

autospec init --ai codex
autospec init --project --ai codex

Codex does not use slash-command files, so autospec does not install command templates for Codex. Workflow stages started through the autospec CLI send rendered prompt text directly to codex exec.

For interactive Codex sessions, project-level init installs one shared Agent Skill per autospec command template:

.agents/skills/autospec-specify/SKILL.md
.agents/skills/autospec-plan/SKILL.md
.agents/skills/autospec-tasks/SKILL.md
.agents/skills/autospec-implement/SKILL.md
.agents/skills/autospec-constitution/SKILL.md
.agents/skills/autospec-clarify/SKILL.md
.agents/skills/autospec-checklist/SKILL.md
.agents/skills/autospec-analyze/SKILL.md
.agents/skills/autospec-worktree-setup/SKILL.md

Each skill is generated from the matching internal/commands/autospec.*.md prompt and registered in .codex/config.toml with skills.config. Use Codex-native skill syntax such as $autospec-specify "Add user auth" or $autospec-clarify; slash-style text such as /autospec.specify "Add user auth" is also described in the relevant skill for compatibility, but it is not a Codex-native slash command.

Output

Codex exec is the non-interactive CLI mode. autospec uses compact output by default for automated Codex runs:

codex_output:
  mode: compact
  max_lines_per_message: 40
  color: true

In compact mode autospec runs codex exec --json, parses the JSONL event stream, and displays color-coded concise agent messages, command summaries, file-change summaries, and useful reasoning/tool labels. Each displayed block is capped by max_lines_per_message; truncated blocks include a hint to switch to full mode. Set codex_output.color: false to disable ANSI color.

To restore Codex’s native terminal transcript:

codex_output:
  mode: full

Full mode runs codex exec "<rendered autospec prompt>" without --json. Interactive Codex sessions are unchanged.

For script parsing, Codex supports JSON Lines output:

codex exec --json "summarize the repo structure"

With --json, stdout is a JSONL event stream. Events include thread and turn lifecycle events, agent messages, reasoning summaries, command executions, file changes, MCP tool calls, web searches, and plan updates.

If only the final assistant message is needed, Codex can also write it to a file:

codex exec -o codex-final.txt "summarize the repo structure"

autospec still relies on Codex process exit status plus generated workflow artifacts (spec.yaml, plan.yaml, tasks.yaml) for workflow validation; compact output only changes what is shown while Codex runs.

References

  • Codex CLI reference: https://developers.openai.com/codex/cli/reference
  • Codex non-interactive mode: https://developers.openai.com/codex/noninteractive
  • Codex approvals and sandboxing: https://developers.openai.com/codex/agent-approvals-security
  • Codex config reference: https://developers.openai.com/codex/config-reference

Back to top

autospec - AI-powered software specification and implementation workflows