@whop/cli 1.0.0-beta.1 → 1.0.0-beta.2
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 +2 -2
- package/dist/{chunk-5BVHPPST.js → chunk-63Z4GX2Q.js} +2 -2
- package/dist/{chunk-FE7JREX4.js → chunk-CD4COZVJ.js} +95 -48
- package/dist/chunk-CD4COZVJ.js.map +1 -0
- package/dist/{cli-WGCLUT3P.js → cli-7TPUKCBI.js} +3 -3
- package/dist/index.js +5 -4
- package/dist/index.js.map +1 -1
- package/dist/{missing-params-ZOZCSZ5F.js → missing-params-XCGNQA5Q.js} +3 -3
- package/package.json +2 -2
- package/dist/chunk-FE7JREX4.js.map +0 -1
- /package/dist/{chunk-5BVHPPST.js.map → chunk-63Z4GX2Q.js.map} +0 -0
- /package/dist/{cli-WGCLUT3P.js.map → cli-7TPUKCBI.js.map} +0 -0
- /package/dist/{missing-params-ZOZCSZ5F.js.map → missing-params-XCGNQA5Q.js.map} +0 -0
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
import { createRequire as __createRequire } from "node:module"; const require = __createRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
cli_default
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-63Z4GX2Q.js";
|
|
6
|
+
import "./chunk-CD4COZVJ.js";
|
|
7
7
|
import "./chunk-EDYYHINV.js";
|
|
8
8
|
import "./chunk-M2N2M5EJ.js";
|
|
9
9
|
export {
|
|
10
10
|
cli_default as default
|
|
11
11
|
};
|
|
12
|
-
//# sourceMappingURL=cli-
|
|
12
|
+
//# sourceMappingURL=cli-7TPUKCBI.js.map
|
package/dist/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
getActiveProfile,
|
|
6
6
|
groupedHelp,
|
|
7
7
|
recordAuditLog
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-CD4COZVJ.js";
|
|
9
9
|
import "./chunk-EDYYHINV.js";
|
|
10
10
|
import "./chunk-M2N2M5EJ.js";
|
|
11
11
|
|
|
@@ -81,7 +81,8 @@ for (const [signal, code] of [
|
|
|
81
81
|
if (process.listenerCount(signal) === 1) process.exit(code);
|
|
82
82
|
});
|
|
83
83
|
}
|
|
84
|
-
var
|
|
84
|
+
var args = process.argv.slice(2);
|
|
85
|
+
var argv = args[0] === "upgrade" && !args.includes("--check") ? ["--update", ...args.slice(1)] : args;
|
|
85
86
|
var colorize = shouldColorize(argv);
|
|
86
87
|
var write = (output) => {
|
|
87
88
|
process.stdout.write(colorize ? colorizeOutput(output) : output);
|
|
@@ -94,8 +95,8 @@ if (helpFlag || argv.length === 0 && setUp()) {
|
|
|
94
95
|
} else {
|
|
95
96
|
recordAuditLog();
|
|
96
97
|
const [{ default: cli }, { promptForMissingParams }] = await Promise.all([
|
|
97
|
-
import("./cli-
|
|
98
|
-
import("./missing-params-
|
|
98
|
+
import("./cli-7TPUKCBI.js"),
|
|
99
|
+
import("./missing-params-XCGNQA5Q.js")
|
|
99
100
|
]);
|
|
100
101
|
await cli.serve(
|
|
101
102
|
argv.length === 0 ? ["quickstart"] : await promptForMissingParams(argv, write),
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/lib/colorize-output.ts","../src/index.ts"],"sourcesContent":["import { c } from \"./colors\";\n\n// incur writes machine-readable output for these flags even on a terminal.\n// It exposes no hook to theme its help, errors and CTAs, so the text it\n// writes for humans is themed here instead.\nconst MACHINE_OUTPUT_FLAGS = new Set([\n\t\"--format\",\n\t\"--full-output\",\n\t\"--json\",\n\t\"--llms\",\n\t\"--llms-full\",\n\t\"--mcp\",\n\t\"--schema\",\n\t\"--token-count\",\n]);\n\nexport function shouldColorize(argv: string[]): boolean {\n\treturn (\n\t\tprocess.stdout.isTTY === true &&\n\t\t!argv.some((token) => MACHINE_OUTPUT_FLAGS.has(token))\n\t);\n}\n\nconst flags = (text: string) =>\n\ttext\n\t\t.replace(/<[^>]+>/g, (placeholder) => c.muted(placeholder))\n\t\t.replace(/--?[\\w-]+/g, (flag) => c.flag(flag));\n\nconst ROW_NAME: Record<string, (name: string) => string> = {\n\tAliases: c.command,\n\tArguments: c.id,\n\tCommands: c.command,\n\t\"Custom Global Options\": flags,\n\t\"Environment Variables\": flags,\n\t\"Global Options\": flags,\n\tIntegrations: c.command,\n\tOptions: flags,\n};\nconst HEADERS = new Set([...Object.keys(ROW_NAME), \"Examples\", \"Usage\"]);\n\nconst COMMAND_ROW = /^(\\s+)(whop\\s+\\S.*?)(\\s{2,}#\\s.*)?$/;\nconst ROW = /^(\\s+)(\\S.*?)(\\s{2,})(.*)$/;\n\nconst links = (text: string) =>\n\ttext.replace(/https?:\\/\\/[^\\s)]+/g, (url) => c.link(url));\n\nexport function colorizeOutput(text: string): string {\n\tlet rowName: ((name: string) => string) | undefined;\n\tconst lines = text.split(\"\\n\");\n\treturn lines\n\t\t.map((line, index) => {\n\t\t\tconst error = /^(Error(?: \\([^)]+\\))?:)(.*)$/.exec(line);\n\t\t\tif (error) return c.error(error[1]!) + links(error[2]!);\n\n\t\t\tconst header = /^([A-Z][A-Za-z ]+):(.*)$/.exec(line);\n\t\t\tif (header && HEADERS.has(header[1]!)) {\n\t\t\t\trowName = ROW_NAME[header[1]!];\n\t\t\t\tconst rest = header[2]!.replace(/whop[\\w\\s-]*/g, (m) => c.command(m));\n\t\t\t\treturn c.heading(`${header[1]}:`) + rest;\n\t\t\t}\n\t\t\tif (/^[A-Z][A-Z ]+$/.test(line)) {\n\t\t\t\trowName = c.command;\n\t\t\t\treturn c.heading(line);\n\t\t\t}\n\n\t\t\tconst command = COMMAND_ROW.exec(line);\n\t\t\tif (command) {\n\t\t\t\tconst [, indent, name, comment] = command;\n\t\t\t\treturn `${indent}${c.command(name!)}${comment ? c.description(comment) : \"\"}`;\n\t\t\t}\n\t\t\tif (\n\t\t\t\tline.startsWith(\"Run `\") ||\n\t\t\t\t(line.trim().endsWith(\":\") && COMMAND_ROW.test(lines[index + 1] ?? \"\"))\n\t\t\t) {\n\t\t\t\treturn c.heading(line);\n\t\t\t}\n\n\t\t\tif (line.trim() === \"\") rowName = undefined;\n\t\t\tconst row = rowName && ROW.exec(line);\n\t\t\tif (row) {\n\t\t\t\tconst [, indent, name, gap, description] = row;\n\t\t\t\treturn `${indent}${rowName!(name!)}${gap}${c.description(description!)}`;\n\t\t\t}\n\t\t\treturn links(line);\n\t\t})\n\t\t.join(\"\\n\");\n}\n","import { getActiveProfile } from \"./auth/profiles\";\nimport { recordAuditLog } from \"./lib/audit-log\";\nimport { colorizeOutput, shouldColorize } from \"./lib/colorize-output\";\nimport { groupedHelp } from \"./lib/grouped-help\";\n\n// A signal with no listener ends the process without firing \"exit\", which\n// would drop the audit record and leak the shipped-skills temp dir. Defer\n// to any other listener so this never pre-empts its signal handling.\nfor (const [signal, code] of [\n\t[\"SIGINT\", 130],\n\t[\"SIGTERM\", 143],\n] as const) {\n\tprocess.on(signal, () => {\n\t\tif (process.listenerCount(signal) === 1) process.exit(code);\n\t});\n}\n\nconst
|
|
1
|
+
{"version":3,"sources":["../src/lib/colorize-output.ts","../src/index.ts"],"sourcesContent":["import { c } from \"./colors\";\n\n// incur writes machine-readable output for these flags even on a terminal.\n// It exposes no hook to theme its help, errors and CTAs, so the text it\n// writes for humans is themed here instead.\nconst MACHINE_OUTPUT_FLAGS = new Set([\n\t\"--format\",\n\t\"--full-output\",\n\t\"--json\",\n\t\"--llms\",\n\t\"--llms-full\",\n\t\"--mcp\",\n\t\"--schema\",\n\t\"--token-count\",\n]);\n\nexport function shouldColorize(argv: string[]): boolean {\n\treturn (\n\t\tprocess.stdout.isTTY === true &&\n\t\t!argv.some((token) => MACHINE_OUTPUT_FLAGS.has(token))\n\t);\n}\n\nconst flags = (text: string) =>\n\ttext\n\t\t.replace(/<[^>]+>/g, (placeholder) => c.muted(placeholder))\n\t\t.replace(/--?[\\w-]+/g, (flag) => c.flag(flag));\n\nconst ROW_NAME: Record<string, (name: string) => string> = {\n\tAliases: c.command,\n\tArguments: c.id,\n\tCommands: c.command,\n\t\"Custom Global Options\": flags,\n\t\"Environment Variables\": flags,\n\t\"Global Options\": flags,\n\tIntegrations: c.command,\n\tOptions: flags,\n};\nconst HEADERS = new Set([...Object.keys(ROW_NAME), \"Examples\", \"Usage\"]);\n\nconst COMMAND_ROW = /^(\\s+)(whop\\s+\\S.*?)(\\s{2,}#\\s.*)?$/;\nconst ROW = /^(\\s+)(\\S.*?)(\\s{2,})(.*)$/;\n\nconst links = (text: string) =>\n\ttext.replace(/https?:\\/\\/[^\\s)]+/g, (url) => c.link(url));\n\nexport function colorizeOutput(text: string): string {\n\tlet rowName: ((name: string) => string) | undefined;\n\tconst lines = text.split(\"\\n\");\n\treturn lines\n\t\t.map((line, index) => {\n\t\t\tconst error = /^(Error(?: \\([^)]+\\))?:)(.*)$/.exec(line);\n\t\t\tif (error) return c.error(error[1]!) + links(error[2]!);\n\n\t\t\tconst header = /^([A-Z][A-Za-z ]+):(.*)$/.exec(line);\n\t\t\tif (header && HEADERS.has(header[1]!)) {\n\t\t\t\trowName = ROW_NAME[header[1]!];\n\t\t\t\tconst rest = header[2]!.replace(/whop[\\w\\s-]*/g, (m) => c.command(m));\n\t\t\t\treturn c.heading(`${header[1]}:`) + rest;\n\t\t\t}\n\t\t\tif (/^[A-Z][A-Z ]+$/.test(line)) {\n\t\t\t\trowName = c.command;\n\t\t\t\treturn c.heading(line);\n\t\t\t}\n\n\t\t\tconst command = COMMAND_ROW.exec(line);\n\t\t\tif (command) {\n\t\t\t\tconst [, indent, name, comment] = command;\n\t\t\t\treturn `${indent}${c.command(name!)}${comment ? c.description(comment) : \"\"}`;\n\t\t\t}\n\t\t\tif (\n\t\t\t\tline.startsWith(\"Run `\") ||\n\t\t\t\t(line.trim().endsWith(\":\") && COMMAND_ROW.test(lines[index + 1] ?? \"\"))\n\t\t\t) {\n\t\t\t\treturn c.heading(line);\n\t\t\t}\n\n\t\t\tif (line.trim() === \"\") rowName = undefined;\n\t\t\tconst row = rowName && ROW.exec(line);\n\t\t\tif (row) {\n\t\t\t\tconst [, indent, name, gap, description] = row;\n\t\t\t\treturn `${indent}${rowName!(name!)}${gap}${c.description(description!)}`;\n\t\t\t}\n\t\t\treturn links(line);\n\t\t})\n\t\t.join(\"\\n\");\n}\n","import { getActiveProfile } from \"./auth/profiles\";\nimport { recordAuditLog } from \"./lib/audit-log\";\nimport { colorizeOutput, shouldColorize } from \"./lib/colorize-output\";\nimport { groupedHelp } from \"./lib/grouped-help\";\n\n// A signal with no listener ends the process without firing \"exit\", which\n// would drop the audit record and leak the shipped-skills temp dir. Defer\n// to any other listener so this never pre-empts its signal handling.\nfor (const [signal, code] of [\n\t[\"SIGINT\", 130],\n\t[\"SIGTERM\", 143],\n] as const) {\n\tprocess.on(signal, () => {\n\t\tif (process.listenerCount(signal) === 1) process.exit(code);\n\t});\n}\n\nconst args = process.argv.slice(2);\n// 0.x shipped `whop upgrade`; scripts that still call it get incur's\n// `--update`. `upgrade --check` only reported, which --update cannot do.\nconst argv =\n\targs[0] === \"upgrade\" && !args.includes(\"--check\")\n\t\t? [\"--update\", ...args.slice(1)]\n\t\t: args;\nconst colorize = shouldColorize(argv);\nconst write = (output: string) => {\n\tprocess.stdout.write(colorize ? colorizeOutput(output) : output);\n};\nconst helpFlag =\n\targv.length === 1 && (argv[0] === \"--help\" || argv[0] === \"-h\");\nconst setUp = () =>\n\tBoolean(process.env.WHOP_API_KEY || getActiveProfile()?.accountId);\n\nif (helpFlag || (argv.length === 0 && setUp())) {\n\twrite(`${groupedHelp()}\\n`);\n} else {\n\t// Started by the entry point so tests that import the CLI do not write to\n\t// the user's audit log.\n\trecordAuditLog();\n\t// Building every command group is most of the startup cost, and root help\n\t// does not need it.\n\tconst [{ default: cli }, { promptForMissingParams }] = await Promise.all([\n\t\timport(\"./cli\"),\n\t\timport(\"./journey/missing-params\"),\n\t]);\n\tawait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,EAAG,SAAQ,KAAK,IAAI;AAAA,EAC3D,CAAC;AACF;AAEA,IAAM,OAAO,QAAQ,KAAK,MAAM,CAAC;AAGjC,IAAM,OACL,KAAK,CAAC,MAAM,aAAa,CAAC,KAAK,SAAS,SAAS,IAC9C,CAAC,YAAY,GAAG,KAAK,MAAM,CAAC,CAAC,IAC7B;AACJ,IAAM,WAAW,eAAe,IAAI;AACpC,IAAM,QAAQ,CAAC,WAAmB;AACjC,UAAQ,OAAO,MAAM,WAAW,eAAe,MAAM,IAAI,MAAM;AAChE;AACA,IAAM,WACL,KAAK,WAAW,MAAM,KAAK,CAAC,MAAM,YAAY,KAAK,CAAC,MAAM;AAC3D,IAAM,QAAQ,MACb,QAAQ,QAAQ,IAAI,gBAAgB,iBAAiB,GAAG,SAAS;AAElE,IAAI,YAAa,KAAK,WAAW,KAAK,MAAM,GAAI;AAC/C,QAAM,GAAG,YAAY,CAAC;AAAA,CAAI;AAC3B,OAAO;AAGN,iBAAe;AAGf,QAAM,CAAC,EAAE,SAAS,IAAI,GAAG,EAAE,uBAAuB,CAAC,IAAI,MAAM,QAAQ,IAAI;AAAA,IACxE,OAAO,mBAAO;AAAA,IACd,OAAO,8BAA0B;AAAA,EAClC,CAAC;AACD,QAAM,IAAI;AAAA,IACT,KAAK,WAAW,IACb,CAAC,YAAY,IACb,MAAM,uBAAuB,MAAM,KAAK;AAAA,IAC3C,WAAW,EAAE,QAAQ,MAAM,IAAI,CAAC;AAAA,EACjC;AACD;","names":["argv"]}
|
|
@@ -3,7 +3,7 @@ import { createRequire as __createRequire } from "node:module"; const require =
|
|
|
3
3
|
import {
|
|
4
4
|
cli_default,
|
|
5
5
|
performLogin
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-63Z4GX2Q.js";
|
|
7
7
|
import {
|
|
8
8
|
Cli_exports,
|
|
9
9
|
Errors_exports,
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
commandOverrides,
|
|
12
12
|
overridesAwaitLogin,
|
|
13
13
|
package_default
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-CD4COZVJ.js";
|
|
15
15
|
import {
|
|
16
16
|
external_exports
|
|
17
17
|
} from "./chunk-EDYYHINV.js";
|
|
@@ -214,4 +214,4 @@ export {
|
|
|
214
214
|
missingParams,
|
|
215
215
|
promptForMissingParams
|
|
216
216
|
};
|
|
217
|
-
//# sourceMappingURL=missing-params-
|
|
217
|
+
//# sourceMappingURL=missing-params-XCGNQA5Q.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@whop/cli",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.2",
|
|
4
4
|
"description": "The Whop CLI — build and manage Whop apps from your terminal. Human and agent friendly.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"agent",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@types/node": "25.3.5",
|
|
44
44
|
"fflate": "0.8.3",
|
|
45
|
-
"incur": "github:whopio/incur#
|
|
45
|
+
"incur": "github:whopio/incur#e5a1a4b395f89de026f374594652c2e9d9865fbf",
|
|
46
46
|
"oxfmt": "0.42.0",
|
|
47
47
|
"tsup": "8.5.0",
|
|
48
48
|
"tsx": "4.19.4",
|