Skip to content

codex: Add portable Codex configuration and skills synchronization#13

Merged
Unique-Divine merged 2 commits into
mainfrom
ud/codex
Jul 13, 2026
Merged

codex: Add portable Codex configuration and skills synchronization#13
Unique-Divine merged 2 commits into
mainfrom
ud/codex

Conversation

@Unique-Divine

@Unique-Divine Unique-Divine commented Jul 13, 2026

Copy link
Copy Markdown
Owner

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

  1. Add a tested Codex-config CLI that merges dotfile-owned defaults into ~/.codex/config.toml while preserving local project trust, MCP configuration, onboarding state, and other runtime-only settings.
  2. Extend skill synchronization to copy the canonical Cursor skill set into a marked, managed Codex skills directory, reject unsafe existing destinations, and report drift through a health check.
  3. Add just sync, just health, and just codex commands, along with the required TOML and CLI dependencies, to apply or validate the complete local setup.
  4. Document the Codex configuration and skills workflows in the repository README and add focused tests for configuration merging, CLI behavior, and skills-sync health checks.
  5. Move shared shell helpers into zshenv for non-interactive Codex shells and remove redundant sourcing and the duplicate main_bash_setup call 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.toml while 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/skills set into a managed ~/.agents/skills tree for Codex (ownership marker, refusal to overwrite unrelated non-empty dirs). A new --health mode reports drift across public, private, and Codex destinations; the script uses Commander instead of manual argv parsing.

just sync runs shell bootstrap, applies Codex config, and runs skills sync; just health checks tools plus Codex and skills drift without writing. README and codex/README.md document these workflows.

Shell loading moves shared aliases/helpers from main_bash_setup / interactive-only zshrc into zshenv so non-interactive shells (e.g. Codex) get the same helpers; main_bash_setup only sources zshenv and runs nvm use.

Reviewed by Cursor Bugbot for commit 2b1cae5. Configure here.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ 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.

Comment thread skillsSync.ts
const tmpCodex = join(tmpRoot, "codex")
await stageSkills(cfg, allSkills, tmpCodex)

if (!dryRun) await prepareCodexSkillsDir(cfg.codexSkillsDir)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 2b1cae5. Configure here.

@Unique-Divine
Unique-Divine merged commit 3eb48e8 into main Jul 13, 2026
2 checks passed
@Unique-Divine
Unique-Divine deleted the ud/codex branch July 13, 2026 19:59
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.

1 participant