← 全部工具

@youdie006/swapdex

热度 65 更新于 开发与构建

Switch between multiple Claude Code, Codex, Gemini, and Antigravity login accounts, locally and safely.

npmauto-collected

安装

npm
npm install -g @youdie006/swapdex

通过 npm 安装。

<div align="center"

<img src="https://raw.githubusercontent.com/youdie006/swapdex/main/docs/cli-banner.png" alt="swapdex - switch Claude Code and Codex login accounts, one command, all local" width="760" /

</div

One command to flip your Claude Code, Codex, Gemini CLI, or Antigravity from your work account to your personal one, and back. No re-login, no browser, no copying tokens around -- and the switch itself never touches the network. (One opt-in command, swapdex quota, reads your remaining balance from Anthropic; nothing else does.)

<div align="center" <img src="https://raw.githubusercontent.com/youdie006/swapdex/main/docs/demo.gif" alt="swapdex demo: ls, use personal, status, restore, doctor" width="760" / </div

---

Why

If you run Claude Code, Codex, Gemini CLI, or Antigravity under more than one account -- a work seat and a personal subscription, a client's org and your own -- switching means logging out and back in every time.

swapdex gives each account its own permanent space -- its own CLAUDECONFIGDIR slot -- and flips between them without ever copying a token. swapdex use work points your default account there and a plain claude follows it; swapdex run work launches straight into that account (each terminal can be a different one). Because nothing is copied, a switch can never log an account out -- even if a session is still running when you switch. swapdex onboard sets this up in a few prompts.

It is a switcher, not a rotator. It manages accounts you already own for distinct purposes, with no feature for cycling them to get around a rate limit -- see What it will not do.

Safety is the design center: in the slot model swapdex never writes a credential at all -- each account's own login creates and refreshes its token, in its own slot -- and it only ever hands the official CLI its own credentials: no wrapper, no proxy, no client spoofing.

Concepts

  • Account -- one login you own (a work seat, a personal subscription). Its

redacted identity (email, tier) is shown by slots, status, and doctor; never a token.

  • Slot -- an account's own permanent CLAUDECONFIGDIR, where its login

lives and refreshes in place. swapdex creates one per account (or adopts a ~/.claude- dir you already use) and never copies tokens between them.

  • Default account -- the one a plain claude uses, via a tiny shim on your

PATH. swapdex use <name repoints it; swapdex run <name ignores it and launches a specific account directly.