@whop/cli 0.0.6 → 0.2.0

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,119 +1,59 @@
1
- # `@whop/cli`
1
+ # Whop CLI
2
2
 
3
- The public Whop CLI — build and manage Whop apps from your terminal. The binary is `whop`.
3
+ `whop` — sell on Whop from your terminal. Create products, set pricing, and get a shareable checkout link without leaving your shell.
4
4
 
5
- It is built with [incur](https://www.npmjs.com/package/incur), a TypeScript framework for CLIs that are equally usable by humans and AI agents. Every command gets typed `args`/`options`/`output` schemas, readable help, and — for free — `--llms`, `--format json|toon|yaml|md|jsonl`, `--schema`, plus `whop skills add` / `whop mcp add` for agent discovery.
6
-
7
- > Status: **early.** This package will become the public `whop` CLI. The existing internal developer CLI (`infra/localdev`) keeps the `whop` name for now and will later be renamed `whopdev`.
8
-
9
- ## Develop
10
-
11
- ```bash
12
- # from developer-platform/
13
- pnpm install
14
-
15
- # run the CLI from source (no build) via tsx
16
- pnpm --filter @whop/cli dev --help
17
- pnpm --filter @whop/cli dev auth status
18
- ```
19
-
20
- ## Build
21
-
22
- ```bash
23
- pnpm --filter @whop/cli build # tsup -> dist/index.js (executable, ESM)
24
- node packages/cli/dist/index.js --help
25
- ```
26
-
27
- ## Try it
5
+ ## Installation
28
6
 
29
7
  ```bash
30
- whop # quickstart if you are not logged in
31
- whop --help # human-readable help
32
- whop auth login --help # help for a specific command
33
- whop auth status # who am I?
34
- whop auth status --format json # structured output for scripts/agents
35
- whop --llms # agent-readable command manifest
36
- ```
37
-
38
- ## Start selling
8
+ # macOS / Linux
9
+ curl -fsSL https://whop.com/install.sh | sh
39
10
 
40
- `whop quickstart` is the single front door. In a terminal it checks your account and walks you from zero to a shareable checkout link; pass flags to do it in one shot.
11
+ # Homebrew
12
+ brew install whopio/tap/whop
41
13
 
42
- ```bash
43
- whop quickstart # guided: name your product, set a price, get a checkout link
44
- whop quickstart --title "My Course" --price 9.99 --billing_period monthly # one-shot
45
- whop quickstart --format json # agents: a read-only status check (never mutates unless you pass creation flags)
14
+ # npm (requires Node.js >= 22)
15
+ npm install -g @whop/cli
46
16
  ```
47
17
 
48
- Power users can drive each resource directly — `whop products`, `whop plans`, `whop checkout-configurations` — and `whop link <prod_xxx>` sets a default product for the current directory.
18
+ Prebuilt binaries cover macOS and Linux ([releases](https://github.com/whopio/whop-public-cli/releases)); on other platforms, use npm.
49
19
 
50
- ## Authentication
51
-
52
- Log in with a Whop **API key** (create one in your dashboard under **Developer → API keys**). Credentials are stored in your **OS keychain** (macOS Keychain, Windows Credential Manager, libsecret on Linux) — never in a plaintext file. Non-secret profile metadata lives in `~/.config/whop/config.json`.
20
+ ## Getting started
53
21
 
54
22
  ```bash
55
- whop login # interactive: pick a method, paste your API key
56
- whop auth login # same thing
57
- whop auth status # who am I? (whoami)
58
- whop auth list # list saved profiles
59
- whop auth switch [name] # switch the active profile (interactive picker if omitted)
60
- whop auth logout [name] # remove a profile (defaults to the active one)
61
- whop auth logout --all # remove every profile and its stored secret (full reset)
23
+ whop
62
24
  ```
63
25
 
64
- You can keep **multiple profiles** (e.g. one per account) and switch between them. `whop login` derives a profile name from the account; pass `--profile <name>` to choose your own.
26
+ That's it — it signs you in and walks you to a shareable checkout link.
65
27
 
66
- ## Quickstart
28
+ ## Usage
67
29
 
68
30
  ```bash
69
- whop quickstart
70
- whop quickstart --account-id biz_xxx --product-id prod_xxx
71
- whop quickstart --title "My Course" --price 9.99 --billing-period monthly
31
+ whop --help # all commands
32
+ whop products list # what you're selling
33
+ whop plans create --help # options for any command
34
+ whop stats list # your numbers
72
35
  ```
73
36
 
74
- Quickstart installs Whop skills and the MCP server for Claude Desktop, checks your business account, product, and plan setup, then returns a checkout link when one is available. When more than one business account or product is visible, it asks you to choose instead of guessing.
37
+ Every command takes `--format json` for structured output.
75
38
 
76
- ### Non-interactive (CI / agents)
39
+ ## For AI agents
77
40
 
78
- Skip the prompts by passing the key as a flag or environment variable:
41
+ The CLI is self-describing — agents can discover and drive every command:
79
42
 
80
43
  ```bash
81
- whop auth login --api-key whop_xxx --format json
82
- WHOP_API_KEY=whop_xxx whop auth login --format json
44
+ whop --llms # machine-readable manifest of all commands
45
+ whop mcp add # register as an MCP server (e.g. Claude Desktop)
46
+ whop skills add # generate agent skills
83
47
  ```
84
48
 
85
- | Env var | Purpose |
86
- | --- | --- |
87
- | `WHOP_API_KEY` | API key for non-interactive login |
88
- | `WHOP_API_BASE_URL` | Override the Whop API base URL (default `https://api.whop.com/api/v1`) |
89
- | `WHOP_CONFIG_DIR` | Override the config directory (default `~/.config/whop`, honors `XDG_CONFIG_HOME`) |
49
+ Set `WHOP_API_KEY` for non-interactive use (create one under **Developer → API keys**).
90
50
 
91
- ## Accounts
51
+ ## Updating
92
52
 
93
- Manage Whop accounts (business accounts and connected accounts).
53
+ The CLI keeps itself up to date. To update manually, run `whop upgrade`.
94
54
 
95
- ```bash
96
- whop accounts list # list accounts visible to your credential
97
- whop accounts get <id> # retrieve a single account
98
- whop accounts me # retrieve the account for the current API key
99
- whop accounts create --email x@y.com # create a connected account
100
- whop accounts update <id> --title "Acme" # update account fields
101
- ```
55
+ ## Documentation
102
56
 
103
- An **account** is either a business account or a connected account. Business accounts are top-level; connected accounts are child accounts under a parent business API key. See `whop accounts <command> --help` for all available options.
104
-
105
- ## Adding commands
106
-
107
- > The full incur authoring guide is vendored into this package as [`SKILL.md`](./SKILL.md) — the framework reference for command definitions, args/options schemas, output formats, middleware, streaming, and agent discovery. Re-sync it from the [`incur`](https://www.npmjs.com/package/incur) repo when upgrading.
108
-
109
- Register new subcommands in `src/index.ts`:
110
-
111
- ```ts
112
- cli.command("apps", {
113
- description: "List your Whop apps",
114
- output: z.object({ apps: z.array(z.object({ id: z.string(), name: z.string() })) }),
115
- run() {
116
- return { apps: [] };
117
- },
118
- });
119
- ```
57
+ - [Whop developer docs](https://docs.whop.com)
58
+ - [whop.com/developers](https://whop.com/developers/)
59
+ - Bugs and feature requests: [issues](https://github.com/whopio/whop-public-cli/issues)
@@ -4,14 +4,13 @@ import {
4
4
  createWhopFetch,
5
5
  filterSpecByTag,
6
6
  native_spec_default,
7
- resolveActiveCompanyId
8
- } from "./chunk-Z7WDX64Z.js";
9
- import "./chunk-CXNQ6UGC.js";
10
- import "./chunk-MELVTXNG.js";
7
+ resolveActiveAccountId
8
+ } from "./chunk-2Y4EKBOD.js";
9
+ import "./chunk-KFCNNWPI.js";
11
10
  export {
12
11
  createWhopFetch,
13
12
  filterSpecByTag,
14
13
  native_spec_default as nativeSpec,
15
- resolveActiveCompanyId
14
+ resolveActiveAccountId
16
15
  };
17
- //# sourceMappingURL=api-XJ22R3CT.js.map
16
+ //# sourceMappingURL=api-U7WU3JXH.js.map