@youdie006/swapdex 0.4.2 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -8
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
|
|
9
9
|
</div>
|
|
10
10
|
|
|
11
|
-
One command to flip your Claude Code or
|
|
12
|
-
personal one, and back. No re-login, no browser, no copying
|
|
13
|
-
100% local. Never touches the network.
|
|
11
|
+
One command to flip your Claude Code, Codex, or Gemini CLI from your work
|
|
12
|
+
account to your personal one, and back. No re-login, no browser, no copying
|
|
13
|
+
tokens around. 100% local. Never touches the network.
|
|
14
14
|
|
|
15
15
|
<div align="center">
|
|
16
16
|
<img src="https://raw.githubusercontent.com/youdie006/swapdex/main/docs/demo.gif" alt="swapdex demo: ls, use personal, status, restore, doctor" width="760" />
|
|
@@ -20,7 +20,7 @@ personal one, and back. No re-login, no browser, no copying tokens around.
|
|
|
20
20
|
|
|
21
21
|
## Why
|
|
22
22
|
|
|
23
|
-
If you run Claude Code or
|
|
23
|
+
If you run Claude Code, Codex, or Gemini CLI under more than one account -- a work seat and a
|
|
24
24
|
personal subscription, a client's org and your own -- switching means logging
|
|
25
25
|
out and back in every time. swapdex snapshots each logged-in account once, then
|
|
26
26
|
swaps between them in place: the running CLI picks up the new account on your
|
|
@@ -133,12 +133,14 @@ been using each tool lately, so you know when to switch to a fresher account:
|
|
|
133
133
|
```
|
|
134
134
|
Local usage - this machine, approximate (not the billed quota):
|
|
135
135
|
claude-code 5h: 8.2M tok / 12 sess 7d: 61.4M tok / 88 sess
|
|
136
|
-
|
|
136
|
+
@work 5h: 6.0M tok 7d: 40.1M tok
|
|
137
|
+
@personal 5h: 2.2M tok 7d: 19.3M tok
|
|
137
138
|
```
|
|
138
139
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
140
|
+
Once a switch history exists, tokens are attributed to the profile active at
|
|
141
|
+
each event's timestamp (the same honest join `sessions` uses); anything before
|
|
142
|
+
your first switch stays untagged. Still deliberately a hint, not a
|
|
143
|
+
quota-dodging auto-rotator.
|
|
142
144
|
|
|
143
145
|
## How it works
|
|
144
146
|
|
|
@@ -147,6 +149,7 @@ Each CLI keeps its login in a small on-disk file:
|
|
|
147
149
|
- Claude Code: `~/.claude/.credentials.json` plus the `oauthAccount` block inside
|
|
148
150
|
`~/.claude.json`
|
|
149
151
|
- Codex: `~/.codex/auth.json`
|
|
152
|
+
- Gemini CLI: `~/.gemini/oauth_creds.json` plus `~/.gemini/google_accounts.json`
|
|
150
153
|
|
|
151
154
|
`add` copies the current login into a private store at
|
|
152
155
|
`~/.local/share/swapdex`. `use` writes a saved snapshot back into place
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@youdie006/swapdex",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Switch between multiple Claude Code and
|
|
3
|
+
"version": "0.5.0",
|
|
4
|
+
"description": "Switch between multiple Claude Code, Codex, and Gemini CLI login accounts, locally and safely.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"swapdex": "bin/swapdex.js"
|
|
7
7
|
},
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
"cli",
|
|
19
19
|
"claude",
|
|
20
20
|
"codex",
|
|
21
|
+
"gemini",
|
|
21
22
|
"accounts",
|
|
22
23
|
"credentials"
|
|
23
24
|
],
|