feat: add OpenCode and Codex to tool compatibility#16
Conversation
Add OpenCode and Codex (OpenAI) as supported AI tools in the setup menu. OpenCode uses .opencode/opencode.json with an instructions field pointing to .mex/AGENTS.md. Codex reads a root-level AGENTS.md natively. Closes #12
There was a problem hiding this comment.
Pull request overview
Adds OpenCode and Codex (OpenAI) as supported tool configurations in mex setup, including new template/config files and documentation updates.
Changes:
- Added OpenCode and Codex options to the interactive setup menu (
src/setup/index.ts) andsetup.sh. - Introduced OpenCode config (
opencode.json) in both.tool-configs/andtemplates/.tool-configs/. - Updated compatibility documentation in
README.mdand tool-config READMEs.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
src/setup/index.ts |
Adds menu options and copy destinations for OpenCode/Codex configs. |
setup.sh |
Mirrors the updated tool-selection menu and copy logic for new configs. |
README.md |
Extends the multi-tool compatibility table with OpenCode/Codex. |
.tool-configs/README.md |
Documents new tool config locations and setup commands. |
.tool-configs/opencode.json |
Adds OpenCode configuration pointing at scaffold instructions. |
templates/.tool-configs/README.md |
Adds the same documentation to the packaged templates. |
templates/.tool-configs/opencode.json |
Adds the OpenCode config template for mex setup to copy. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
README.md
Outdated
| | OpenCode | `.opencode/opencode.json` | | ||
| | Codex (OpenAI) | `AGENTS.md` | | ||
|
|
||
| All config files contain identical content. `mex setup` asks which tool you use and copies the right one. |
There was a problem hiding this comment.
README claims “All config files contain identical content”, but OpenCode uses a JSON config that only references .mex/AGENTS.md rather than embedding the same markdown content. Please update this statement (and/or clarify that OpenCode is an exception and what it points to) so docs match the actual generated files.
| All config files contain identical content. `mex setup` asks which tool you use and copies the right one. | |
| Most config files contain the same instructions directly. OpenCode is the exception: `.opencode/opencode.json` points to `.mex/AGENTS.md` instead of embedding the markdown content. `mex setup` asks which tool you use and creates the appropriate config. |
There was a problem hiding this comment.
Fixed in 0576b57 — updated wording to clarify OpenCode references AGENTS.md by path instead of embedding content.
| | GitHub Copilot | `copilot-instructions.md` → copy to `.github/` in project root | | ||
| | OpenCode | `opencode.json` → copy to `.opencode/` in project root | | ||
| | Codex (OpenAI) | Copy `CLAUDE.md` as `AGENTS.md` to project root | | ||
| | Any other tool | Point agent to `.mex/AGENTS.md` | |
There was a problem hiding this comment.
This table is introduced as “All contain the same content”, but the new OpenCode entry uses opencode.json, which does not contain the same markdown content as the other tool configs (it references .mex/AGENTS.md). Please adjust the wording to reflect the OpenCode/Codex behavior (e.g., “most contain…” or call out the JSON indirection) to avoid misleading setup instructions.
| | Windsurf | `.windsurfrules` → copy or symlink to project root | | ||
| | GitHub Copilot | `copilot-instructions.md` → copy to `.github/` in project root | | ||
| | OpenCode | `opencode.json` → copy to `.opencode/` in project root | | ||
| | Codex (OpenAI) | Copy `CLAUDE.md` as `AGENTS.md` to project root | | ||
| | Any other tool | Point agent to `.mex/AGENTS.md` | |
There was a problem hiding this comment.
This templates README says “All contain the same content”, but opencode.json is JSON and only references .mex/AGENTS.md instead of containing the same markdown content. Please update the wording to reflect the OpenCode/Codex behavior so generated docs are accurate.
| "2": { src: ".tool-configs/.cursorrules", dest: ".cursorrules" }, | ||
| "3": { src: ".tool-configs/.windsurfrules", dest: ".windsurfrules" }, | ||
| "4": { src: ".tool-configs/copilot-instructions.md", dest: ".github/copilot-instructions.md" }, | ||
| "5": { src: ".tool-configs/opencode.json", dest: ".opencode/opencode.json" }, | ||
| "6": { src: ".tool-configs/CLAUDE.md", dest: "AGENTS.md" }, // Codex reads AGENTS.md at root |
There was a problem hiding this comment.
PR description/issue #12 mention updating drift checking to include the new tool config(s), but drift’s project-root tool-config scan currently only includes CLAUDE.md, .cursorrules, and .windsurfrules (see src/drift/index.ts:98). With OpenCode/Codex support added here, drift should also consider .opencode/opencode.json and AGENTS.md (and likely .github/copilot-instructions.md) when present, otherwise changes to those files won’t be detected.
There was a problem hiding this comment.
Valid point — drift checking should include the new tool configs. Out of scope for this PR; tracked as a follow-up.
| @@ -0,0 +1,4 @@ | |||
| { | |||
| "$schema": "https://opencode.ai/config.json", | |||
| "instructions": [".mex/AGENTS.md"] | |||
There was a problem hiding this comment.
This config points OpenCode at .mex/AGENTS.md, while the surrounding docs describe tool configs as pointing to .mex/ROUTER.md / having identical embedded content. Please make the project’s guidance consistent (either change this to reference .mex/ROUTER.md if that’s what OpenCode should load, or update the READMEs to explicitly document that OpenCode loads .mex/AGENTS.md).
| "instructions": [".mex/AGENTS.md"] | |
| "instructions": [".mex/ROUTER.md"] |
There was a problem hiding this comment.
AGENTS.md is intentional. It's the always-loaded anchor (~150 tokens) that then directs to ROUTER.md. All other tool configs embed the AGENTS.md content; OpenCode references it by path. Changing to ROUTER.md would skip the anchor layer.
| @@ -0,0 +1,4 @@ | |||
| { | |||
| "$schema": "https://opencode.ai/config.json", | |||
| "instructions": [".mex/AGENTS.md"] | |||
There was a problem hiding this comment.
This config references .mex/AGENTS.md, but the templates/.tool-configs README claims tool configs all contain the same content / point to .mex/ROUTER.md. Please align the template config and documentation (either reference .mex/ROUTER.md here, or update the docs to call out the indirection via .mex/AGENTS.md).
| "instructions": [".mex/AGENTS.md"] | |
| "instructions": [".mex/ROUTER.md"] |
There was a problem hiding this comment.
Same as above — AGENTS.md is the correct entry point.
Address Copilot review — "all identical content" wording was inaccurate after adding OpenCode's JSON config.
Summary
mex setuptool selection menu.opencode/opencode.jsonwithinstructionsfield pointing to.mex/AGENTS.mdAGENTS.mdtemplate to project root (Codex reads it natively — no subdirectory support)setup.shbash script with matching menu changes.tool-configs/README.md, and bundled templatesCloses #12
Test plan
npx promexeus setup→ select option 5 (OpenCode) → verify.opencode/opencode.jsoncreatednpx promexeus setup→ select option 6 (Codex) → verifyAGENTS.mdat project rootnpx promexeus setup→ select option 7 (Multiple) → select1 5 6→ all three configs created--dry-runworks for new optionsnpm test)🤖 Generated with Claude Code