Transparent account-aware wrapper for the Codex CLI
Project description
codex-switch
codex-switch is a local wrapper for the Codex CLI. It keeps the normal
codex command, but chooses the logged-in account instance with the most
remaining quota before launching the real CLI.
What it does
- installs a PATH-first
codexshim - stores one isolated runtime home per account
- checks account login state with
codex login status - probes each account's remaining quota with
/statusbefore launch - forwards the original user command unchanged to the selected account
- keeps repository files, project instructions, and shared skills visible to every instance
Install
From PyPI after release:
python3 -m pip install codex-switch-cli
codex-switch init
From Homebrew:
brew tap ForeverHYX/tap
brew install codex-switch-cli
codex-switch init
From GitHub before the first PyPI release:
python3 -m pip install git+https://github.com/ForeverHYX/codex-switch.git
codex-switch init
codex-switch init auto-detects the real codex binary, asks how many
accounts to create, walks you through each upstream login flow, and installs the
shim so later codex commands go through codex-switch.
codex-switch init
codex
Once setup is done, day-to-day usage stays the same:
codex "review this branch"
codex exec "make test"
codex-switch list
How it works
The first codex run triggers setup if you have already installed the shim.
codex-switch init runs the same interactive flow explicitly and is the
recommended first step after installation. In both cases, codex-switch
creates one isolated runtime home per account, runs the upstream login flow for
each account in turn, then stores the real Codex binary path for later
launches.
When you later run codex, the shim probes each configured account, skips
unhealthy or unlogged ones, and picks the one with the most remaining quota.
Caveats
- it does not switch accounts in the middle of a running Codex session
- it does not manage upstream Codex upgrades for you
- it depends on the upstream CLI's login/status output staying readable
- all accounts still share the same project working directory
Public repository rules
- commit source files, tests, and public docs only
- keep local planning docs out of public pushes
- keep local-only agent and skill metadata out of public pushes
Publishing
This repository is set up to publish the codex-switch-cli package to PyPI
through GitHub Actions trusted publishing. After PyPI trusted publishing is
configured for this repository, creating a GitHub release tag can build and
upload the package automatically.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file codex_switch_cli-0.1.4.tar.gz.
File metadata
- Download URL: codex_switch_cli-0.1.4.tar.gz
- Upload date:
- Size: 25.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3c9fa289234bffeb373745253f479408e274d3e1512213d1dbe6897ec7aa28e1
|
|
| MD5 |
7d1def23f354bc26b78620263a09ef65
|
|
| BLAKE2b-256 |
5390e5b5f56b4884e5f505f49982e98eee54e12a43121ea7e55361a002bf2462
|
Provenance
The following attestation bundles were made for codex_switch_cli-0.1.4.tar.gz:
Publisher:
publish.yml on ForeverHYX/codex-switch
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
codex_switch_cli-0.1.4.tar.gz -
Subject digest:
3c9fa289234bffeb373745253f479408e274d3e1512213d1dbe6897ec7aa28e1 - Sigstore transparency entry: 1256004460
- Sigstore integration time:
-
Permalink:
ForeverHYX/codex-switch@2523c0963defa909ef7596c90840af3cf89171d1 -
Branch / Tag:
refs/tags/v0.1.4 - Owner: https://github.com/ForeverHYX
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2523c0963defa909ef7596c90840af3cf89171d1 -
Trigger Event:
release
-
Statement type:
File details
Details for the file codex_switch_cli-0.1.4-py3-none-any.whl.
File metadata
- Download URL: codex_switch_cli-0.1.4-py3-none-any.whl
- Upload date:
- Size: 20.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
80689d3d81cb57aab15213d36fe22d67045de3a7ef849839022633807e07329f
|
|
| MD5 |
bb949163f6990e1163e8e8cb443cdffd
|
|
| BLAKE2b-256 |
ab08e513c7e762154ad209379a63a082d87b2366cb13039ac7c34211ca1e86e5
|
Provenance
The following attestation bundles were made for codex_switch_cli-0.1.4-py3-none-any.whl:
Publisher:
publish.yml on ForeverHYX/codex-switch
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
codex_switch_cli-0.1.4-py3-none-any.whl -
Subject digest:
80689d3d81cb57aab15213d36fe22d67045de3a7ef849839022633807e07329f - Sigstore transparency entry: 1256004558
- Sigstore integration time:
-
Permalink:
ForeverHYX/codex-switch@2523c0963defa909ef7596c90840af3cf89171d1 -
Branch / Tag:
refs/tags/v0.1.4 - Owner: https://github.com/ForeverHYX
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2523c0963defa909ef7596c90840af3cf89171d1 -
Trigger Event:
release
-
Statement type: