@whop/cli 0.0.1 → 0.0.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 CHANGED
@@ -1,3 +1,95 @@
1
- # @whop/cli
1
+ # `@whop/cli`
2
2
 
3
- Reserved package for the official Whop CLI.
3
+ The public Whop CLI build and manage Whop apps from your terminal. The binary is `whop`.
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
28
+
29
+ ```bash
30
+ whop --help # human-readable help
31
+ whop auth login --help # help for a specific command
32
+ whop auth status # who am I?
33
+ whop auth status --format json # structured output for scripts/agents
34
+ whop --llms # agent-readable command manifest
35
+ ```
36
+
37
+ ## Authentication
38
+
39
+ 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`.
40
+
41
+ ```bash
42
+ whop login # interactive: pick a method, paste your API key
43
+ whop auth login # same thing
44
+ whop auth status # who am I? (whoami)
45
+ whop auth list # list saved profiles
46
+ whop auth switch [name] # switch the active profile (interactive picker if omitted)
47
+ whop auth logout [name] # remove a profile (defaults to the active one)
48
+ ```
49
+
50
+ You can keep **multiple profiles** (e.g. one per company) and switch between them. `whop login` derives a profile name from the company; pass `--profile <name>` to choose your own.
51
+
52
+ ### Non-interactive (CI / agents)
53
+
54
+ Skip the prompts by passing the key as a flag or environment variable:
55
+
56
+ ```bash
57
+ whop auth login --api-key whop_xxx --format json
58
+ WHOP_API_KEY=whop_xxx whop auth login --format json
59
+ ```
60
+
61
+ | Env var | Purpose |
62
+ | --- | --- |
63
+ | `WHOP_API_KEY` | API key for non-interactive login |
64
+ | `WHOP_API_BASE_URL` | Override the Whop API base URL (default `https://api.whop.com/api/v1`) |
65
+ | `WHOP_CONFIG_DIR` | Override the config directory (default `~/.config/whop`, honors `XDG_CONFIG_HOME`) |
66
+
67
+ ## Accounts
68
+
69
+ Manage Whop accounts (business accounts and connected accounts).
70
+
71
+ ```bash
72
+ whop accounts list # list accounts visible to your credential
73
+ whop accounts get <id> # retrieve a single account
74
+ whop accounts me # retrieve the account for the current API key
75
+ whop accounts create --email x@y.com # create a connected account
76
+ whop accounts update <id> --title "Acme" # update account fields
77
+ ```
78
+
79
+ An **account** is a Whop company. 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.
80
+
81
+ ## Adding commands
82
+
83
+ > 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.
84
+
85
+ Register new subcommands in `src/index.ts`:
86
+
87
+ ```ts
88
+ cli.command("apps", {
89
+ description: "List your Whop apps",
90
+ output: z.object({ apps: z.array(z.object({ id: z.string(), name: z.string() })) }),
91
+ run() {
92
+ return { apps: [] };
93
+ },
94
+ });
95
+ ```