Skip to main content

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 codex shim
  • stores one isolated runtime home per account
  • checks account login state with codex login status
  • probes each account's remaining quota with /status before 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

codex_switch_cli-0.1.3.tar.gz (22.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

codex_switch_cli-0.1.3-py3-none-any.whl (19.4 kB view details)

Uploaded Python 3

File details

Details for the file codex_switch_cli-0.1.3.tar.gz.

File metadata

  • Download URL: codex_switch_cli-0.1.3.tar.gz
  • Upload date:
  • Size: 22.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for codex_switch_cli-0.1.3.tar.gz
Algorithm Hash digest
SHA256 b8b8e3ad89cebb219a0677dbccf84466c8856063d6224f347f285b7dc253daa7
MD5 01c8b99a35108129fd439307eeed938a
BLAKE2b-256 ee7dff1b52dace6a9948e7a00f19a5d5bd836a91be06c308b40a51d9a91d279e

See more details on using hashes here.

Provenance

The following attestation bundles were made for codex_switch_cli-0.1.3.tar.gz:

Publisher: publish.yml on ForeverHYX/codex-switch

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file codex_switch_cli-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for codex_switch_cli-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 c45a3681945d2a567cbc342b9f780ec2678c026b6ec7e23051d955a9db2a70ee
MD5 0a77f72c008fa768317b832c08e8fe7d
BLAKE2b-256 9cf4d1b110bdca8f5f1e08bf67238fe38fff3cf8eb56fc39ae8def236f83e0f8

See more details on using hashes here.

Provenance

The following attestation bundles were made for codex_switch_cli-0.1.3-py3-none-any.whl:

Publisher: publish.yml on ForeverHYX/codex-switch

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page