feat(install): add OpenAI Codex as a command target#19
Merged
Conversation
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
force-pushed
the
feat/17-codex-target
branch
from
May 31, 2026 23:04
7cdb3d5 to
b5c9f0f
Compare
lucindo
marked this pull request as ready for review
May 31, 2026 23:04
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #17.
Adds OpenAI Codex as a fifth supported target.
What changed
install.sh— newinstall_codexcopies theds-commands to${CODEX_HOME:-~/.codex}/prompts, where Codex picks them up as customprompts invoked
/prompts:<name>. PlusCODEX_HOME_DIR/CODEX_COMMANDS_DIRconstants and a Codex line in the closing "Verify with" hint.
test/dry-run.test.sh— extends the existing regression guard to Codex:asserts
~/.codex/promptsis not created under--dry-runand receivesall 32 commands on a real run.
CODEX_HOMEis pinned into the sandbox so thetest is hermetic against a real env var.
target and the
prompts:invocation namespace.Persistent surface is free
Codex reads a project's
AGENTS.mdnatively (~/.codex/AGENTS.mdglobal +root-down project files, 32 KiB cap), which is exactly what
setup.sh/profile.shalready build — so no changes were needed there. Only thecommand 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-codexopt-out "to match the other targets." On acloser look, the real parallel is
install_opencode: the global commandtargets (Claude, OpenCode) have no opt-out — detection gates them. The
--skip-*flags exist only for the project-writing editors (Cursor, VSCode).So
install_codexmirrorsinstall_opencode— auto-detect (codexon PATH or~/.codexpresent), no skip flag — for design consistency. Theds-prefix isthe 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.mdand required frontmatter — and movingdevskills' 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 testgreen (all suites). Verified the not-detected path warns and createsnothing, 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.