Skip to content

feat(install): add OpenAI Codex as a command target#19

Merged
lucindo merged 1 commit into
gleicon:mainfrom
lucindo:feat/17-codex-target
Jun 1, 2026
Merged

feat(install): add OpenAI Codex as a command target#19
lucindo merged 1 commit into
gleicon:mainfrom
lucindo:feat/17-codex-target

Conversation

@lucindo

@lucindo lucindo commented May 31, 2026

Copy link
Copy Markdown
Collaborator

Closes #17.

Adds OpenAI Codex as a fifth supported target.

What changed

  • install.sh — new install_codex copies the ds- commands to
    ${CODEX_HOME:-~/.codex}/prompts, where Codex picks them up as custom
    prompts invoked /prompts:<name>. Plus CODEX_HOME_DIR/CODEX_COMMANDS_DIR
    constants and a Codex line in the closing "Verify with" hint.
  • test/dry-run.test.sh — extends the existing regression guard to Codex:
    asserts ~/.codex/prompts is not created under --dry-run and receives
    all 32 commands on a real run. CODEX_HOME is pinned into the sandbox so the
    test is hermetic against a real env var.
  • README / docs/commands.md / ds-write-a-command — document Codex as a
    target and the prompts: invocation namespace.

Persistent surface is free

Codex reads a project's AGENTS.md natively (~/.codex/AGENTS.md global +
root-down project files, 32 KiB cap), which is exactly what setup.sh /
profile.sh already build — so no changes were needed there. Only the
command surface had to be wired. (Devskills' own AGENTS.md blocks total ~11 KB
worst case — comfortably under Codex's 32 KiB cap.)

Design note (deviation from the issue)

The issue floated a --skip-codex opt-out "to match the other targets." On a
closer look, the real parallel is install_opencode: the global command
targets (Claude, OpenCode) have no opt-out
— detection gates them. The
--skip-* flags exist only for the project-writing editors (Cursor, VSCode).
So install_codex mirrors install_opencode — auto-detect (codex on PATH or
~/.codex present), no skip flag — for design consistency. The ds- prefix is
the collision guard in the shared prompts dir, same as for OpenCode.

Note

OpenAI's docs currently mark Codex custom prompts as deprecated in favour of
skills. This ships the prompts path because it works today and mirrors the
existing copy loop with no restructuring. (Codex skills are a different artifact
— a directory per skill with a SKILL.md and required frontmatter — and moving
devskills' flat commands to a skill format is a broader, tool-agnostic question,
not specific to Codex; it's deliberately out of scope here.)

Testing

npm test green (all suites). Verified the not-detected path warns and creates
nothing, the detected path installs all 32 commands, and no command file
contains $-sequences Codex would substitute as prompt arguments.

Opened as a draft for review.

Codex CLI reads project AGENTS.md natively, so setup.sh/profile.sh already
cover its persistent surface — only the command surface needed wiring.

install.sh now copies the ds- commands to ${CODEX_HOME:-~/.codex}/prompts,
where Codex picks them up as custom prompts invoked /prompts:<name>. The new
install_codex mirrors install_opencode: a global target gated by detection
(codex on PATH or ~/.codex present), with no opt-out flag — consistent with
the other global command targets (Claude, OpenCode), unlike the project-
writing editors (Cursor/VSCode) which keep their --skip-* opt-outs.

Note: OpenAI marks Codex custom prompts as deprecated in favour of skills.
This ships the prompts path because it works today and needs no restructuring;
moving devskills' flat commands to a skill format is a broader, tool-agnostic
question, out of scope here.

- install.sh: CODEX_HOME_DIR/CODEX_COMMANDS_DIR, install_codex, wired into main
- dry-run test: assert ~/.codex/prompts is not created on --dry-run and gets
  all commands on a real run; CODEX_HOME pinned into the sandbox for hermeticity
- README/docs/ds-write-a-command: document Codex as a fifth target
@lucindo
lucindo force-pushed the feat/17-codex-target branch from 7cdb3d5 to b5c9f0f Compare May 31, 2026 23:04
@lucindo
lucindo marked this pull request as ready for review May 31, 2026 23:04
@lucindo
lucindo requested a review from gleicon May 31, 2026 23:09
@lucindo
lucindo merged commit 8066b54 into gleicon:main Jun 1, 2026
@lucindo
lucindo deleted the feat/17-codex-target branch June 1, 2026 04:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add OpenAI Codex CLI as an install target

1 participant