@whop/cli 0.0.5 → 0.0.6
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 +1 -0
- package/dist/{api-NBD5G47Q.js → api-XJ22R3CT.js} +4 -3
- package/dist/{chunk-TZPTBY4K.js → chunk-CXNQ6UGC.js} +1104 -12743
- package/dist/chunk-CXNQ6UGC.js.map +1 -0
- package/dist/chunk-MELVTXNG.js +24 -0
- package/dist/{chunk-O66TV7ZF.js → chunk-Z7WDX64Z.js} +1543 -7884
- package/dist/chunk-Z7WDX64Z.js.map +1 -0
- package/dist/dist-FTK7GWLH.js +11661 -0
- package/dist/dist-FTK7GWLH.js.map +1 -0
- package/dist/dist-RLB3XRTU.js +7296 -0
- package/dist/dist-RLB3XRTU.js.map +1 -0
- package/dist/index.js +49 -9
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/dist/chunk-O66TV7ZF.js.map +0 -1
- package/dist/chunk-TZPTBY4K.js.map +0 -1
- package/dist/dist-3D5NI5BW.js +0 -123
- /package/dist/{api-NBD5G47Q.js.map → api-XJ22R3CT.js.map} +0 -0
- /package/dist/{dist-3D5NI5BW.js.map → chunk-MELVTXNG.js.map} +0 -0
package/dist/index.js
CHANGED
|
@@ -20,6 +20,7 @@ import {
|
|
|
20
20
|
performOAuthLogin,
|
|
21
21
|
promptApiKey,
|
|
22
22
|
readConfig,
|
|
23
|
+
removeAllProfiles,
|
|
23
24
|
removeProfile,
|
|
24
25
|
resolveActiveCompanyId,
|
|
25
26
|
selectProfile,
|
|
@@ -27,10 +28,11 @@ import {
|
|
|
27
28
|
switchProfile,
|
|
28
29
|
upsertProfile,
|
|
29
30
|
validateApiKey
|
|
30
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-Z7WDX64Z.js";
|
|
31
32
|
import {
|
|
32
33
|
external_exports
|
|
33
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-CXNQ6UGC.js";
|
|
35
|
+
import "./chunk-MELVTXNG.js";
|
|
34
36
|
|
|
35
37
|
// src/api/groups.json
|
|
36
38
|
var groups_default = [
|
|
@@ -132,10 +134,11 @@ var loginOutput = external_exports.object({
|
|
|
132
134
|
identity: Identity.describe("The authenticated account or user identity")
|
|
133
135
|
});
|
|
134
136
|
var logoutOptions = external_exports.object({
|
|
135
|
-
profile: external_exports.string().optional().describe("Profile to remove (defaults to the active profile)")
|
|
137
|
+
profile: external_exports.string().optional().describe("Profile to remove (defaults to the active profile)"),
|
|
138
|
+
all: external_exports.boolean().optional().describe("Remove every profile and its stored secret (full reset)")
|
|
136
139
|
});
|
|
137
140
|
var logoutOutput = external_exports.object({
|
|
138
|
-
removed: external_exports.string().describe("The removed profile name"),
|
|
141
|
+
removed: external_exports.array(external_exports.string()).describe("The removed profile name(s)"),
|
|
139
142
|
newActive: external_exports.string().nullable().describe("The profile that is now active, if any")
|
|
140
143
|
});
|
|
141
144
|
var statusOutput = external_exports.object({
|
|
@@ -297,7 +300,7 @@ async function loginAdapter(c2) {
|
|
|
297
300
|
const companyId = getActiveProfile()?.companyId ?? "";
|
|
298
301
|
if (companyId) {
|
|
299
302
|
try {
|
|
300
|
-
const { createWhopFetch: createWhopFetch2 } = await import("./api-
|
|
303
|
+
const { createWhopFetch: createWhopFetch2 } = await import("./api-XJ22R3CT.js");
|
|
301
304
|
const fetch2 = createWhopFetch2();
|
|
302
305
|
const res = await fetch2(
|
|
303
306
|
new Request(
|
|
@@ -346,6 +349,36 @@ async function loginAdapter(c2) {
|
|
|
346
349
|
});
|
|
347
350
|
}
|
|
348
351
|
function logoutAdapter(c2) {
|
|
352
|
+
if (c2.options.all) {
|
|
353
|
+
if (c2.options.profile) {
|
|
354
|
+
return c2.error({
|
|
355
|
+
code: "CONFLICTING_OPTIONS",
|
|
356
|
+
message: "--all removes every profile \u2014 don't combine it with --profile.",
|
|
357
|
+
retryable: true
|
|
358
|
+
});
|
|
359
|
+
}
|
|
360
|
+
const removed2 = removeAllProfiles();
|
|
361
|
+
if (removed2.length === 0) {
|
|
362
|
+
return c2.error({
|
|
363
|
+
code: "NO_PROFILES",
|
|
364
|
+
message: "No profiles to remove.",
|
|
365
|
+
retryable: false,
|
|
366
|
+
cta: {
|
|
367
|
+
description: "Log in first:",
|
|
368
|
+
commands: [{ command: "auth login", description: "Log in to Whop" }]
|
|
369
|
+
}
|
|
370
|
+
});
|
|
371
|
+
}
|
|
372
|
+
return c2.ok(
|
|
373
|
+
{ removed: removed2, newActive: null },
|
|
374
|
+
{
|
|
375
|
+
cta: {
|
|
376
|
+
description: `Removed ${removed2.length} profile${removed2.length === 1 ? "" : "s"}. To authenticate again:`,
|
|
377
|
+
commands: [{ command: "auth login", description: "Log in to Whop" }]
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
);
|
|
381
|
+
}
|
|
349
382
|
const target = c2.options.profile ?? getActiveProfile()?.name;
|
|
350
383
|
if (!target) {
|
|
351
384
|
return c2.error({
|
|
@@ -367,7 +400,7 @@ function logoutAdapter(c2) {
|
|
|
367
400
|
});
|
|
368
401
|
}
|
|
369
402
|
return c2.ok(
|
|
370
|
-
{ removed: target, newActive },
|
|
403
|
+
{ removed: [target], newActive },
|
|
371
404
|
newActive ? {
|
|
372
405
|
cta: {
|
|
373
406
|
description: `Now using "${newActive}".`,
|
|
@@ -396,10 +429,17 @@ function buildAuthGroup() {
|
|
|
396
429
|
run: (c2) => loginAdapter(c2)
|
|
397
430
|
});
|
|
398
431
|
auth.command("logout", {
|
|
399
|
-
description: "Log out \u2014 remove a saved profile",
|
|
432
|
+
description: "Log out \u2014 remove a saved profile, or all with --all",
|
|
400
433
|
aliases: ["remove", "rm"],
|
|
401
434
|
options: logoutOptions,
|
|
402
435
|
output: logoutOutput,
|
|
436
|
+
examples: [
|
|
437
|
+
{ description: "Remove the active profile" },
|
|
438
|
+
{
|
|
439
|
+
options: { all: true },
|
|
440
|
+
description: "Remove every profile (full reset)"
|
|
441
|
+
}
|
|
442
|
+
],
|
|
403
443
|
run: (c2) => logoutAdapter(c2)
|
|
404
444
|
});
|
|
405
445
|
auth.command("switch", {
|
|
@@ -1598,7 +1638,7 @@ async function setupAgents(cli2) {
|
|
|
1598
1638
|
// package.json
|
|
1599
1639
|
var package_default = {
|
|
1600
1640
|
name: "@whop/cli",
|
|
1601
|
-
version: "0.0.
|
|
1641
|
+
version: "0.0.6",
|
|
1602
1642
|
description: "The Whop CLI \u2014 build and manage Whop apps from your terminal. Human and agent friendly.",
|
|
1603
1643
|
keywords: [
|
|
1604
1644
|
"agent",
|
|
@@ -1647,7 +1687,7 @@ var package_default = {
|
|
|
1647
1687
|
},
|
|
1648
1688
|
devDependencies: {
|
|
1649
1689
|
"@types/node": "25.3.5",
|
|
1650
|
-
incur: "github:whopio/incur#
|
|
1690
|
+
incur: "github:whopio/incur#5ca60d5",
|
|
1651
1691
|
tsup: "8.5.0",
|
|
1652
1692
|
tsx: "4.19.4",
|
|
1653
1693
|
typescript: "5.9.3"
|