Make all shortcut commands installable via pip (cross-shell, cross-platform)#6
Open
luckeyfaraday wants to merge 2 commits into
Open
Make all shortcut commands installable via pip (cross-shell, cross-platform)#6luckeyfaraday wants to merge 2 commits into
luckeyfaraday wants to merge 2 commits into
Conversation
added 2 commits
May 25, 2026 18:56
Previously only `codex-shim` was a real entry point; the other shortcut commands lived only as `bin/*.sh` bash wrappers, so they could not be invoked from PowerShell or cmd on Windows and required manual symlinks on POSIX. Add four small shim functions in `codex_shim/cli.py` that re-enter `main()` with the right argv prefix, and register them in `pyproject.toml` as `[project.scripts]`. After `pip install -e .`, all five commands work from any shell on Windows, macOS, and Linux. Update README install section to recommend `pip install -e .`, with the POSIX `ln -s` route kept as an alternative.
Owner
Author
|
Updated this PR with the Windows provider shortcut fix:
Verification: python -m pytest (23 passed) |
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.
Problem
Before this PR, only
codex-shimwas registered as a real pip entry point. The other shortcuts —codex-app,codex-model,codex-openrouter,codex-minimax— existed only as bash scripts inbin/. That meant:ln -sinto~/.local/bin.Change
codex_shim/cli.pythat re-entermain()with the right argv prefix.[project.scripts]inpyproject.toml.pip install -e .. The POSIXln -sroute is kept as an alternative.The bash scripts in
bin/are untouched so existing setups keep working.Verification
Installed locally with
pip install -e .on Windows 11 / Python 3.11. All five commands resolve to.exewrappers in the Python install'sScripts\dir:Confirmed
codex-shim provider listandcodex-shim --helprun identically from PowerShell and Git Bash, from arbitrary directories.Test plan
python -m pytest -q(22 passed)codex-shim provider listfrom PowerShell in~codex-shim provider listfrom Git Bash in~pip install -e .then runcodex-openrouterfrom a fresh shell