@karpeleslab/teamclaude 1.0.4 → 1.0.5

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 (3) hide show
  1. package/README.md +29 -29
  2. package/package.json +1 -1
  3. package/src/index.js +10 -3
package/README.md CHANGED
@@ -10,8 +10,9 @@ Sits transparently between Claude Code and the Anthropic API, managing multiple
10
10
 
11
11
  - **Automatic account rotation** — switches to the next account when session (5h) or weekly (7d) quota reaches the configured threshold (default 98%)
12
12
  - **Auto-retry on 429** — if an account is rate-limited, transparently retries with the next one
13
- - **Interactive TUI** — real-time dashboard with quota bars, activity log, and keyboard controls
14
- - **OAuth token refresh** — proactively refreshes expiring tokens and persists them to config
13
+ - **Interactive TUI** — real-time dashboard with color-coded quota bars showing reset countdowns, activity log, and keyboard controls
14
+ - **OAuth token refresh** — proactively refreshes expiring tokens, intercepts client token renewals, and persists them to config
15
+ - **Hot-reload accounts** — add accounts via `import` or `login` while the server is running, press **R** to pick them up
15
16
  - **Request logging** — optional full request/response logging for debugging
16
17
  - **Zero dependencies** — uses only Node.js built-in modules
17
18
 
@@ -23,12 +24,11 @@ Requires Node.js 18+.
23
24
  # Install
24
25
  npm install -g @karpeleslab/teamclaude
25
26
 
26
- # Import your current Claude Code credentials
27
- teamclaude import
27
+ # Add your first account (opens browser for OAuth)
28
+ teamclaude login
28
29
 
29
- # Import a second account (log into it in Claude Code first, then import)
30
- # claude /login
31
- # teamclaude import
30
+ # Add a second account
31
+ teamclaude login
32
32
 
33
33
  # Start the proxy
34
34
  teamclaude server
@@ -37,27 +37,37 @@ teamclaude server
37
37
  teamclaude run
38
38
  ```
39
39
 
40
+ You can also import existing Claude Code credentials instead of logging in:
41
+
42
+ ```bash
43
+ claude /login # Log into an account in Claude Code
44
+ teamclaude import # Import its credentials
45
+ ```
46
+
40
47
  ## Adding Accounts
41
48
 
42
- ### Import from Claude Code (recommended)
49
+ ### OAuth Login (recommended)
43
50
 
44
- The easiest way to add accounts. Log into each account in Claude Code, then import:
51
+ The easiest way to add accounts opens your browser for authentication:
45
52
 
46
53
  ```bash
47
- # Log into your first account in Claude Code
48
- claude /login
54
+ teamclaude login
55
+ ```
56
+
57
+ Uses the same OAuth flow as Claude Code. Auto-detects the account email and subscription tier. Logging in with the same account again updates its credentials.
49
58
 
50
- # Import it
51
- teamclaude import
59
+ You can add accounts while the server is running — press **R** in the TUI to reload.
52
60
 
53
- # Switch to another account in Claude Code
54
- claude /login
61
+ ### Import from Claude Code
55
62
 
56
- # Import that one too
57
- teamclaude import
63
+ If you already have Claude Code set up, you can import its credentials directly:
64
+
65
+ ```bash
66
+ claude /login # Log into an account in Claude Code
67
+ teamclaude import # Import its credentials
58
68
  ```
59
69
 
60
- Each import auto-detects the account email and subscription tier. Re-importing the same account updates its credentials.
70
+ Re-importing the same account updates its credentials.
61
71
 
62
72
  ### API Key
63
73
 
@@ -67,16 +77,6 @@ For Anthropic API key accounts (billed via Console):
67
77
  teamclaude login --api
68
78
  ```
69
79
 
70
- ### OAuth Login (experimental)
71
-
72
- Direct browser-based OAuth login without needing Claude Code:
73
-
74
- ```bash
75
- teamclaude login
76
- ```
77
-
78
- > **Note:** OAuth login is currently experimental. Tokens obtained this way may not work for proxying `/v1/messages` requests. Use `teamclaude import` as the reliable method.
79
-
80
80
  ## Usage
81
81
 
82
82
  ### Start the proxy server
@@ -88,7 +88,7 @@ teamclaude server
88
88
  When running from a TTY, shows an interactive TUI with:
89
89
  - Account table with session/weekly quota progress bars
90
90
  - Real-time activity log with request tracking
91
- - Keyboard shortcuts: **s**witch, **a**dd, **r**emove, **q**uit
91
+ - Keyboard shortcuts: **s**witch, **a**dd, **r**emove, **R**eload, **q**uit
92
92
 
93
93
  Falls back to plain log output when not a TTY (e.g. running as a service).
94
94
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@karpeleslab/teamclaude",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "Multi-account Claude proxy with automatic quota-based rotation",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
package/src/index.js CHANGED
@@ -15,29 +15,36 @@ switch (command) {
15
15
  case 'server':
16
16
  await serverCommand();
17
17
  break;
18
+ case 'run':
19
+ await runCommand();
20
+ break;
18
21
  case 'import':
19
22
  await importCommand();
23
+ process.exit(0);
20
24
  break;
21
25
  case 'login':
22
26
  await loginCommand();
27
+ process.exit(0);
23
28
  break;
24
29
  case 'env':
25
30
  await envCommand();
26
- break;
27
- case 'run':
28
- await runCommand();
31
+ process.exit(0);
29
32
  break;
30
33
  case 'status':
31
34
  await statusCommand();
35
+ process.exit(0);
32
36
  break;
33
37
  case 'accounts':
34
38
  await accountsCommand();
39
+ process.exit(0);
35
40
  break;
36
41
  case 'remove':
37
42
  await removeCommand();
43
+ process.exit(0);
38
44
  break;
39
45
  case 'api':
40
46
  await apiCommand();
47
+ process.exit(0);
41
48
  break;
42
49
  case 'help':
43
50
  case '--help':