caflip 0.2.0 → 0.3.1
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 +56 -4
- package/dist/cli.js +725 -248
- package/install.sh +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,11 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
A fast account switcher for coding agents like Claude Code and Codex.
|
|
4
4
|
|
|
5
|
-

|
|
6
|
+
Pick provider first, then switch account.
|
|
6
7
|
|
|
7
8
|
caflip is built for one job: if you have multiple Claude or Codex accounts, switch between them quickly.
|
|
8
9
|
|
|
9
|
-
Today, caflip
|
|
10
|
+
Today, caflip supports both Claude Code and Codex accounts. Your skills, settings, themes, `CLAUDE.md`, MCP servers, keybindings, and all other configuration stay exactly the same while switching accounts.
|
|
10
11
|
|
|
11
12
|
Use case: you have personal/work Claude or Codex accounts and want to switch quickly without re-login flows every time.
|
|
12
13
|
|
|
@@ -16,7 +17,7 @@ Use case: you have personal/work Claude or Codex accounts and want to switch qui
|
|
|
16
17
|
| Platform | Credential Storage |
|
|
17
18
|
|---|---|
|
|
18
19
|
| macOS | System Keychain |
|
|
19
|
-
| Linux | `secret-tool`
|
|
20
|
+
| Linux | `CLAUDE_CONFIG_DIR/.credentials.json` when set, otherwise `~/.claude/.credentials.json`; `secret-tool` is kept as compatibility sync |
|
|
20
21
|
| WSL | Same as Linux |
|
|
21
22
|
| Windows | Not yet supported |
|
|
22
23
|
|
|
@@ -28,6 +29,12 @@ Use case: you have personal/work Claude or Codex accounts and want to switch qui
|
|
|
28
29
|
curl -fsSL https://raw.githubusercontent.com/LucienLee/caflip/main/install.sh | bash
|
|
29
30
|
```
|
|
30
31
|
|
|
32
|
+
To uninstall the standalone binary installed by this script:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
curl -fsSL https://raw.githubusercontent.com/LucienLee/caflip/main/uninstall.sh | bash
|
|
36
|
+
```
|
|
37
|
+
|
|
31
38
|
### Via npm (Node.js)
|
|
32
39
|
|
|
33
40
|
```bash
|
|
@@ -40,6 +47,13 @@ npm install -g caflip
|
|
|
40
47
|
bun install -g caflip
|
|
41
48
|
```
|
|
42
49
|
|
|
50
|
+
For package-manager installs, uninstall with the same package manager:
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
npm uninstall -g caflip
|
|
54
|
+
bun remove -g caflip
|
|
55
|
+
```
|
|
56
|
+
|
|
43
57
|
### Local Development
|
|
44
58
|
|
|
45
59
|
```bash
|
|
@@ -49,6 +63,15 @@ bun run dev -- help
|
|
|
49
63
|
## Quick Start
|
|
50
64
|
|
|
51
65
|
```bash
|
|
66
|
+
# Show current account / managed accounts across both providers
|
|
67
|
+
caflip status
|
|
68
|
+
caflip list
|
|
69
|
+
|
|
70
|
+
# Pick provider interactively, then add/remove/login
|
|
71
|
+
caflip add
|
|
72
|
+
caflip remove
|
|
73
|
+
caflip login
|
|
74
|
+
|
|
52
75
|
# Add your first Claude account (must already be logged in)
|
|
53
76
|
caflip claude add --alias personal
|
|
54
77
|
|
|
@@ -69,6 +92,14 @@ caflip claude next
|
|
|
69
92
|
caflip codex add --alias codex-work
|
|
70
93
|
caflip codex list
|
|
71
94
|
caflip codex next
|
|
95
|
+
|
|
96
|
+
# Run official provider login through caflip, then register the session
|
|
97
|
+
caflip claude login
|
|
98
|
+
caflip codex login
|
|
99
|
+
|
|
100
|
+
# Pass provider-specific flags after --
|
|
101
|
+
caflip claude login -- --email lucien@aibor.io --sso
|
|
102
|
+
caflip codex login -- --device-auth
|
|
72
103
|
```
|
|
73
104
|
|
|
74
105
|
After switching, restart the target CLI (Claude Code or Codex) to pick up new authentication.
|
|
@@ -78,12 +109,18 @@ After switching, restart the target CLI (Claude Code or Codex) to pick up new au
|
|
|
78
109
|
| Command | Description |
|
|
79
110
|
|---|---|
|
|
80
111
|
| `caflip` | Interactive provider picker (Claude/Codex) |
|
|
112
|
+
| `caflip list` | List managed accounts for Claude and Codex |
|
|
113
|
+
| `caflip status` | Show current account for Claude and Codex |
|
|
114
|
+
| `caflip add [--alias name]` | Pick provider, then add current account |
|
|
115
|
+
| `caflip login [-- <args...>]` | Pick provider, then run provider login and register the resulting session |
|
|
116
|
+
| `caflip remove [email]` | Pick provider, then remove an account |
|
|
81
117
|
| `caflip claude [command]` | Run command for Claude provider |
|
|
82
118
|
| `caflip codex [command]` | Run command for Codex provider |
|
|
83
119
|
| `caflip [provider]` | Interactive account picker for that provider |
|
|
84
120
|
| `caflip [provider] <alias>` | Switch by alias for that provider |
|
|
85
121
|
| `caflip [provider] list` | List managed accounts |
|
|
86
122
|
| `caflip [provider] add [--alias name]` | Add current account |
|
|
123
|
+
| `caflip [provider] login [-- <args...>]` | Run provider login and register the resulting session |
|
|
87
124
|
| `caflip [provider] remove [email]` | Remove an account |
|
|
88
125
|
| `caflip [provider] next` | Rotate to next account |
|
|
89
126
|
| `caflip [provider] status` | Show current account |
|
|
@@ -103,7 +140,18 @@ caflip claude alias work hi.lucienlee@gmail.com
|
|
|
103
140
|
caflip codex alias work me@company.com
|
|
104
141
|
```
|
|
105
142
|
|
|
106
|
-
`remove`
|
|
143
|
+
`add`, `remove`, and `login` can be used without a provider prefix. In that case, caflip asks you to choose Claude or Codex first, then continues the normal command flow.
|
|
144
|
+
|
|
145
|
+
`remove` target accepts email only. Omit it to choose from the interactive picker after selecting a provider.
|
|
146
|
+
|
|
147
|
+
`login` can be used without arguments for the default login flow. Pass provider-specific flags after `--`:
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
caflip login
|
|
151
|
+
caflip claude login
|
|
152
|
+
caflip claude login -- --email lucien@aibor.io --sso
|
|
153
|
+
caflip codex login -- --device-auth
|
|
154
|
+
```
|
|
107
155
|
|
|
108
156
|
## Shell Prompt Integration
|
|
109
157
|
|
|
@@ -119,6 +167,10 @@ Account data lives in:
|
|
|
119
167
|
- `~/.caflip-backup/claude/`
|
|
120
168
|
- `~/.caflip-backup/codex/`
|
|
121
169
|
|
|
170
|
+
On Linux and WSL, caflip follows Claude's config root for active Claude credentials and config:
|
|
171
|
+
- if `CLAUDE_CONFIG_DIR` is set, caflip reads `"$CLAUDE_CONFIG_DIR/.credentials.json"` and `"$CLAUDE_CONFIG_DIR/.claude.json"`
|
|
172
|
+
- otherwise it falls back to `~/.claude/.credentials.json` and then Claude's standard config lookup
|
|
173
|
+
|
|
122
174
|
## Credits
|
|
123
175
|
|
|
124
176
|
Inspired by [cc-account-switcher](https://github.com/ming86/cc-account-switcher).
|