codex: Add portable Codex configuration and skills synchronization#13
Merged
Conversation
…rminals see the expected variables and aliases
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 2b1cae5. Configure here.
| const tmpCodex = join(tmpRoot, "codex") | ||
| await stageSkills(cfg, allSkills, tmpCodex) | ||
|
|
||
| if (!dryRun) await prepareCodexSkillsDir(cfg.codexSkillsDir) |
There was a problem hiding this comment.
Health mode writes Codex skills
High Severity
With --health, dryRun is set false, so prepareCodexSkillsDir runs and can create ~/.agents/skills, write the ownership marker, or throw on an unmanaged directory. That contradicts the read-only just health / --health workflow.
Reviewed by Cursor Bugbot for commit 2b1cae5. Configure here.
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.


Add portable Codex configuration and skills synchronization
Add a safe, repeatable way to apply portable Codex defaults and make managed AI skills available to both Cursor and Codex. The new sync and health workflows preserve machine-local Codex state, avoid overwriting unmanaged skill directories, and keep non-interactive shells supplied with the helper functions they need.
Key Changes
~/.codex/config.tomlwhile preserving local project trust, MCP configuration, onboarding state, and other runtime-only settings.just sync,just health, andjust codexcommands, along with the required TOML and CLI dependencies, to apply or validate the complete local setup.zshenvfor non-interactive Codex shells and remove redundant sourcing and the duplicatemain_bash_setupcall from the interactive path.Why Do This?
The generated runtime configuration intentionally excludes local authentication, history, caches, project trust, MCP servers, and onboarding data from dotfile ownership.
Note
Medium Risk
Changes shell init order for all environments and writes merged Codex config plus managed skills under the home directory; merge logic is tested but mis-sourced zshenv could affect non-interactive tooling.
Overview
Adds portable Codex CLI configuration via
codex/config.ts: dotfile-owned defaults merge into~/.codex/config.tomlwhile local project trust, MCP servers, and other runtime-only tables stay intact. The CLI supports--run,--dry-run,--check, and--print, with tests covering merge behavior, idempotency, and malformed TOML handling.Skills sync now mirrors the canonical
~/.cursor/skillsset into a managed~/.agents/skillstree for Codex (ownership marker, refusal to overwrite unrelated non-empty dirs). A new--healthmode reports drift across public, private, and Codex destinations; the script uses Commander instead of manual argv parsing.just syncruns shell bootstrap, applies Codex config, and runs skills sync;just healthchecks tools plus Codex and skills drift without writing. README andcodex/README.mddocument these workflows.Shell loading moves shared aliases/helpers from
main_bash_setup/ interactive-onlyzshrcintozshenvso non-interactive shells (e.g. Codex) get the same helpers;main_bash_setuponly sourceszshenvand runsnvm use.Reviewed by Cursor Bugbot for commit 2b1cae5. Configure here.