Skip to content

feat(cli): Add Codex support and Cursor commands expansion#19

Merged
thecodedrift merged 5 commits into
mainfrom
jakob/oss-5
May 12, 2026
Merged

feat(cli): Add Codex support and Cursor commands expansion#19
thecodedrift merged 5 commits into
mainfrom
jakob/oss-5

Conversation

@thecodedrift
Copy link
Copy Markdown
Member

Add OpenAI Codex as a first-class detected tool and expand Cursor with slash commands.

Codex auto-discovers skills from .agents/skills/ per its official docs — the same path our "no tools detected" fallback already writes to. So we've been silently shipping into Codex's canonical location, but the install summary said "no tools detected" and used generic fallback wording. This PR detects Codex via .codex/ or .codex/config.toml, labels the install summary accordingly, and registers Codex in the tool array. Codex receives no command files: custom slash commands are deprecated upstream and skills are the official replacement.

Cursor gains commands: Cursor 1.6 added .cursor/commands/<name>.md as a real authored surface (per cursor.com/docs). The harness already supports per-tool commands, so this is just adding commands: { path: "commands/tskl" } to the Cursor descriptor. Cursor users now get the same tskl slash-command UX Claude users already had.

The .agents/ lookup is shared between Codex (installDir: ".agents") and AGENTS_FALLBACK. Disambiguated by deriving the wizard's TOOL_BY_INSTALL_DIR map from the canonical TOOLS registry, seeded with AGENTS_FALLBACK first so registered tools win on collision (Object.fromEntries keeps the last value for a duplicate key). The findToolByInstallDirectory helper in install.ts follows the same ordering — registered tools come before the fallback in the lookup array.

Spec changes were synced inline rather than via auto-merge at archive time. The OpenSpec change is archived under openspec/changes/archive/2026-05-12-add-codex-and-cursor-commands/ for reference.

Reviewer notes:

  • The exported TOOLS is new — previously the registry was internal to install.ts. Wizard imports it now to avoid duplicating descriptors.
  • The locations-step hint format changed from detected to detected (ToolName). Worth a glance to confirm the formatting reads well in practice.
  • Manual end-to-end was verified for both Codex (.codex/.agents/skills/taskless/SKILL.md) and Cursor (.cursor/ → both skills and commands written). No Codex CLI was launched against the install — the documented read path is what we wrote to.

Refs LINEAR-OSS-5

thecodedrift and others added 3 commits May 11, 2026 23:30
Codex auto-discovers skills from .agents/skills/ per its official docs —
the same path our 'no tools detected' fallback already writes to. Add
Codex as a first-class detected tool (via .codex/ directory or
.codex/config.toml) so the install summary names it explicitly instead
of falling back to generic 'no tools detected' wording. Codex receives
no commands: custom slash commands are deprecated upstream and skills
are the official replacement.

While here, expand the Cursor descriptor to include a commands path
(.cursor/commands/tskl/) — Cursor 1.6 added commands as a real
authored surface, and the harness already supports per-tool commands.

Disambiguate the .agents/ lookup (shared between Codex and the fallback)
by deriving the wizard's tool map from the canonical TOOLS registry,
seeded with AGENTS_FALLBACK first so registered tools win on collision.

Refs LINEAR-OSS-5
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Refs LINEAR-OSS-5
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Refs LINEAR-OSS-5
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 12, 2026 06:32
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends the CLI’s tool registry and install behavior to (1) detect OpenAI Codex and treat .agents/ installs as “Codex” when appropriate, and (2) install tskl slash-command files for Cursor in addition to skills. It also updates the wizard’s location prompt hints and syncs the OpenSpec cli-init spec accordingly.

Changes:

  • Add Codex as a detected tool (.codex/ / .codex/config.toml) that installs skills to .agents/skills/ and receives no commands.
  • Expand Cursor’s tool descriptor to also install embedded commands to .cursor/commands/tskl/.
  • Improve wizard location hints to show detected (ToolName) and update OpenSpec requirements + tests.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
packages/cli/src/install/install.ts Export TOOLS, add Codex descriptor, add Cursor commands support, document .agents collision precedence.
packages/cli/src/wizard/index.ts Derive TOOL_BY_INSTALL_DIR from registry to avoid duplicated descriptors and resolve .agents collisions deterministically.
packages/cli/src/wizard/steps/locations.ts Show detected tool names in install-location hints.
packages/cli/test/install.test.ts Add Codex detection/install tests, Cursor commands install test, and .agents collision ordering test.
openspec/specs/cli-init/spec.md Update Cursor requirements and add Codex requirements / collision behavior requirements.
openspec/changes/archive/2026-05-12-add-codex-and-cursor-commands/* Archive spec-driven change artifacts (proposal/design/tasks/spec delta).
.changeset/codex-and-cursor-commands.md Publish CLI minor version changeset describing Codex + Cursor command additions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/cli/src/install/install.ts
Comment thread packages/cli/src/install/install.ts
Comment thread packages/cli/test/install.test.ts
Comment thread packages/cli/test/install.test.ts Outdated
Comment thread openspec/specs/cli-init/spec.md
@thecodedrift thecodedrift marked this pull request as ready for review May 12, 2026 06:40
thecodedrift and others added 2 commits May 12, 2026 10:39
Updates from copilot review:

- Correct misleading "Claude Code only" comment on command placement;
  commands are written for any tool descriptor that defines a path.
- Rewrite self-contradictory comment in the Codex config.toml
  detection test to describe the actual assertion.
- Replace stale `commands/taskless/` and `.claude/commands/taskless/`
  references in the cli-init spec with `commands/tskl/` and
  `.claude/commands/tskl/` so docs match the implementation.
- Skip the AGENTS_FALLBACK append in `checkStaleness` when a detected
  tool already uses `.agents`; prevents duplicate Codex/fallback rows.
- Assert the Codex `commands/tskl/` directory does not exist (via
  readdir) instead of checking a single hard-coded filename.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The CLI subcommand was renamed from `rules` to `rule` in v0.7.0, but
several JSDoc comments and active openspec docs still referenced the
plural form. Align them with the implementation:

- Schema docstrings in `src/schemas/rules-*.ts`, `src/schemas/ast-grep-rule.ts`,
  and `src/rules/verify-examples.ts` now reference `taskless rule <verb>`.
- Active specs (`cli-check`, `cli-help`, `cli`, `cli-rules`,
  `cli-taskless-bootstrap`) updated to use the singular form. The
  intentional back-compat references documenting the rename
  (`cli-rules/spec.md` lines 13, 22, 28, 175) are preserved.

No behavior change. Archived openspec changes and CHANGELOG entries
are left as historical record.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@thecodedrift thecodedrift merged commit 4921c0c into main May 12, 2026
2 checks passed
thecodedrift added a commit that referenced this pull request May 12, 2026
Updates from copilot review:

- Correct misleading "Claude Code only" comment on command placement;
  commands are written for any tool descriptor that defines a path.
- Rewrite self-contradictory comment in the Codex config.toml
  detection test to describe the actual assertion.
- Replace stale `commands/taskless/` and `.claude/commands/taskless/`
  references in the cli-init spec with `commands/tskl/` and
  `.claude/commands/tskl/` so docs match the implementation.
- Skip the AGENTS_FALLBACK append in `checkStaleness` when a detected
  tool already uses `.agents`; prevents duplicate Codex/fallback rows.
- Assert the Codex `commands/tskl/` directory does not exist (via
  readdir) instead of checking a single hard-coded filename.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@thecodedrift thecodedrift deleted the jakob/oss-5 branch May 12, 2026 18:05
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.

2 participants