@whop/cli 0.13.0 → 0.13.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 CHANGED
@@ -1,6 +1,29 @@
1
1
  # Whop CLI
2
2
 
3
- `whop` — build and manage your Whop business from the terminal. Deploy apps, manage products and pricing, run ads, move money, and automate workflows from one agent-friendly CLI.
3
+ `whop` is your entire business on the command line. Ship software, sell products, move money, buy ads, hire people, and read the numbers.
4
+
5
+ ```bash
6
+ whop accounts create --title "Acme" # create a business
7
+ whop apps deploy # ship a web app to *.whop.app
8
+ whop products create --title "Pro membership" # something to sell
9
+ whop checkout-configurations create --plan_id plan_xxx # a link that accepts money
10
+ whop media generate --type image --prompt "launch art" # make an ad creative
11
+ whop ads create … # put it on Meta/Tiktok
12
+ whop payouts create … # send earnings to your bank
13
+ whop stats list # how it's all going
14
+ ```
15
+
16
+ With the CLI you can:
17
+
18
+ - **Ship software**: build and deploy hosted web apps to `*.whop.app`, with previews, rollbacks, secrets, and production logs
19
+ - **Sell anything**: products, one-time / recurring / trial pricing, checkout links
20
+ - **Move money**: payouts, transfers, deposits, currency swaps, spending cards
21
+ - **Advertise**: generate AI images and video, run Meta or Tiktok campaigns
22
+ - **Hire**: post bounties with escrowed rewards, review submissions, pay the winners
23
+ - **Measure**: financial, audience, and traffic stats, plus tracked people and events
24
+ - **Automate all of it**: structured output, a machine-readable manifest, an MCP server, and agent skills built in
25
+
26
+
4
27
 
5
28
  ## Installation
6
29
 
@@ -15,9 +38,7 @@ brew install whopio/tap/whop
15
38
  npm install -g @whop/cli
16
39
  ```
17
40
 
18
- Prebuilt binaries cover macOS and Linux ([releases](https://github.com/whopio/whop-public-cli/releases)); on other platforms, use npm.
19
-
20
- The standalone installer uses your standard user executable directory (`$XDG_BIN_HOME` or `~/.local/bin`) and updates your shell profile when needed.
41
+ Prebuilt binaries cover macOS and Linux ([releases](https://github.com/whopio/whop-public-cli/releases)); on other platforms, use npm. The standalone installer uses your standard user executable directory (`$XDG_BIN_HOME` or `~/.local/bin`).
21
42
 
22
43
  ## Getting started
23
44
 
@@ -25,7 +46,7 @@ The standalone installer uses your standard user executable directory (`$XDG_BIN
25
46
  whop
26
47
  ```
27
48
 
28
- That's it — it signs you in, lets you choose or create the business the CLI should use, and points you to the available workflows. Run `whop quickstart` later to change the selected business.
49
+ That's it! Run `whop auth accounts` anytime to switch businesses.
29
50
 
30
51
  ## Usage
31
52
 
@@ -34,75 +55,55 @@ whop --help # all commands
34
55
  whop products list # what you're selling
35
56
  whop plans create --help # options for any command
36
57
  whop stats list # your numbers
58
+ whop accounts get --account_id biz_xxx # target another business
37
59
  ```
38
60
 
39
- Every command takes `--format json` for structured output.
61
+ Every command takes `--format json` for structured output, or `--format jsonl` to stream events.
40
62
 
41
- In a terminal, commands that are missing required inputs ask for them interactively instead of failing — run `whop swaps quote` with no flags and it prompts for the amount and tokens. Agents and scripts (non-TTY) get a structured validation error instead.
63
+ Account-scoped commands use the selected business by default. Pass another business with `--account_id`.
42
64
 
43
- ## Authentication
65
+ In a terminal, commands prompt for missing inputs. Agents and scripts (non-TTY) get a structured validation error instead, so nothing hangs.
44
66
 
45
- ```bash
46
- whop login --method oauth # interactive browser login
47
- whop login --method oauth --format jsonl # stream the authorization URL for an agent
48
- whop login --method api-key --api-key whop_xxx # explicit API-key login
49
- WHOP_API_KEY=whop_xxx whop login --method api-key # API key from the environment
50
- ```
51
-
52
- Agent OAuth recipe:
53
-
54
- 1. Run `whop login --method oauth --format jsonl` in the background with stdout redirected to a file — pipes like `| head` can buffer past the URL.
55
- 2. The first line is an `authorization_required` event, emitted once the local callback listener is ready. Open its `authorizationUrl` in the user's browser (e.g. `open <url>` on macOS, `xdg-open <url>` on Linux). The URL is several KB long (it carries the full scope list): pass it programmatically and never retype, truncate, or summarize it — a mangled scope list fails with `invalid_scope`.
56
- 3. Wait for the process to exit — the final `done` event means the profile is saved.
57
- 4. If the user manages more than one business, the login succeeds without picking one; set it with `whop auth account <biz_id>` (`whop auth account --list` to enumerate) — no second browser round-trip needed.
58
-
59
- The flow redirects to `localhost:13337`, so the browser must run on the same host as the CLI (or forward that port to the CLI host). Fully remote browser authorization will require a future device login flow.
60
-
61
- ## Build and deploy apps
67
+ ## Ship apps
62
68
 
63
- Fully-hosted web apps (`*.whop.app`) follow a git-shaped lifecycle — two on-ramps, one loop:
69
+ Hosted web apps (`*.whop.app`) follow a git-shaped lifecycle. Two on-ramps, one loop:
64
70
 
65
71
  ```bash
66
- # Start a NEW app: registers it, scaffolds the latest TanStack Start
67
- # template (or --template app_xxx to clone another app's published source),
68
- # wires it for Whop hosting, installs, and git-inits
69
- whop apps init
70
-
71
- # …or get an EXISTING app's deployed source onto this machine: downloads the
72
- # production build's source archive (--build abld_xxx for any specific build)
73
- # and three-way merges it with whatever is here via git
74
- whop apps pull --app app_xxxxxxxx
72
+ whop apps init # start a NEW app: registers, scaffolds, git-inits
73
+ whop apps pull --app app_xxx # or pull an EXISTING app's deployed source
75
74
 
76
75
  # The loop
77
76
  whop apps dev # local dev server, credentials auto-injected
78
- whop apps deploy # build → typecheck → upload → promote to production
77
+ whop apps deploy # build, typecheck, upload, promote to production
79
78
  ```
80
79
 
81
- `deploy` ships the linked project; `--preview` uploads without promoting, and `whop apps builds promote <build_id>` ships it later — promoting an older build is also how you roll back. `pull` and `deploy` share a per-app snapshot ref (`refs/whop/remote/<app_id>`), so pulls always merge against the last state this machine saw: local edits are autostashed around the merge and conflicts surface as normal git conflict markers.
80
+ `deploy --preview` uploads without promoting. `whop apps builds promote <build_id>` ships a build later, and promoting an older build rolls back. `pull` merges the deployed source with your local files via git, so conflicts show up as normal git conflict markers.
82
81
 
83
- Everything else is plain REST: `whop apps list|create|get|update`, `whop apps builds list|get|promote`, and `whop apps secrets list|set|unset`.
82
+ The rest is plain REST: `whop apps list|create|get|update`, `whop apps builds list|get|promote`, `whop apps secrets list|set|unset`. The `whop()` Vite build plugin ships as `@whop/cli/vite`.
84
83
 
85
- After a deploy, read your app's server logs — every `console.log`, uncaught exception, and failed request, kept for 7 days:
84
+ After a deploy, read your app's server logs (kept for 7 days):
86
85
 
87
86
  ```bash
88
87
  whop apps logs app_xxxxxxxx --level error
89
88
  whop apps logs app_xxxxxxxx --query "checkout"
90
89
  ```
91
90
 
92
- ## Create file uploads
93
91
 
94
- Create a file record to receive the presigned upload URL and headers, then retrieve its current status:
92
+
93
+ ## Sell and get paid
95
94
 
96
95
  ```bash
97
- whop files create --filename "banner.png"
98
- whop files get file_xxxxxxxxxxxxx
96
+ whop products create --title "Pro membership"
97
+ whop plans create --help # one-time, recurring, trials, stock
98
+ whop checkout-configurations create --help # shareable, prefilled checkout link
99
+ whop stats list # financial, audience, and traffic reporting
99
100
  ```
100
101
 
101
- Upload the file's bytes to the returned `upload_url` using its `upload_headers`. The response from `whop files get` includes the file URL once the upload is ready.
102
+ Money moves through the same surface: payouts, transfers, deposits, swaps, and cards. Payouts and card issuing require identity verification (`whop verifications`). Steps that need a browser, like KYC, show up as a link to open.
102
103
 
103
104
  ## Run ads
104
105
 
105
- Generate a creative, then create the campaign, ad group, and ad in one command — structured flags take JSON strings:
106
+ Generate a creative, then create the campaign, ad group, and ad in one command. Structured flags take JSON strings:
106
107
 
107
108
  ```bash
108
109
  whop media generate --type image --prompt "A running club at sunrise" --wait
@@ -114,35 +115,71 @@ whop ads create \
114
115
  whop ad-campaigns update <adcamp_id> --status active # launch when ready
115
116
  ```
116
117
 
117
- The installed `whop-ads` skill (`whop skills add`) carries the full playbook — billing setup, field rules, and monitoring.
118
+ The `whop-ads` skill (`whop skills add`) carries the full playbook.
119
+
120
+ ## Hire a workforce
121
+
122
+ ```bash
123
+ whop bounties create --help # paid tasks with escrowed rewards
124
+ whop bounty-submissions list --help # review submitted work, approve to pay
125
+ ```
126
+
127
+
128
+
129
+ ## Upload files
130
+
131
+ ```bash
132
+ whop files create --filename "banner.png"
133
+ whop files get file_xxxxxxxxxxxxx
134
+ ```
135
+
136
+ `create` returns a presigned `upload_url` and `upload_headers`. Upload the bytes there, then `get` returns the file URL once it's ready.
118
137
 
119
138
  ## For AI agents
120
139
 
121
- The CLI is self-describing — agents can discover and drive every command:
140
+ The CLI is self-describing. Agents can discover and drive every command:
122
141
 
123
142
  ```bash
124
143
  whop --llms # machine-readable manifest of all commands
125
- whop mcp add # register as an MCP server (e.g. Claude Desktop)
126
- whop skills add # generate agent skills
144
+ whop mcp add # automatically register with supported coding agents
145
+ whop mcp doctor # diagnose an MCP registration
146
+ whop skills add # generate agent skills (per-resource playbooks)
127
147
  ```
128
148
 
129
- For OAuth, run `whop login --method oauth --format jsonl` and show the emitted URL to the user. For unattended automation, set `WHOP_API_KEY` instead (create one under **Developer → API keys**).
149
+ For OAuth, run `whop login --method oauth --format jsonl` in the background with stdout redirected to a file (pipes like `| head` can buffer past the URL). The first line carries an `authorizationUrl`; open it in the user's browser, unedited. Once the process exits, you're logged in.
150
+
151
+ For unattended automation, set `WHOP_API_KEY` (create one under **Developer → API keys**).
152
+
153
+ ## Authentication
154
+
155
+ ```bash
156
+ whop login --method oauth # interactive browser login
157
+ whop login --method oauth --format jsonl # stream the authorization URL for an agent
158
+ whop login --method api-key --api-key whop_xxx # explicit API-key login
159
+ WHOP_API_KEY=whop_xxx whop login --method api-key # API key from the environment
160
+ ```
161
+
162
+ List your businesses with `whop auth account --list` and switch with `whop auth account <biz_id>`.
163
+
164
+ The OAuth flow redirects to `localhost:13337`, so the browser must run on the same host as the CLI (or forward that port).
130
165
 
131
166
  ## Invocation logs
132
167
 
133
- Every run appends one JSON line — timestamp, arguments (secrets redacted), exit code, duration — to `~/.config/whop/logs/audit-YYYY-MM-DD.jsonl` so you can retrace what the CLI did when debugging. Logs older than 7 days are deleted automatically.
168
+ Every run appends one JSON line (arguments with secrets redacted, exit code, duration) to `~/.config/whop/logs/audit-YYYY-MM-DD.jsonl`. Logs older than 7 days are deleted.
134
169
 
135
170
  ```bash
136
171
  WHOP_CLI_AUDIT_RETENTION_DAYS=30 whop … # keep logs longer
137
172
  WHOP_CLI_AUDIT_LOG=0 whop … # disable logging
138
173
  ```
139
174
 
175
+
176
+
140
177
  ## Updating
141
178
 
142
179
  The CLI keeps itself up to date. To update manually, run `whop upgrade`.
143
180
 
144
181
  ## Documentation
145
182
 
183
+ - [Whop CLI docs](https://docs.whop.com/developer/cli)
146
184
  - [Whop developer docs](https://docs.whop.com)
147
- - [whop.com/developers](https://whop.com/developers/)
148
185
  - Bugs and feature requests: [issues](https://github.com/whopio/whop-public-cli/issues)
@@ -1,10 +1,40 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire as __createRequire } from "node:module"; const require = __createRequire(import.meta.url);
3
+ var __create = Object.create;
3
4
  var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getProtoOf = Object.getPrototypeOf;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
10
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
11
+ }) : x)(function(x) {
12
+ if (typeof require !== "undefined") return require.apply(this, arguments);
13
+ throw Error('Dynamic require of "' + x + '" is not supported');
14
+ });
15
+ var __commonJS = (cb, mod) => function __require2() {
16
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
17
+ };
4
18
  var __export = (target, all) => {
5
19
  for (var name in all)
6
20
  __defProp(target, name, { get: all[name], enumerable: true });
7
21
  };
22
+ var __copyProps = (to, from, except, desc) => {
23
+ if (from && typeof from === "object" || typeof from === "function") {
24
+ for (let key of __getOwnPropNames(from))
25
+ if (!__hasOwnProp.call(to, key) && key !== except)
26
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
27
+ }
28
+ return to;
29
+ };
30
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
31
+ // If the importer is in node compatibility mode or this is not an ESM
32
+ // file that has been converted to a CommonJS file using a Babel-
33
+ // compatible transform (i.e. "__esModule" has not been set), then set
34
+ // "default" to the CommonJS "module.exports" for node compatibility.
35
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
36
+ mod
37
+ ));
8
38
 
9
39
  // ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/core.js
10
40
  var NEVER = Object.freeze({
@@ -13777,7 +13807,10 @@ function fromJSONSchema(schema, params) {
13777
13807
  config(en_default());
13778
13808
 
13779
13809
  export {
13810
+ __require,
13811
+ __commonJS,
13780
13812
  __export,
13813
+ __toESM,
13781
13814
  NEVER,
13782
13815
  iso_exports,
13783
13816
  safeParse2 as safeParse,
@@ -13804,4 +13837,4 @@ export {
13804
13837
  coerce_exports,
13805
13838
  external_exports
13806
13839
  };
13807
- //# sourceMappingURL=chunk-KFCNNWPI.js.map
13840
+ //# sourceMappingURL=chunk-4MBHKXEL.js.map