Skip to content

Make all shortcut commands installable via pip (cross-shell, cross-platform)#6

Open
luckeyfaraday wants to merge 2 commits into
mainfrom
windows-pathable-entry-points
Open

Make all shortcut commands installable via pip (cross-shell, cross-platform)#6
luckeyfaraday wants to merge 2 commits into
mainfrom
windows-pathable-entry-points

Conversation

@luckeyfaraday

Copy link
Copy Markdown
Owner

Problem

Before this PR, only codex-shim was registered as a real pip entry point. The other shortcuts — codex-app, codex-model, codex-openrouter, codex-minimax — existed only as bash scripts in bin/. That meant:

  • On Windows, they could not be invoked from PowerShell or cmd, only from Git Bash / WSL.
  • On POSIX, they required manual ln -s into ~/.local/bin.

Change

  • Add four tiny shim functions in codex_shim/cli.py that re-enter main() with the right argv prefix.
  • Register them under [project.scripts] in pyproject.toml.
  • Update the README install section to recommend pip install -e .. The POSIX ln -s route 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 .exe wrappers in the Python install's Scripts\ dir:

codex-shim.exe
codex-app.exe
codex-model.exe
codex-openrouter.exe
codex-minimax.exe

Confirmed codex-shim provider list and codex-shim --help run identically from PowerShell and Git Bash, from arbitrary directories.

Test plan

  • python -m pytest -q (22 passed)
  • codex-shim provider list from PowerShell in ~
  • codex-shim provider list from Git Bash in ~
  • On a Linux/macOS box: pip install -e . then run codex-openrouter from a fresh shell

robertopiqueras255 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.
@luckeyfaraday

Copy link
Copy Markdown
Owner Author

Updated this PR with the Windows provider shortcut fix:

  • keep bin/codex-* scripts LF via .gitattributes to avoid Bash pipefail CRLF failures
  • make Windows codex-openrouter/codex-minimax entry points delegate to the Bash helpers so interactive Codex keeps a usable TTY
  • restore WSL venv/PATH handling and longer shim startup wait
  • added regression coverage for Windows provider entry delegation

Verification: python -m pytest (23 passed)

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