codex-quota-manager
v0.1.5
Published
Cross-platform Node TUI for managing Codex accounts and quota usage.
Downloads
544
Maintainers
Readme
Codex Quota Manager
Cross-platform Node TUI for managing multiple Codex accounts, switching the active account, and checking quota usage.
This project is designed to work on Windows, macOS, and Linux. iOS is not a first-class target, but the CLI should work anywhere a compatible Node runtime and terminal are available.
Features
- Load accounts from managed app storage, Codex auth, and OpenCode auth
- Merge duplicate identities across sources into one canonical account row
- Check quota usage from the OpenAI usage endpoint
- Refresh expired access tokens with stored refresh tokens
- Add accounts through browser OAuth
- Apply an account to Codex, OpenCode, or both
- Keep discovered external auth visible without silently copying it into the manager store
- Show quota state directly in the main account list
- Open an account workspace with
Enterfor deeper actions and details
Quick Start
Use one of these paths depending on how you want to run the tool.
Run once with npx:
npx --yes codex-quota-managerInstall globally:
npm install -g codex-quota-manager
cqmInstall from GitHub Packages:
npm install -g @saichaithanya0705/codex-quota-manager --registry=https://npm.pkg.github.com
cqmClone and run from source:
git clone https://github.com/saichaithanya0705/codex-quota-manager.git
cd codex-quota-manager
npm ci
npm run devInstall From npm
Temporary use:
npx --yes codex-quota-managerGlobal install:
npm install -g codex-quota-managerRun after global install:
cqmUpdate an existing global install:
npm install -g codex-quota-manager@latestRun the latest version without installing:
npx --yes codex-quota-manager@latestInstall From GitHub Packages
GitHub Packages uses the scoped package name @saichaithanya0705/codex-quota-manager.
Configure the registry scope:
npm config set @saichaithanya0705:registry https://npm.pkg.github.comAuthenticate to GitHub Packages:
npm login --scope=@saichaithanya0705 --auth-type=legacy --registry=https://npm.pkg.github.comInstall the package:
npm install -g @saichaithanya0705/codex-quota-managerUse From Source
Clone the repository:
git clone https://github.com/saichaithanya0705/codex-quota-manager.git
cd codex-quota-managerInstall dependencies:
npm ciRun in development:
npm run devBuild and run the compiled CLI:
npm run build
npm startYou can also run the built entry directly:
node dist/cli.jsTest
npm testRequirements
- Node.js 20 or later
- npm 10 or later
Package Layout
src/: TypeScript source for the CLI, auth, quota logic, and TUItest/: Vitest coverage for paths, token parsing, quota mapping, and store behavior.github/workflows/: CI, GitHub release, and npm publish automationCHANGELOG.md: release history for published versionsdist/: generated build output used for the published CLI package
Publishing
The package is structured for npm publication and GitHub-based releases:
- Push a semver tag such as
v0.1.0to trigger the GitHub release workflow. - The release workflow builds, tests, creates an npm tarball, and uploads it to the GitHub release.
- Publishing the GitHub release triggers the npm publish workflow.
- The npm workflow supports either trusted publishing via GitHub OIDC or a repository secret named
NPM_TOKEN. - The GitHub Packages workflow publishes a scoped mirror package as
@saichaithanya0705/codex-quota-manager.
Recommended setup:
- Create the GitHub repository at
saichaithanya0705/codex-quota-manager. - Add the repository as the project remote.
- For the first automated publish, either:
- configure an npm granular token as the
NPM_TOKENrepository secret, or - configure npm trusted publishing for
.github/workflows/publish-npm.ymlonce the package exists.
- configure an npm granular token as the
- After trusted publishing is working, prefer it over long-lived tokens.
Community Files
Keybindings
Up/Downorj/k: move selectionEnter: open account workspacer: refresh selected account usageR: refresh all account usaget: refresh selected account tokena: apply selected account to Codexo: apply selected account to OpenCodeb: apply selected account to bothn: add account through browser loginx: delete managed copy of selected accounth/?: toggle help and shortcutsl: open application logsTab/Shift+Tab: cycle focus inside the workspaceEsc: close dialog or quitq/Ctrl+C: quit
Paths
Codex auth:
CODEX_AUTH_PATHCODEX_HOME/auth.json~/.codex/auth.json
OpenCode auth:
OPENCODE_AUTH_PATHOPENCODE_DATA_DIR/auth.json- Windows:
%LOCALAPPDATA%\\opencode\\auth.json,%APPDATA%\\opencode\\auth.json - Linux/macOS:
~/.local/share/opencode/auth.json,~/.config/opencode/auth.json - macOS:
~/Library/Application Support/opencode/auth.json - Fallback:
~/.opencode/auth.json
Managed app store:
CQM_CONFIG_DIRCQ_CONFIG_HOME- Windows:
%APPDATA%\\codex-quota-manager - macOS:
~/Library/Application Support/codex-quota-manager - Linux:
$XDG_CONFIG_HOME/codex-quota-manageror~/.config/codex-quota-manager
