@youdie006/swapdex 0.20.0 → 0.22.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.
Files changed (2) hide show
  1. package/README.md +41 -7
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -4,13 +4,15 @@
4
4
 
5
5
  [![CI](https://github.com/youdie006/swapdex/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/youdie006/swapdex/actions/workflows/ci.yml)
6
6
  [![license](https://img.shields.io/badge/license-MIT-1e1d1a.svg)](LICENSE)
7
- [![local only](https://img.shields.io/badge/network-none-7a3be0.svg)](#what-it-will-not-do)
7
+ [![switcher: no network](https://img.shields.io/badge/switcher-no%20network-7a3be0.svg)](#what-it-will-not-do)
8
8
 
9
9
  </div>
10
10
 
11
11
  One command to flip your Claude Code, Codex, Gemini CLI, or Antigravity from
12
12
  your work account to your personal one, and back. No re-login, no browser, no copying
13
- tokens around. 100% local. Never touches the network.
13
+ tokens around -- and the switch itself never touches the network. (One opt-in
14
+ command, `swapdex quota`, reads your remaining balance from Anthropic; nothing
15
+ else does.)
14
16
 
15
17
  <div align="center">
16
18
  <img src="https://raw.githubusercontent.com/youdie006/swapdex/main/docs/demo.gif" alt="swapdex demo: ls, use personal, status, restore, doctor" width="760" />
@@ -93,6 +95,9 @@ swapdex sessions
93
95
  # Recent local token usage per tool (5h/7d) -- tells you when to switch
94
96
  swapdex usage
95
97
 
98
+ # Remaining quota per Claude account -- the one opt-in network read
99
+ swapdex quota
100
+
96
101
  # Made a bad switch? Put back the login that was live before it
97
102
  swapdex restore
98
103
 
@@ -146,6 +151,29 @@ each event's timestamp (the same honest join `sessions` uses); anything before
146
151
  your first switch stays untagged. Still deliberately a hint, not a
147
152
  quota-dodging auto-rotator.
148
153
 
154
+ Where `usage` is your local activity, `quota` is the vendor's actual remaining
155
+ balance -- the one command that reaches the network, and only when you run it:
156
+
157
+ ```
158
+ $ swapdex quota
159
+ quota - remaining on your Claude accounts
160
+ live from Anthropic's usage endpoint; opt-in network, spends 0 message quota.
161
+
162
+ work (active) you@work.com
163
+ 5h ▓▓▓▓▓▓▓░░░ 68% left resets in 2h14m
164
+ 7d ▓▓▓▓▓▓░░░░ 57% left resets in 3d 4h
165
+
166
+ personal you@personal.com
167
+ snapshot token expired - `swapdex use personal` to refresh, then `swapdex quota`
168
+ ```
169
+
170
+ It reads each account's remaining quota from Anthropic's official OAuth usage
171
+ endpoint using that account's **own** token -- read-only, and it spends zero
172
+ message quota. The active account is always live; a saved account whose token
173
+ has expired reports so rather than showing a stale number (swapdex never
174
+ refreshes tokens -- that is the line between a switcher and a rotator). It is
175
+ also in `swapdex ui` under the `%` key.
176
+
149
177
  ## How it works
150
178
 
151
179
  Each CLI keeps its login in a small on-disk file:
@@ -186,9 +214,14 @@ single-user by design).
186
214
  These are structural properties, not promises -- the code is built so they
187
215
  cannot happen:
188
216
 
189
- - **No network, ever.** The switching binary has no HTTP client in its
190
- dependency graph (CI asserts this on every commit). swapdex cannot phone home
191
- or exfiltrate a token.
217
+ - **No HTTP client, no background network.** The binary has no HTTP client in
218
+ its dependency graph (CI asserts this on every commit), so it cannot phone
219
+ home or exfiltrate a token. Switching, `ls`, `status`, `usage` -- all 100%
220
+ local. The one exception is the opt-in `swapdex quota` command, which shells
221
+ out to `curl` to read your *own* remaining balance from Anthropic's official
222
+ usage endpoint (that account's own token, read-only, spends zero message
223
+ quota). It runs only when you type it, sends no data anywhere, and touches no
224
+ other endpoint.
192
225
  - **No auto-rotation.** There is no `--auto`, `--next`, or
193
226
  `--when-rate-limited` flag. `use` only ever switches to a name you type.
194
227
  - **No token export.** There is no command that prints a saved credential.
@@ -246,8 +279,9 @@ that project's README, July 2026):
246
279
  philosophical opposite of swapdex.
247
280
 
248
281
  Pick swapdex if you want the smallest thing that switches Claude Code and
249
- Codex together, can always undo (`restore`), diagnoses itself (`doctor`),
250
- and structurally cannot rotate, proxy, or touch the network.
282
+ Codex together, can always undo (`restore`), diagnoses itself (`doctor`), shows
283
+ your remaining balance (`quota`), and structurally cannot rotate, proxy, or
284
+ spoof the official client.
251
285
 
252
286
  ## Roadmap
253
287
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@youdie006/swapdex",
3
- "version": "0.20.0",
3
+ "version": "0.22.0",
4
4
  "description": "Switch between multiple Claude Code, Codex, Gemini, and Antigravity login accounts, locally and safely.",
5
5
  "bin": {
6
6
  "swapdex": "bin/swapdex.js"