{"_id":"@anewryzm/codex-use","_rev":"2-a60f91731e212820d656a1a8100b2479","name":"@anewryzm/codex-use","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@anewryzm/codex-use","version":"0.1.0","license":"MIT","_id":"@anewryzm/codex-use@0.1.0","maintainers":[{"name":"anewryzm","email":"anewryzm@gmail.com"}],"homepage":"https://github.com/Anewryzm/codex-use#readme","bugs":{"url":"https://github.com/Anewryzm/codex-use/issues"},"bin":{"cdex":"tools/codex-use","codex-use":"tools/codex-use"},"dist":{"shasum":"ca856b25bc2ecdc84ffd562a45faebb6d280a45e","tarball":"https://registry.npmjs.org/@anewryzm/codex-use/-/codex-use-0.1.0.tgz","fileCount":3,"integrity":"sha512-B7PSwWENFH0h2ExtQUTUB6qW3lYBMi1tS4RnWwkn6yfi5ez7mEd7IqpsJ9NBL/6njOYsgV+6nIWwFr5G1t5W9g==","signatures":[{"sig":"MEYCIQCReAI6gRDZwWlncQGs8F+6HZSK2tSKrFBz9hXCZFR46gIhAMydoRAEbj8OEZ+kn4gOVtVwAU7KThPJB7BtfBVJMbgP","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":60514},"gitHead":"bc39a355285aecddbecb97aef73f74b4bddc1bb3","_npmUser":{"name":"anewryzm","email":"anewryzm@gmail.com"},"repository":{"url":"git+https://github.com/Anewryzm/codex-use.git","type":"git"},"_npmVersion":"11.3.0","description":"CLI to manage multiple Codex profiles and switch the active account safely.","directories":{},"_nodeVersion":"24.0.2","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/codex-use_0.1.0_1775987966788_0.5922417364908028","host":"s3://npm-registry-packages-npm-production"},"deprecated":"Package moved to @enriquecardoza/dex. Please install @enriquecardoza/dex instead."}},"time":{"created":"2026-04-12T09:59:26.706Z","modified":"2026-06-07T07:15:27.507Z","0.1.0":"2026-04-12T09:59:26.925Z"},"bugs":{"url":"https://github.com/Anewryzm/codex-use/issues"},"license":"MIT","homepage":"https://github.com/Anewryzm/codex-use#readme","repository":{"url":"git+https://github.com/Anewryzm/codex-use.git","type":"git"},"description":"CLI to manage multiple Codex profiles and switch the active account safely.","maintainers":[{"name":"anewryzm","email":"anewryzm@gmail.com"}],"readme":"# codex-use\n\nCLI to manage multiple Codex accounts by profile and promote one account to the default profile (`~/.codex`) used by Codex App + Codex CLI when `CODEX_HOME` is not set.\n\n## Install (npm)\n- `npm i -g @anewryzm/codex-use`\n\n## Commands\n- Primary: `codex-use`\n- Short alias: `cdex`\n\n## Main file\n- `tools/codex-use`\n\n## Core flow\n1. Save login per profile:\n- `codex-use login personal`\n- `codex-use login work`\n\n2. Switch the active default account:\n- `codex-use use personal`\n- `codex-use use work`\n- `codex-use use work --relaunch` (recommended so Codex App refreshes the session automatically)\n- `codex-use use work --relaunch --from-action` (for Actions: relaunches the app and closes the Terminal tab on success)\n\n3. Check usage/rate limits:\n- `codex-use usage`\n- `codex-use usage --json`\n- `codex-use limits work --refresh`\n- `codex-use limits --all` or `codex-use limits -a` (compact limits view by profile)\n\n## Available commands\n- `codex-use login <profile>`\n- `codex-use use <profile> [--force] [--relaunch] [--from-action]`\n- `codex-use usage [--json]`\n- `codex-use limits [profile|default] [--all] [--json] [--refresh]`\n- `codex-use list`\n- `codex-use whoami`\n- `codex-use status <profile> [--refresh]`\n- `codex-use logout <profile>`\n- `codex-use logout-default`\n\n## Security notes\n- `use` creates an automatic backup of `~/.codex/auth.json` in `~/.codex/backups/`.\n- Avoid switching accounts while there are active tasks in Codex App.\n- `--force` exists for advanced cases and may interrupt in-flight sessions.\n- `--relaunch` closes and reopens Codex App so the UI reads the new `auth.json`.\n- `--from-action` is intended for Codex Actions: after a successful `--relaunch`, it tries to auto-close the current Terminal tab.\n- `usage` reads local history from `~/.codex/sessions`.\n- `limits` queries `codex app-server` using JSON-RPC (`initialize`, `account/read`, `account/rateLimits/read`).\n\n## Quick troubleshooting when \"the account did not change\" in the app\n1. Run `codex-use list`.\n2. Check the legend:\n- `[*]` = the profile uses exactly the same token as `~/.codex`.\n- `[~]` = same `account_id`, but different token/identity.\n3. If you switch while the app is open, use `codex-use use <profile> --relaunch`.\n4. Run `codex-use whoami` to see `Active profile` plus email/plan/account.\n\n## Difference between `whoami` and `status`\n- `whoami`: quick view of the active profile in `~/.codex` (the account used by app/CLI by default).\n- `status <profile>`: diagnostics for a specific profile in `~/.codex-profiles/<profile>`, including:\n- identity summary (`plan`, `default_org`, `email`, `account_id`)\n- usage limits (`5h` and `weekly`) with remaining percentage, horizontal bar, and reset timing\n- readable credits summary (`credits: none`, `credits: unlimited`, `credits: balance ...`)\n- Use `--refresh` to force a fresh backend query before showing limits.\n\n## `usage` output\n- `usage` shows historical consumption from `~/.codex/sessions` in a compact table.\n- Columns: `in(M)`, `out(M)`, `cach(M)` (millions of tokens). `out(M)` includes reasoning.\n- `usage --json` returns the raw aggregate (`totals` and `models`) for scripting.\n\n## `limits` output\n- `limits <profile>` (without `--json`) shows dashboard-style output: `5h` and `weekly` bars, natural-language reset, and credits summary.\n- `limits --all`/`limits -a` shows a compact table with columns `profile`, `email`, `5h (reset)`, `weekly (reset)` and a `Current default profile` line.\n- `limits --json` keeps the raw JSON output from rate limits for scripting/automation.\n","readmeFilename":"README.md"}