feat(sync): zero-touch auto-install codex plugins for team distribution#55
Merged
feat(sync): zero-touch auto-install codex plugins for team distribution#55
Conversation
Codex 0.121.0 git-source marketplaces require a manual TUI "Install plugin" click for each plugin — even with `INSTALLED_BY_DEFAULT` policy. That breaks team distribution: every new member must remember to open the TUI and click install before plugins appear in `$git`/`$sync` pickers. Add Step 3 to ensure-codex-plugins.sh that performs the equivalent of the TUI install: 1. Read the marketplace clone fetched by `codex marketplace add` (`~/.codex/.tmp/marketplaces/taptap-plugins/.agents/plugins/marketplace.json`). 2. Auto-enable any plugin marked `INSTALLED_BY_DEFAULT` in the marketplace manifest, unless the user has explicitly set `enabled = false`. 3. For every enabled `*@taptap-plugins` not yet in cache, copy `<clone>/<source.path>/` → `~/.codex/plugins/cache/taptap-plugins/<name>/<version>/`. Codex 0.121.0+ derives plugin install state from cache directory existence; `installed_plugins.json` is no longer used. Documented in the script header. Result: SessionStart hook → marketplace registered → plugins enabled → plugins installed end-to-end with zero TUI interaction. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Summary
ensure-codex-plugins.sh: copy enabled*@taptap-pluginsfrom the marketplace clone (~/.codex/.tmp/marketplaces/taptap-plugins/) into~/.codex/plugins/cache/<marketplace>/<plugin>/<version>/. This is the equivalent of the TUI "Install plugin" action.INSTALLED_BY_DEFAULTinmarketplace.json(currentlygitandsync) unless the user explicitly setenabled = false.Motivation
Codex 0.121.0 git-source marketplaces require manual TUI confirmation per plugin even with
INSTALLED_BY_DEFAULTpolicy — only local-source marketplaces auto-install atcodex marketplace addtime. That breaks team distribution: every new member would have to remember to open Codex TUI, navigate to the plugin picker, and click install beforegit@taptap-pluginsandsync@taptap-pluginsappear in$git/$syncskill pickers.Reverse engineering of Codex 0.121.0+:
~/.codex/plugins/installed_plugins.json(the file is preserved but unused). Codex now derives "installed" state from the existence of~/.codex/plugins/cache/<marketplace>/<plugin>/<version>/.codex-plugin/plugin.json.Install pluginbutton just copies the source directory from the marketplace clone into that cache path.Scope
Validation
End-to-end on the author's machine:
~/.codex/plugins/cache/taptap-plugins/, removed[marketplaces.taptap-plugins]and[plugins."*@taptap-plugins"]segments from~/.codex/config.toml, deleted~/.codex/.tmp/marketplaces/taptap-plugins/and the sync marker.bash plugins/sync/scripts/ensure-codex-plugins.shonce → log:~/.codex/plugins/cache/taptap-plugins/{git/0.1.16,sync/0.1.28}/.codex-plugin/plugin.jsonexists.tests/validate.shpasses (no test schema change in this PR; existing four cases for the script still cover the marketplace-add and mirror behavior).Regression Risk
~/.codex/.tmp/marketplaces/<name>/clone path coupling: if Codex moves the clone location in a future release, Step 3 silently degrades to "marketplace clone not found, skip auto-install" without aborting. Marketplace add and project-mirror still work; users would just need to install via TUI as before.git/0.1.10/lingers whengit/0.1.16/is installed). Codex itself should clean these; revisit if disk usage becomes an issue.enabled = falseis preserved: if a user explicitly disables a plugin, Step 3 will not re-enable it on subsequent runs (only initialINSTALLED_BY_DEFAULTopt-in writes thetruesegment).AI Disclosure
Checklist