caflip 0.3.1 → 0.3.3
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 +7 -3
- package/dist/cli.js +17 -14
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -63,7 +63,7 @@ bun run dev -- help
|
|
|
63
63
|
## Quick Start
|
|
64
64
|
|
|
65
65
|
```bash
|
|
66
|
-
# Show current account / managed accounts across both providers
|
|
66
|
+
# Show current active account / all managed accounts across both providers
|
|
67
67
|
caflip status
|
|
68
68
|
caflip list
|
|
69
69
|
|
|
@@ -110,7 +110,7 @@ After switching, restart the target CLI (Claude Code or Codex) to pick up new au
|
|
|
110
110
|
|---|---|
|
|
111
111
|
| `caflip` | Interactive provider picker (Claude/Codex) |
|
|
112
112
|
| `caflip list` | List managed accounts for Claude and Codex |
|
|
113
|
-
| `caflip status` | Show current account for Claude and Codex |
|
|
113
|
+
| `caflip status` | Show current active account for Claude and Codex |
|
|
114
114
|
| `caflip add [--alias name]` | Pick provider, then add current account |
|
|
115
115
|
| `caflip login [-- <args...>]` | Pick provider, then run provider login and register the resulting session |
|
|
116
116
|
| `caflip remove [email]` | Pick provider, then remove an account |
|
|
@@ -123,7 +123,7 @@ After switching, restart the target CLI (Claude Code or Codex) to pick up new au
|
|
|
123
123
|
| `caflip [provider] login [-- <args...>]` | Run provider login and register the resulting session |
|
|
124
124
|
| `caflip [provider] remove [email]` | Remove an account |
|
|
125
125
|
| `caflip [provider] next` | Rotate to next account |
|
|
126
|
-
| `caflip [provider] status` | Show current account |
|
|
126
|
+
| `caflip [provider] status` | Show current active account |
|
|
127
127
|
| `caflip [provider] alias <name> [email]` | Set alias for current or target account |
|
|
128
128
|
| `caflip help` | Show help |
|
|
129
129
|
|
|
@@ -153,6 +153,10 @@ caflip claude login -- --email lucien@aibor.io --sso
|
|
|
153
153
|
caflip codex login -- --device-auth
|
|
154
154
|
```
|
|
155
155
|
|
|
156
|
+
`status` shows the currently active account for the selected provider. It does not list every saved account.
|
|
157
|
+
|
|
158
|
+
Use `list` when you want to inspect all managed accounts for a provider.
|
|
159
|
+
|
|
156
160
|
## Shell Prompt Integration
|
|
157
161
|
|
|
158
162
|
Show the current account in your prompt:
|
package/dist/cli.js
CHANGED
|
@@ -617,7 +617,7 @@ function validateAlias(alias) {
|
|
|
617
617
|
// package.json
|
|
618
618
|
var package_default = {
|
|
619
619
|
name: "caflip",
|
|
620
|
-
version: "0.3.
|
|
620
|
+
version: "0.3.3",
|
|
621
621
|
type: "module",
|
|
622
622
|
bin: {
|
|
623
623
|
caflip: "bin/caflip"
|
|
@@ -3573,20 +3573,21 @@ async function cmdStatus(options) {
|
|
|
3573
3573
|
}
|
|
3574
3574
|
if (summary.email === "none") {
|
|
3575
3575
|
console.log("none");
|
|
3576
|
+
} else if (summary.alias) {
|
|
3577
|
+
console.log(`${summary.email} [${summary.alias}]`);
|
|
3576
3578
|
} else {
|
|
3577
|
-
if (summary.alias) {
|
|
3578
|
-
console.log(`${summary.email} [${summary.alias}]`);
|
|
3579
|
-
return;
|
|
3580
|
-
}
|
|
3581
3579
|
console.log(summary.email);
|
|
3582
3580
|
}
|
|
3581
|
+
console.log(`managed accounts: ${summary.managedCount}`);
|
|
3583
3582
|
}
|
|
3584
3583
|
async function getStatusSummaryForActiveProvider() {
|
|
3585
3584
|
const email = getCurrentAccount();
|
|
3586
3585
|
let alias = null;
|
|
3587
3586
|
let managed = false;
|
|
3587
|
+
let managedCount = 0;
|
|
3588
3588
|
if (email !== "none" && existsSync9(activeSequenceFile)) {
|
|
3589
3589
|
const seq = await loadSequence(activeSequenceFile);
|
|
3590
|
+
managedCount = Object.keys(seq.accounts).length;
|
|
3590
3591
|
for (const account of Object.values(seq.accounts)) {
|
|
3591
3592
|
if (account.email === email) {
|
|
3592
3593
|
managed = true;
|
|
@@ -3594,8 +3595,11 @@ async function getStatusSummaryForActiveProvider() {
|
|
|
3594
3595
|
break;
|
|
3595
3596
|
}
|
|
3596
3597
|
}
|
|
3598
|
+
} else if (existsSync9(activeSequenceFile)) {
|
|
3599
|
+
const seq = await loadSequence(activeSequenceFile);
|
|
3600
|
+
managedCount = Object.keys(seq.accounts).length;
|
|
3597
3601
|
}
|
|
3598
|
-
return { email, alias, managed };
|
|
3602
|
+
return { email, alias, managed, managedCount };
|
|
3599
3603
|
}
|
|
3600
3604
|
async function withActiveProvider(provider, fn) {
|
|
3601
3605
|
const previousProvider = activeProvider.name;
|
|
@@ -3645,13 +3649,12 @@ async function cmdStatusAllProviders() {
|
|
|
3645
3649
|
console.log(summary.heading);
|
|
3646
3650
|
if (summary.email === "none") {
|
|
3647
3651
|
console.log(" none");
|
|
3648
|
-
|
|
3649
|
-
}
|
|
3650
|
-
if (summary.alias) {
|
|
3652
|
+
} else if (summary.alias) {
|
|
3651
3653
|
console.log(` ${summary.email} [${summary.alias}]`);
|
|
3652
|
-
|
|
3654
|
+
} else {
|
|
3655
|
+
console.log(` ${summary.email}`);
|
|
3653
3656
|
}
|
|
3654
|
-
console.log(` ${summary.
|
|
3657
|
+
console.log(` managed accounts: ${summary.managedCount}`);
|
|
3655
3658
|
}
|
|
3656
3659
|
}
|
|
3657
3660
|
async function cmdAlias(alias, identifier) {
|
|
@@ -3723,7 +3726,7 @@ Usage:
|
|
|
3723
3726
|
Commands:
|
|
3724
3727
|
(no args) Interactive provider picker
|
|
3725
3728
|
list List managed accounts for all providers
|
|
3726
|
-
status Show current account for all providers
|
|
3729
|
+
status Show current active account for all providers
|
|
3727
3730
|
add [--alias <name>] Pick provider, then add current account
|
|
3728
3731
|
login [-- <args...>] Pick provider, then run provider login
|
|
3729
3732
|
remove [<email>] Pick provider, then remove an account
|
|
@@ -3734,14 +3737,14 @@ Commands:
|
|
|
3734
3737
|
<provider> login [-- <args...>] Run provider login and register session
|
|
3735
3738
|
<provider> remove [<email>] Remove an account
|
|
3736
3739
|
<provider> next Rotate to next account
|
|
3737
|
-
<provider> status [--json] Show current account
|
|
3740
|
+
<provider> status [--json] Show current active account
|
|
3738
3741
|
<provider> alias <name> [<email>] Set alias for current or target account
|
|
3739
3742
|
help Show this help
|
|
3740
3743
|
|
|
3741
3744
|
Examples:
|
|
3742
3745
|
caflip Pick provider interactively
|
|
3743
3746
|
caflip list List managed accounts for Claude and Codex
|
|
3744
|
-
caflip status Show current account for Claude and Codex
|
|
3747
|
+
caflip status Show current active account for Claude and Codex
|
|
3745
3748
|
caflip add Pick provider, then add current account
|
|
3746
3749
|
caflip login Pick provider, then run provider login
|
|
3747
3750
|
caflip remove Pick provider, then remove an account interactively
|