|
| 1 | +# Plugin Bridge |
| 2 | + |
| 3 | +Keep an AI agent's skills directory in sync with the Claude Code `codealive` |
| 4 | +plugin's versioned cache. The bridge lets agents like Codex CLI, Gemini CLI, |
| 5 | +Cursor, or Windsurf consume the same skill files the Claude Code plugin |
| 6 | +installs, and updates the link automatically on `claude plugin update`. |
| 7 | + |
| 8 | +## Why |
| 9 | + |
| 10 | +Claude Code stores plugins under a versioned cache: |
| 11 | +`~/.claude/plugins/cache/<marketplace>/<plugin>/<version>/`. Every call to |
| 12 | +`claude plugin update` writes a new versioned directory and leaves the old one |
| 13 | +behind. Agents other than Claude Code don't read from that cache — they look |
| 14 | +for skills in their own directories (`~/.codex/skills/`, `~/.gemini/skills/`, |
| 15 | +etc.). |
| 16 | + |
| 17 | +A symlink from the agent's skills directory into the cache lets them share the |
| 18 | +plugin's skill with zero duplication. The trade-off: that symlink breaks every |
| 19 | +time the plugin version changes. `plugin-bridge` rewrites the symlink to point |
| 20 | +at the newest versioned directory whenever the cache changes on disk. |
| 21 | + |
| 22 | +## Files |
| 23 | + |
| 24 | +| File | Purpose | |
| 25 | +|------|---------| |
| 26 | +| `update-symlink.sh` | Scans the plugin cache and refreshes the agent symlink if the target has changed | |
| 27 | +| `com.codealive.plugin-bridge.plist.template` | `launchd` agent template with placeholders | |
| 28 | +| `install-macos.sh` | Renders the plist, writes it to `~/Library/LaunchAgents`, and bootstraps the agent | |
| 29 | +| `uninstall-macos.sh` | Removes the `launchd` agent; leaves existing symlinks untouched | |
| 30 | + |
| 31 | +## Install (macOS) |
| 32 | + |
| 33 | +```bash |
| 34 | +./install-macos.sh |
| 35 | +``` |
| 36 | + |
| 37 | +Verify the symlink and the agent: |
| 38 | + |
| 39 | +```bash |
| 40 | +ls -la ~/.codex/skills/codealive-context-engine |
| 41 | +launchctl print "gui/$(id -u)/com.codealive.plugin-bridge" | head |
| 42 | +cat /tmp/codealive-plugin-bridge.log |
| 43 | +``` |
| 44 | + |
| 45 | +Run `claude plugin update codealive@codealive-marketplace`, then re-check the |
| 46 | +symlink — it should now point at the new version's directory. |
| 47 | + |
| 48 | +## Configure |
| 49 | + |
| 50 | +All paths are environment-variable driven with defaults suitable for Codex CLI. |
| 51 | +Export the variables before running `install-macos.sh` to target a different |
| 52 | +agent. |
| 53 | + |
| 54 | +| Variable | Default | |
| 55 | +|----------|---------| |
| 56 | +| `CODEALIVE_PLUGIN_CACHE` | `~/.claude/plugins/cache/codealive-marketplace/codealive` | |
| 57 | +| `CODEALIVE_PLUGIN_SUBPATH` | `skills/codealive-context-engine` | |
| 58 | +| `CODEALIVE_AGENT_LINK` | `~/.codex/skills/codealive-context-engine` | |
| 59 | + |
| 60 | +Example for Gemini CLI: |
| 61 | + |
| 62 | +```bash |
| 63 | +CODEALIVE_AGENT_LINK=~/.gemini/skills/codealive-context-engine ./install-macos.sh |
| 64 | +``` |
| 65 | + |
| 66 | +Note: environment variables are read by `update-symlink.sh` at runtime. |
| 67 | +`launchd` launches it via `/bin/bash` without inheriting your shell, so the |
| 68 | +overrides must be either baked into the script, exported in `~/.zshenv`, or |
| 69 | +injected through an `EnvironmentVariables` key in the plist. |
| 70 | + |
| 71 | +## Uninstall (macOS) |
| 72 | + |
| 73 | +```bash |
| 74 | +./uninstall-macos.sh |
| 75 | +``` |
| 76 | + |
| 77 | +## Linux |
| 78 | + |
| 79 | +A `systemd --user` path unit gives the equivalent behaviour. Create two files: |
| 80 | + |
| 81 | +`~/.config/systemd/user/codealive-plugin-bridge.path`: |
| 82 | + |
| 83 | +```ini |
| 84 | +[Unit] |
| 85 | +Description=Watch CodeAlive plugin cache |
| 86 | + |
| 87 | +[Path] |
| 88 | +PathModified=%h/.claude/plugins/cache/codealive-marketplace/codealive |
| 89 | + |
| 90 | +[Install] |
| 91 | +WantedBy=default.target |
| 92 | +``` |
| 93 | + |
| 94 | +`~/.config/systemd/user/codealive-plugin-bridge.service`: |
| 95 | + |
| 96 | +```ini |
| 97 | +[Unit] |
| 98 | +Description=Refresh CodeAlive plugin symlink |
| 99 | + |
| 100 | +[Service] |
| 101 | +Type=oneshot |
| 102 | +ExecStart=/bin/bash %h/path/to/update-symlink.sh |
| 103 | +``` |
| 104 | + |
| 105 | +Enable with `systemctl --user enable --now codealive-plugin-bridge.path`. |
| 106 | + |
| 107 | +## Windows |
| 108 | + |
| 109 | +No native file-watcher is shipped here. A Task Scheduler entry calling |
| 110 | +`update-symlink.sh` via WSL bash or a PowerShell port on login and every |
| 111 | +N minutes is a reasonable fallback. |
0 commit comments