{"_id":"@bug-winston/codex-account-switcher","_rev":"2-be5d37ffd78c72c8dff88c80ccd34cd1","name":"@bug-winston/codex-account-switcher","dist-tags":{"latest":"0.1.1"},"versions":{"0.1.0":{"name":"@bug-winston/codex-account-switcher","version":"0.1.0","keywords":["codex","openai","cli","profile","account-switcher"],"author":{"name":"oepnok"},"license":"MIT","_id":"@bug-winston/codex-account-switcher@0.1.0","maintainers":[{"name":"bug-winston","email":"dev.hashmap@gmail.com"}],"homepage":"https://github.com/bug-origin/codex-account-switcher#readme","bugs":{"url":"https://github.com/bug-origin/codex-account-switcher/issues"},"bin":{"codex-switch":"bin/codex-switch.js","codex-account":"bin/codex-switch.js","codex-profile":"bin/codex-switch.js"},"dist":{"shasum":"878ede78d64b0e36d5d29ecddd9a895f9740c32a","tarball":"https://registry.npmjs.org/@bug-winston/codex-account-switcher/-/codex-account-switcher-0.1.0.tgz","fileCount":4,"integrity":"sha512-LwmJNKrNMD3LLUV0hrFwKNtjqIv4AT+9K/u2cyIExXYoWCJ0DM9BpTXlsHIVLv2iSZAyJfwsx1JOaMjWd0ztFw==","signatures":[{"sig":"MEQCIBwOknHrLKN5gwzBYiqE9VVKn57Uzed6uGBca/A2f1PvAiBX/N+4A0lS4UwJrQCbmAEfVIEqz0FtXMq3K86/A00ixw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":24509},"type":"commonjs","engines":{"node":">=18"},"gitHead":"f145214619c1d1abbdadc47b85f2eeb91a5f3d9a","scripts":{"test":"node --test","pack:dry-run":"npm pack --dry-run"},"_npmUser":{"name":"bug-winston","email":"dev.hashmap@gmail.com"},"repository":{"url":"git+https://github.com/bug-origin/codex-account-switcher.git","type":"git"},"_npmVersion":"11.17.0","description":"Switch between multiple Codex config and auth profiles from the command line.","directories":{},"_nodeVersion":"26.4.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/codex-account-switcher_0.1.0_1783498050781_0.6374413384317492","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@bug-winston/codex-account-switcher","version":"0.1.1","description":"Switch between multiple Codex config and auth profiles from the command line.","type":"commonjs","bin":{"codex-switch":"bin/codex-switch.js","codex-account":"bin/codex-switch.js","codex-profile":"bin/codex-switch.js"},"scripts":{"test":"node --test","pack:dry-run":"npm pack --dry-run"},"keywords":["codex","openai","cli","profile","account-switcher"],"author":{"name":"oepnok"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/bug-origin/codex-account-switcher.git"},"bugs":{"url":"https://github.com/bug-origin/codex-account-switcher/issues"},"homepage":"https://github.com/bug-origin/codex-account-switcher#readme","engines":{"node":">=18"},"publishConfig":{"access":"public"},"_id":"@bug-winston/codex-account-switcher@0.1.1","gitHead":"f145214619c1d1abbdadc47b85f2eeb91a5f3d9a","_nodeVersion":"22.16.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-sI1vGDy4Q8/6VK9prPG2alYuqSTisDI1DFrjwh0j5QhVA2Y5ND5K70B6KsESWH/ITr7h46Qd3zfO27V/4YW9tA==","shasum":"820a943b3dd8771c671b3dff3f31232afaba15da","tarball":"https://registry.npmjs.org/@bug-winston/codex-account-switcher/-/codex-account-switcher-0.1.1.tgz","fileCount":4,"unpackedSize":33634,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCyHA1CbfYU9jHbivEq4D0TbX7MxKWJzL2SVmxaBfLaZwIgTJ0O295Eeunq0SOYDRlAmtw0Kqq1zeMs/kEjuEw+xm4="}]},"_npmUser":{"name":"bug-winston","email":"dev.hashmap@gmail.com"},"directories":{},"maintainers":[{"name":"bug-winston","email":"dev.hashmap@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/codex-account-switcher_0.1.1_1783852943995_0.16736904529579588"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-08T08:07:30.584Z","modified":"2026-07-12T10:42:24.252Z","0.1.0":"2026-07-08T08:07:30.933Z","0.1.1":"2026-07-12T10:42:24.150Z"},"bugs":{"url":"https://github.com/bug-origin/codex-account-switcher/issues"},"author":{"name":"oepnok"},"license":"MIT","homepage":"https://github.com/bug-origin/codex-account-switcher#readme","keywords":["codex","openai","cli","profile","account-switcher"],"repository":{"type":"git","url":"git+https://github.com/bug-origin/codex-account-switcher.git"},"description":"Switch between multiple Codex config and auth profiles from the command line.","maintainers":[{"name":"bug-winston","email":"dev.hashmap@gmail.com"}],"readme":"# codex-account-switcher\n\nSwitch Codex between multiple accounts, API keys, and providers from the command line.\n\nCodex reads its active local state from `~/.codex/config.toml` and `~/.codex/auth.json`. This tool stores complete profiles under `~/.codex/profiles/<name>/`. When you run `codex-switch use <name>`, it switches the account/provider source while preserving local Codex state such as projects, plugins, desktop preferences, and history-related config entries.\n\nIt is designed for people who use both:\n\n- the official OpenAI / ChatGPT Codex login\n- a third-party OpenAI-compatible API key and base URL\n\n## Install\n\n```sh\nnpm install -g @bug-winston/codex-account-switcher\n```\n\nOr run from a checkout:\n\n```sh\ngit clone https://github.com/bug-origin/codex-account-switcher.git\ncd codex-account-switcher\nnpm install -g .\n```\n\n## Quick Start\n\nSave your current Codex setup:\n\n```sh\ncodex-switch save official --label \"OpenAI ChatGPT\"\n```\n\nConfigure Codex for your third-party provider, then save it too:\n\n```sh\ncodex-switch save third-party --label \"Third-party API\"\n```\n\nSwitch any time:\n\n```sh\ncodex-switch use official\ncodex-switch use third-party\n```\n\nCheck what is active:\n\n```sh\ncodex-switch status\ncodex-switch list\n```\n\n## Import Existing Files\n\nIf you already keep separate files, import them directly:\n\n```sh\ncodex-switch import official \\\n  --config ~/.codex/config.official.toml \\\n  --auth ~/.codex/auth.official.json\n\ncodex-switch import third-party \\\n  --config ~/.codex/config.third-party.toml \\\n  --auth ~/.codex/auth.third-party.json\n```\n\nThen switch with:\n\n```sh\ncodex-switch use official\ncodex-switch use third-party\n```\n\n## Commands\n\n```text\ncodex-switch status\ncodex-switch list\ncodex-switch save <name> [--label <text>] [--force]\ncodex-switch import <name> --config <path> --auth <path> [--label <text>] [--force]\ncodex-switch use <name> [--no-backup] [--replace-config]\ncodex-switch backup\ncodex-switch delete <name> --force\ncodex-switch paths\ncodex-switch doctor\n```\n\nAliases:\n\n- `codex-account`\n- `codex-profile`\n\n## How It Works\n\nEach profile is a directory:\n\n```text\n~/.codex/profiles/official/\n  config.toml\n  auth.json\n  profile.json\n```\n\nWhen you run `codex-switch use official`, the tool:\n\n1. verifies the profile has both `config.toml` and `auth.json`\n2. backs up the current active files to `~/.codex/switch-backups/`\n3. updates only source-related config entries in `~/.codex/config.toml`, including model/provider/auth-method keys and the active `[model_providers.*]` block\n4. atomically replaces `~/.codex/auth.json`\n5. records the last switched profile in `~/.codex/.active-profile`\n\nThis keeps local state in the active config, including `[projects...]`, plugin settings, desktop preferences, and other history-related state. If you want the old full replacement behavior, run:\n\n```sh\ncodex-switch use official --replace-config\n```\n\nWith `--replace-config`, the tool:\n\n1. backs up the current active files\n2. atomically replaces the entire `~/.codex/config.toml` and `~/.codex/auth.json`\n3. records the last switched profile in `~/.codex/.active-profile`\n\nThe command output never prints `config.toml` or `auth.json` contents.\n\n## Environment Variables\n\n- `CODEX_HOME`: override the Codex home directory. Defaults to `~/.codex`.\n- `CODEX_SWITCHER_PROFILES_DIR`: override where profiles are stored. Defaults to `$CODEX_HOME/profiles`.\n\nEquivalent command-line flags:\n\n```sh\ncodex-switch --codex-home /path/to/.codex status\ncodex-switch --profiles-dir /path/to/profiles list\n```\n\n## Security Notes\n\nProfiles and backups contain credentials because `auth.json` can contain API keys or login tokens. Keep your `~/.codex` directory private, do not commit profile directories, and do not paste `auth.json` into issue reports.\n\nThe tool writes profile, backup, config, and auth files with `0600` permissions on POSIX filesystems and profile directories with `0700` permissions.\n\n## Publishing\n\nTo publish your fork:\n\n```sh\nnpm test\nnpm pack --dry-run\nnpm publish\n```\n\nFor GitHub, create a repository and push:\n\n```sh\ngit init\ngit add .\ngit commit -m \"Initial release\"\ngit branch -M main\ngit remote add origin git@github.com:bug-origin/codex-account-switcher.git\ngit push -u origin main\n```\n","readmeFilename":"README.md"}