Skip to content

About

深度云创科技,专注开发 AI 智能体、AI 应用辅助科研、工作、学习!

Resources

Security policy

Stars

37 stars

Watchers

0 watching

Forks

Repository files navigation

codex-plugin

欢迎关注B站及YouTube频道:深度云创科技,感兴趣的朋友欢迎加入新时代智能体交流社群

客服微信:16773345788

skills.sh

A Codex skill that patches the local Codex desktop app so Fast/Speed mode and Plugins are available when Codex is signed in with an API key instead of ChatGPT OAuth. It can also optionally patch Codex remote SSH sessions so Zed appears as a remote-capable “Open With” target.

The main artifact is the installable skill package at skills/patch-codex-fast/SKILL.md. Install the repository through npx skills, then ask Codex to run patch-codex-fast. Codex should handle the doctor check, patch execution, verification, and rollback guidance for you.

Warning

This is an unofficial local patch. It modifies your installed Codex desktop app and disables selected Electron integrity fuses so the unpacked app can load. Use it only on machines where you accept that tradeoff.

What this skill does

When invoked, the skill guides Codex to:

  1. Check the local Codex app path and required tools.
  2. Back up the original app.asar.
  3. Extract and patch the local Codex desktop bundle.
  4. Re-sign the app on macOS.
  5. Ask you to verify Fast/Speed mode, Plugins, and the Google Chrome row under Computer Use in API key mode.
  6. Roll back immediately if Codex fails to launch.

You do not need to copy long patch commands manually. The scripts under the skill package are execution assets used by the skill.

Install as a Codex skill

Recommended install through npx skills:

npx skills add crazymsn/codex-plugin -g -a codex -y

This installs skills/patch-codex-fast/ as a global Codex skill. You can inspect the available skill before installing:

npx skills add crazymsn/codex-plugin --list

For the interactive cross-agent installer, run:

npx skills add crazymsn/codex-plugin

If you want to install the skill package path explicitly, use the GitHub tree URL:

npx skills add https://github.com/crazymsn/codex-plugin/tree/main/skills/patch-codex-fast -g -a codex -y

Manual install is still possible if you do not want to use npx skills:

git clone https://github.com/crazymsn/codex-plugin.git
mkdir -p ~/.codex/skills
ln -s "$(pwd)/patch-codex-fast/skills/patch-codex-fast" ~/.codex/skills/patch-codex-fast

Confirm the skill file exists:

ls ~/.codex/skills/patch-codex-fast/SKILL.md

Use the skill

In Codex, invoke the skill directly:

[$patch-codex-fast] Patch my local Codex app so Fast mode and Plugins work in API key mode.

Or describe the goal naturally:

Use patch-codex-fast to enable Fast mode and Plugins for my API-key Codex desktop setup.

The skill will run the appropriate local script for your OS. It should not ask you to perform the patch steps manually unless your environment blocks execution or the Codex bundle changed enough that manual inspection is required.

Expected Codex flow

The skill is designed for this workflow:

  1. Run doctor to inspect environment and app paths.
  2. Run patch for the current OS.
  3. Report the patch result and any warnings.
  4. Ask you to completely quit and reopen Codex, then verify the UI including Google Chrome under Computer Use.
  5. Run rollback if launch or verification fails.

Because this modifies an installed desktop application, Codex may warn before executing commands that stop Codex or write under the app installation directory.

Requirements

  • Codex desktop app installed.
  • Node.js with npx.
  • Python 3.
  • macOS: codesign from Xcode Command Line Tools.
  • Windows: PowerShell.

The patch uses npx @electron/asar and npx @electron/fuses. npx may download those packages on first run.

Repository layout

.
├── README.md
├── LICENSE
├── SECURITY.md
├── skills/patch-codex-fast/ # Canonical installable skill package
│   ├── SKILL.md             # Skill entrypoint used by npx skills and skills.sh
│   ├── scripts/             # Execution assets copied when the skill is installed
│   ├── README.md
│   ├── LICENSE
│   └── SECURITY.md
├── scripts/                 # Root development copy of implementation assets
│   ├── patch_codex_fast.py  # Cross-platform CLI
│   ├── codex_fast_patch/    # Python modules
│   ├── macos-patch.sh
│   ├── macos-rollback.sh
│   ├── windows-patch.ps1
│   └── windows-rollback.ps1
└── tests/
    ├── test_packaging.py
    └── test_patch_logic.py

skills.sh compatibility

This repository uses the conventional skills/<slug>/SKILL.md layout expected by the skills ecosystem:

skills/patch-codex-fast/SKILL.md

There is intentionally no root-level SKILL.md. The npx skills CLI checks a root SKILL.md first and returns it by default when present; keeping only the canonical skills/patch-codex-fast/ package prevents the root entry from shadowing the package path that skills.sh uses for the detail page and download snapshot.

The skills.sh page is expected at https://skills.sh/crazymsn/codex-plugin/patch-codex-fast. If the SKILL.md preview lags after a push, verify the GitHub source and CLI install first:

npx skills add crazymsn/codex-plugin --list
npx skills add crazymsn/codex-plugin -g -a codex --skill patch-codex-fast -y --copy

Direct script usage

Direct script usage is mainly for debugging or for environments where you are not using Codex skills.

macOS

python3 scripts/patch_codex_fast.py doctor
python3 scripts/patch_codex_fast.py patch
python3 scripts/patch_codex_fast.py patch-zed-remote
python3 scripts/patch_codex_fast.py zed-remote-status

Rollback:

python3 scripts/patch_codex_fast.py rollback

Windows

python .\scripts\patch_codex_fast.py doctor
python .\scripts\patch_codex_fast.py patch
python .\scripts\patch_codex_fast.py patch-zed-remote
python .\scripts\patch_codex_fast.py zed-remote-status

Rollback:

python .\scripts\patch_codex_fast.py rollback

Options

Option Applies to Purpose
--resources-dir all commands Override the Codex resources directory.
--app-path all commands Override the path passed to @electron/fuses and macOS codesign.
--no-stop patch, rollback Do not stop the running Codex app before changing files.
--zed-remote patch Apply the Zed remote-open patch together with the Fast/Plugins patch.

Default app paths

OS Resources directory App path
macOS /Applications/Codex.app/Contents/Resources /Applications/Codex.app
Windows %LOCALAPPDATA%\Programs\Codex\resources %LOCALAPPDATA%\Programs\Codex\Codex.exe

If Codex is installed somewhere else, pass both paths through the skill request or direct CLI options.

What the patch changes

The patch changes local desktop bundle gates that currently depend on authMethod=chatgpt:

Area Local change Purpose
Fast auth gate Return true for the fast availability check. Allow API key mode to see Fast/Speed mode.
Fast hook early return Disable the auth-only early return. Prevent canUseFastMode:false before model checks.
Fast model check Replace speed-tier model availability check with true. Support relay /v1/models responses without additionalSpeedTiers.
Plugins sidebar Change the disabled ternary gate from X? to 0?. Keep the Plugins sidebar enabled.
API key detector Force API key plugin gate to return false. Stop plugin code from treating API key mode as unsupported.
Connector gate Prefix connector-unavailable assignment with false&&. Stop every connector from being marked unavailable.

Optional Zed remote-open patch:

Area Local change Purpose
Zed open target Add supportsSsh: true to Codex’s bundled Zed target. Make Zed available in remote Codex sessions.
Zed remote path builder Convert Codex remote paths into Zed Remote Development URLs such as ssh://user@host[:port]/path when Codex exposes SSH config details, with ssh://host/path as fallback. Open remote files/folders in local Zed through SSH.
Local Zed behavior Keep existing local Zed open behavior unchanged. Avoid regressing local file opens.

It also changes Electron fuses required for the unpacked modified app to load:

Fuse Why
OnlyLoadAppFromAsar=off Allows Electron to load app/ instead of only app.asar.
EnableEmbeddedAsarIntegrityValidation=off Avoids integrity failure after local modification.
GrantFileProtocolExtraPrivileges=off Keeps the modified unpacked bundle loadable in current Codex builds.
EnableCookieEncryption=off Avoids a local runtime check that can block the patched app.

When Codex updates

Codex updates can change bundle hashes and minified variable names. Re-run the skill first. If it reports that no patches were applied, the skill should inspect the extracted bundle and look for these targets:

grep -rl "authMethod" *.js | xargs grep -l "fast_mode"
grep -rl "pluginsDisabledTooltip" *.js
# Gate exported from gradient-*.js. Two known variants live in the wild:
#   older builds: function e(e){return e===`apikey`}
#   newer builds: function e(e){return e!==`chatgpt`}
# Both should be rewritten to `return false`.
grep -rlE 'return [A-Za-z_$]+(===|!==)`(apikey|chatgpt)`' *.js | grep -v locale
grep -rl "connector-unavailable" *.js | grep plugin

The same logical gates should be patched even if filenames or minified variables changed.

Manual rollback

Use the skill rollback first:

[$patch-codex-fast] Roll back the Codex desktop patch.

If you must recover manually, close Codex and run the commands for your OS.

macOS

cd /Applications/Codex.app/Contents/Resources
[ -f app.asar.bak ] && cp app.asar.bak app.asar
[ ! -f app.asar ] && [ -f app.asar1 ] && cp app.asar1 app.asar
rm -rf app
npx @electron/fuses write --app /Applications/Codex.app OnlyLoadAppFromAsar=on
npx @electron/fuses write --app /Applications/Codex.app EnableEmbeddedAsarIntegrityValidation=on
npx @electron/fuses write --app /Applications/Codex.app EnableCookieEncryption=on
npx @electron/fuses write --app /Applications/Codex.app GrantFileProtocolExtraPrivileges=off
codesign --force --deep --sign - /Applications/Codex.app

Restore app.asar before deleting app/. If macOS reports Operation not permitted while writing inside the bundle, do not delete app/; grant App Management access or move /Applications/Codex.app aside, copy it back, then restore app.asar.

Windows

cd "$env:LOCALAPPDATA\Programs\Codex\resources"
Remove-Item -Recurse -Force app -ErrorAction SilentlyContinue
if (Test-Path app.asar1) { Rename-Item app.asar1 app.asar }
if (Test-Path app.asar.bak) { Copy-Item app.asar.bak app.asar }

Troubleshooting

Skill is not detected

Confirm that Codex can read the installed skill package:

ls ~/.codex/skills/patch-codex-fast/SKILL.md

For repository installs, the canonical source file is skills/patch-codex-fast/SKILL.md.

Patch reports No patches were applied

The installed Codex version likely changed the bundle patterns. Ask Codex to use this skill to inspect the extracted assets and update the target patterns.

If the Plugins UI is visible but the Computer Use Google Chrome row disappears after a restart, inspect these bundle surfaces:

grep -rl "chrome-internal" app/.vite/build
grep -rl "externalBrowserUseAllowed" app/.vite/build
grep -rl "isExternalBrowserUseAvailable" app/webview/assets

The current Chrome preservation patch maps the Dev runtime Chrome plugin name from chrome-internal to chrome, keeps the Chrome marketplace descriptor from being dropped by the external-browser feature gate, and prevents the renderer plugin list from hiding Chrome when isExternalBrowserUseAvailable is false.

For Zed remote-open support, inspect the main process open-target bundle:

grep -rl "id:\`zed\`" app/.vite/build
grep -rl "supportsSsh" app/.vite/build
grep -rl "vscode-remote://" app/.vite/build

The current Zed patch uses Zed’s documented Remote Development URL form, ssh://[user@]host[:port]/path. It prefers Codex’s structured SSH config (user/username, host/hostname/hostName, port) instead of the display alias so Zed does not accidentally try the local macOS username for a remote host. Line and column support for remote URLs still needs UI verification on a real SSH target; installing the Zed CLI on PATH improves line/column refinement after the app is opened.

Do not paste API keys, cookies, tokens, or proprietary bundle chunks into public issues.

About

深度云创科技,专注开发 AI 智能体、AI 应用辅助科研、工作、学习!

Resources

Security policy

Stars

37 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages