dodopayments-cli 2.2.0 → 3.0.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
@@ -12,7 +12,7 @@
12
12
  <img src="https://img.shields.io/discord/1305511580854779984?label=Discord&logo=discord&color=5865F2" alt="Discord" />
13
13
  </a>
14
14
  <a href="LICENSE">
15
- <img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="License: MIT" />
15
+ <img src="https://img.shields.io/badge/license-GPL--3.0-blue.svg" alt="License: GPL-3.0" />
16
16
  </a>
17
17
  </p>
18
18
 
@@ -20,21 +20,34 @@
20
20
  <a href="#installation">Installation</a> •
21
21
  <a href="#authentication">Authentication</a> •
22
22
  <a href="#usage">Usage</a> •
23
+ <a href="#ai-assistant">AI</a> •
23
24
  <a href="#webhooks">Webhooks</a> •
24
25
  <a href="#contributing">Contributing</a>
25
26
  </p>
26
27
 
27
28
  ---
28
29
 
29
- Manage your [Dodo Payments](https://dodopayments.com/) resources and test webhooks directly from the terminal. Built for developers who prefer the command line.
30
+ Manage your [Dodo Payments](https://dodopayments.com/) resources, test webhooks, and run AI-powered queries against your account — all from the terminal.
31
+
32
+ <p align="center">
33
+ <img src="./.github/assets/cli-preview.png" alt="Dodo Payments CLI preview" width="100%" />
34
+ </p>
35
+
36
+ ## Features
37
+
38
+ - **Interactive TUI** — launch `dodo` with no arguments to open the full interactive interface with command palette, history, and live notifications.
39
+ - **AI assistant built in** — ask questions or take actions in plain English with `/ai`. No extra setup, runs `dodopayments-mcp` locally.
40
+ - **Secure by default** — API keys are stored in your OS secret store (macOS Keychain, Windows Credential Vault, Linux libsecret). No plaintext config on disk.
41
+ - **Auto update** — the CLI checks for new versions and notifies you in-app. Run `/update` to upgrade in place.
42
+ - **Webhook tooling** — listen for live webhooks or trigger payloads offline for local development.
30
43
 
31
44
  ## Installation
32
45
 
33
- We provide various ways to install the CLI:
46
+ We provide multiple ways to install the CLI.
34
47
 
35
- > **Note:** If you have Node or Bun installed, it's highly recommended to use that installation method.
48
+ > **Note:** If you already have Node or Bun installed, the package-manager installs are the simplest path and always pull the latest version.
36
49
 
37
- ### Using npm (Recommended)
50
+ ### Using npm
38
51
 
39
52
  ```bash
40
53
  npm install -g dodopayments-cli
@@ -46,144 +59,241 @@ npm install -g dodopayments-cli
46
59
  bun install -g dodopayments-cli
47
60
  ```
48
61
 
49
- ### Manual Installation
62
+ ### Manual installation (no Node / Bun required)
50
63
 
51
- 1. Download the latest release from [GitHub Releases](https://github.com/dodopayments/dodopayments-cli/releases) that matches your system.
64
+ 1. Download the binary for your platform from the latest [GitHub Release](https://github.com/dodopayments/dodopayments-cli/releases).
52
65
 
53
- 2. Extract the downloaded file to a directory of your choice.
66
+ | Platform | Binary |
67
+ | --- | --- |
68
+ | macOS (Apple Silicon) | `dodo-cli-darwin-arm64` |
69
+ | macOS (Intel) | `dodo-cli-darwin-x64` |
70
+ | Linux (x86_64) | `dodo-cli-linux-x64` |
71
+ | Linux (arm64) | `dodo-cli-linux-arm64` |
72
+ | Windows (x86_64) | `dodo-cli-windows-x64.exe` |
54
73
 
55
- 3. Rename the binary file to `dodo`:
56
- - **Linux/macOS:** `mv ./dodopayments-cli-* ./dodo`
57
- - **Windows:** `ren .\dodopayments-cli-* .\dodo`
74
+ 2. Rename the binary to `dodo`:
75
+ - **Linux / macOS:** `mv ./dodo-cli-* ./dodo && chmod +x ./dodo`
76
+ - **Windows:** `ren .\dodo-cli-windows-x64.exe .\dodo.exe`
58
77
 
59
- 4. Move the binary to a directory in your system's PATH:
60
- - **Linux/macOS:** `sudo mv ./dodo /usr/local/bin/`
61
- - **Windows:** `move .\dodo C:\Windows\System32\dodo` (requires admin mode)
78
+ 3. Move it to a directory on your `PATH`:
79
+ - **Linux / macOS:** `sudo mv ./dodo /usr/local/bin/`
80
+ - **Windows:** `move .\dodo.exe C:\Windows\System32\dodo.exe` (requires admin)
81
+
82
+ 4. (Optional) Verify the download against `SHA256SUMS.txt` published with each release:
83
+ ```bash
84
+ shasum -a 256 -c SHA256SUMS.txt
85
+ ```
62
86
 
63
87
  ## Authentication
64
88
 
65
- Before using the CLI, you must authenticate:
89
+ Before using authenticated commands you need to log in:
66
90
 
67
91
  ```bash
68
92
  dodo login
69
93
  ```
70
94
 
71
- This command will:
72
- 1. Open your browser to the Dodo Payments API Keys page
73
- 2. Prompt you to enter your API Key
74
- 3. Ask you to select the environment (**Test Mode** or **Live Mode**)
75
- 4. Store your credentials locally to `~/.dodopayments/api-key`
95
+ …or, from inside the interactive TUI:
96
+
97
+ ```
98
+ /login
99
+ ```
100
+
101
+ The login flow will:
102
+
103
+ 1. Open your browser to the Dodo Payments API Keys page.
104
+ 2. Prompt you to paste your API Key.
105
+ 3. Ask you to select an environment — **Test Mode** or **Live Mode**.
106
+ 4. Store the credentials in your OS secret store (Keychain on macOS, Credential Vault on Windows, libsecret on Linux).
107
+
108
+ > **Heads up:** Because we use the OS secret store, you may be prompted for your **device password** the first time the CLI reads or writes credentials. If you're upgrading from an older version, any existing plaintext API key will be **migrated to the secret store and the legacy file deleted** automatically.
109
+
110
+ ### Switching modes / logging out
111
+
112
+ You can keep one **Test Mode** and one **Live Mode** key authenticated at the same time. To clear credentials, use:
113
+
114
+ ```bash
115
+ dodo logout
116
+ # or, in the TUI
117
+ /logout
118
+ ```
76
119
 
77
- Note: Upto 1 Test Mode & 1 Live Mode can be used at the same time
120
+ The logout flow lets you choose between **All accounts**, **Test Mode**, or **Live Mode** independently.
78
121
 
79
122
  ## Usage
80
123
 
81
- The general syntax is:
124
+ You can use the CLI in two modes:
125
+
126
+ ### 1. Interactive TUI (recommended)
127
+
128
+ Just run:
82
129
 
83
130
  ```bash
84
- dodo <category> <sub-command>
131
+ dodo
85
132
  ```
86
133
 
87
- ### Products
134
+ This launches the full interactive interface. Type `/` to open the command palette, or just start typing — anything that isn't a slash command is sent to the AI assistant.
135
+
136
+ Use:
137
+ - `/help` to see all commands.
138
+ - `/exit` (or press `Esc` twice) to quit.
139
+ - `/clear` to clear the screen.
140
+ - `/update` to upgrade to the latest version when one is available.
141
+
142
+ ### 2. Direct subcommands
143
+
144
+ You can also run commands directly without entering the TUI:
145
+
146
+ ```bash
147
+ dodo <category> <sub-command> [args...]
148
+ ```
149
+
150
+ For example:
151
+
152
+ ```bash
153
+ dodo payments list 1
154
+ dodo customers create
155
+ dodo wh trigger
156
+ ```
157
+
158
+ The reference tables below show every command. In the TUI, prefix them with `/`; in direct mode, drop the `/`.
159
+
160
+ ---
88
161
 
89
- Manage your products catalog.
162
+ ### AI Assistant
163
+
164
+ Ask questions or take actions in natural language. The assistant uses `dodopayments-mcp` running locally — no additional setup or OAuth flow required, and your AI traffic doesn't leave your machine except to talk to the model provider.
90
165
 
91
166
  | Command | Description |
92
- |---------|-------------|
93
- | `dodo products list` | List all products |
94
- | `dodo products create` | Open dashboard to create a product |
95
- | `dodo products info` | View details for a specific product |
167
+ | --- | --- |
168
+ | `/ai <query>` | Ask the AI assistant a question or give it an instruction |
169
+ | _(any non-slash text)_ | Sent to the AI assistant by default while in the TUI |
96
170
 
97
- ### Payments
171
+ Examples:
172
+
173
+ ```
174
+ how much revenue did I make this week?
175
+ /ai create a new customer named Acme Inc.
176
+ /ai find my last failed payment
177
+ ```
98
178
 
99
- View payment transactions.
179
+ The assistant respects your active environment (Test / Live).
180
+
181
+ ### Products
100
182
 
101
183
  | Command | Description |
102
- |---------|-------------|
103
- | `dodo payments list` | List all payments |
104
- | `dodo payments info` | Get information about a specific payment |
184
+ | --- | --- |
185
+ | `/products list <page>` | List products |
186
+ | `/products create` | Open the dashboard to create a product |
187
+ | `/products info <id>` | View details for a specific product |
105
188
 
106
- ### Customers
189
+ ### Payments
107
190
 
108
- Manage your customer base.
191
+ | Command | Description |
192
+ | --- | --- |
193
+ | `/payments list <page>` | List payments |
194
+ | `/payments info <id>` | Get information about a specific payment |
195
+
196
+ ### Customers
109
197
 
110
198
  | Command | Description |
111
- |---------|-------------|
112
- | `dodo customers list` | List all customers |
113
- | `dodo customers create` | Create a new customer profile |
114
- | `dodo customers update` | Update an existing customer's details |
199
+ | --- | --- |
200
+ | `/customers list <page>` | List customers |
201
+ | `/customers create` | Create a new customer |
202
+ | `/customers update <id>` | Update an existing customer |
115
203
 
116
204
  ### Discounts
117
205
 
118
- Manage coupons and discounts.
119
-
120
206
  | Command | Description |
121
- |---------|-------------|
122
- | `dodo discounts list` | List all discounts |
123
- | `dodo discounts create` | Create a new percentage-based discount |
124
- | `dodo discounts delete` | Remove a discount by ID |
207
+ | --- | --- |
208
+ | `/discounts list <page>` | List discounts |
209
+ | `/discounts create` | Create a new percentage-based discount |
210
+ | `/discounts delete <id>` | Remove a discount by ID |
125
211
 
126
212
  ### Licenses
127
213
 
128
- Manage software licenses.
129
-
130
214
  | Command | Description |
131
- |---------|-------------|
132
- | `dodo licences list` | List all licenses |
215
+ | --- | --- |
216
+ | `/licences list <page>` | List licenses |
133
217
 
134
218
  ### Addons
135
219
 
136
- Manage your add-ons.
137
-
138
220
  | Command | Description |
139
- |---------|-------------|
140
- | `dodo addons list` | List all addons |
141
- | `dodo addons create` | Open dashboard to create an addon |
142
- | `dodo addons info` | View details for a specific addon |
221
+ | --- | --- |
222
+ | `/addons list <page>` | List addons |
223
+ | `/addons create` | Open the dashboard to create an addon |
224
+ | `/addons info <id>` | View details for a specific addon |
143
225
 
144
226
  ### Refunds
145
227
 
146
- Manage your refunds.
228
+ | Command | Description |
229
+ | --- | --- |
230
+ | `/refunds list <page>` | List refunds |
231
+ | `/refunds info <id>` | View details for a specific refund |
232
+
233
+ ### Checkout
147
234
 
148
235
  | Command | Description |
149
- |---------|-------------|
150
- | `dodo refund list` | List all refunds |
151
- | `dodo refund info` | View details for a specific refund |
236
+ | --- | --- |
237
+ | `/checkout new` | Interactively create a hosted checkout session and get a payment link |
152
238
 
153
239
  ### Webhooks
154
240
 
155
241
  Manage and test webhooks directly from the CLI.
156
242
 
157
243
  | Command | Description |
158
- |---------|-------------|
159
- | `dodo wh listen` | Listen for webhooks from Dodo Payments in real time and forward them to your local dev server |
160
- | `dodo wh trigger` | Trigger a test webhook event interactively |
244
+ | --- | --- |
245
+ | `/wh listen` | Listen for webhooks in real time and forward them to your local dev server |
246
+ | `/wh trigger` | Trigger a test webhook event interactively — even while logged out |
161
247
 
162
- > **Note:** The webhook triggering doesn't support signing requests yet. Please disable webhook signature verification while triggering. A simple way to do this is using `unsafe_unwrap()` instead of `unwrap()` in the webhook endpoint **during testing only**.
248
+ The `/wh trigger` flow guides you through:
163
249
 
164
- > **Note:** The webhook listening tool will only work with a test mode API key. If you use a live mode API key, it won't work.
165
-
166
- This interactive tool guides you through:
167
250
  1. Setting a destination **endpoint URL**
168
- 3. Selecting a specific **Event** to trigger
251
+ 2. Selecting a specific **event** to trigger
252
+
253
+ > **Note:** `/wh trigger` does **not** require login. It works as a local/offline webhook payload generator.
254
+
255
+ > **Note:** Triggered events are **not signed** yet. While testing, disable webhook signature verification on your endpoint — for example, use `unsafe_unwrap()` instead of `unwrap()` in your webhook handler **during testing only**.
256
+
257
+ > **Note:** `/wh listen` requires a **Test Mode** API key. Live Mode keys are not supported by the listen flow.
169
258
 
170
259
  ### Supported Webhook Events
171
260
 
172
261
  | Category | Events |
173
- |----------|--------|
262
+ | --- | --- |
174
263
  | **Subscription** | `active`, `updated`, `on_hold`, `renewed`, `plan_changed`, `cancelled`, `failed`, `expired` |
175
264
  | **Payment** | `success`, `failed`, `processing`, `cancelled` |
176
265
  | **Refund** | `success`, `failed` |
177
266
  | **Dispute** | `opened`, `expired`, `accepted`, `cancelled`, `challenged`, `won`, `lost` |
178
267
  | **License** | `created` |
179
268
 
269
+ ### Session commands
270
+
271
+ | Command | Description |
272
+ | --- | --- |
273
+ | `/help` | Show the command reference |
274
+ | `/update` | Check for and install a CLI update |
275
+ | `/login` | Authenticate with an API key |
276
+ | `/logout` | Sign out of one or all environments |
277
+ | `/clear` | Clear the TUI screen |
278
+ | `/exit` | Exit the TUI (also: type `exit`, or press `Esc` twice) |
279
+
280
+ ## Updates
281
+
282
+ The CLI checks for a newer version on startup and surfaces a notification in the status bar when one is available. To upgrade:
283
+
284
+ ```
285
+ /update
286
+ ```
287
+
288
+ Or, if you installed via a package manager, the usual `npm i -g dodopayments-cli` / `bun i -g dodopayments-cli` will also work.
289
+
180
290
  ## Contributing
181
291
 
182
- We welcome contributions from the community! Whether you're fixing bugs, adding new features, or improving documentation, your help is appreciated.
292
+ We welcome contributions from the community — whether you're fixing bugs, adding new features, or improving docs.
183
293
 
184
294
  Please read our [Contributing Guide](./CONTRIBUTING.md) to get started. We also have a [Code of Conduct](./CODE_OF_CONDUCT.md) that we expect all contributors to follow.
185
295
 
186
- ### Ways to Contribute
296
+ ### Ways to contribute
187
297
 
188
298
  - Report bugs and suggest features
189
299
  - Improve documentation
@@ -193,13 +303,28 @@ Please read our [Contributing Guide](./CONTRIBUTING.md) to get started. We also
193
303
 
194
304
  ## Support
195
305
 
196
- - [Discord Community](https://discord.gg/bYqAp4ayYh) - Get help and discuss with the community
197
- - [GitHub Issues](https://github.com/dodopayments/dodopayments-cli/issues) - Report bugs or request features
198
- - [Documentation](https://docs.dodopayments.com) - Learn more about Dodo Payments
306
+ - [Discord Community](https://discord.gg/bYqAp4ayYh) — chat with the team and other users
307
+ - [GitHub Issues](https://github.com/dodopayments/dodopayments-cli/issues) — report bugs or request features
308
+ - [Documentation](https://docs.dodopayments.com) — learn more about Dodo Payments
199
309
 
200
310
  ## License
201
311
 
202
- This project is licensed under the MIT License - see the [LICENSE](./LICENSE) file for details.
312
+ This project is licensed under the **GNU General Public License v3.0 or later** — see the [LICENSE](./LICENSE) file for the full text.
313
+
314
+ ```
315
+ Dodo Payments CLI — manage Dodo Payments resources from the terminal.
316
+ Copyright (C) 2025 Dodo Payments
317
+
318
+ This program is free software: you can redistribute it and/or modify it
319
+ under the terms of the GNU General Public License as published by the
320
+ Free Software Foundation, either version 3 of the License, or (at your
321
+ option) any later version.
322
+
323
+ This program is distributed in the hope that it will be useful, but
324
+ WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
325
+ or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
326
+ for more details.
327
+ ```
203
328
 
204
329
  ---
205
330
 
package/SECURITY.md CHANGED
@@ -6,7 +6,7 @@ We actively support the following versions with security updates:
6
6
 
7
7
  | Version | Supported |
8
8
  | ------- | ------------------ |
9
- | 0.1.x | :white_check_mark: |
9
+ | 3.x | :white_check_mark: |
10
10
 
11
11
  ## Reporting a Vulnerability
12
12
 
@@ -50,13 +50,6 @@ Please include the following information in your report:
50
50
 
51
51
  When using Dodo Payments CLI, please follow these security best practices:
52
52
 
53
- ### API Keys
54
-
55
- - **Never share your API keys** with anyone
56
- - **Use test mode keys** for development and testing
57
- - **Rotate keys** if you suspect they may have been compromised
58
- - The CLI stores your API key locally at `~/.dodopayments/api-key` - ensure this file has appropriate permissions
59
-
60
53
  ### Running the CLI
61
54
 
62
55
  - **Download only from official sources**: npm, GitHub releases, or bun
@@ -75,9 +68,7 @@ The CLI stores the following data locally:
75
68
 
76
69
  | Data | Location | Purpose |
77
70
  |------|----------|---------|
78
- | API Key | `~/.dodopayments/api-key` | Authentication |
79
-
80
- Ensure your home directory has appropriate access controls to protect this sensitive data.
71
+ | API Key | OS secret store (Credential Vault, Keychain, etc.) | Authentication |
81
72
 
82
73
  ## Vulnerability Disclosure Policy
83
74
 
package/build-binaries.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { rename, rm } from "node:fs/promises";
2
+ import solidPlugin from "@opentui/solid/bun-plugin";
2
3
 
3
4
  const targets: any = [
4
5
  "bun-darwin-x64",
@@ -17,6 +18,7 @@ for (const target of targets) {
17
18
  entrypoints: ["./src/index.ts"],
18
19
  outdir: tempDir,
19
20
  target: "bun",
21
+ plugins: [solidPlugin],
20
22
  compile: {
21
23
  // `as any` cause Bun doesn't provide type of exact platforms
22
24
  target: target as any,
package/bunfig.toml ADDED
@@ -0,0 +1 @@
1
+ preload = ["@opentui/solid/preload"]