dodopayments-cli 3.0.3 → 3.2.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/.github/workflows/publish.yml +70 -4
- package/README.md +17 -14
- package/SECURITY.md +3 -2
- package/dist/index.js +113 -110
- package/fetch-cross-deps.ts +16 -0
- package/package.json +3 -2
- package/scripts/build.ts +1 -2
|
@@ -5,12 +5,78 @@ on:
|
|
|
5
5
|
types: [published]
|
|
6
6
|
|
|
7
7
|
permissions:
|
|
8
|
-
contents:
|
|
8
|
+
contents: write
|
|
9
9
|
id-token: write
|
|
10
10
|
|
|
11
11
|
jobs:
|
|
12
|
+
binaries:
|
|
13
|
+
name: Build and upload release binaries
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
steps:
|
|
16
|
+
- name: Checkout
|
|
17
|
+
uses: actions/checkout@v4
|
|
18
|
+
|
|
19
|
+
- name: Setup Bun
|
|
20
|
+
uses: oven-sh/setup-bun@v2
|
|
21
|
+
with:
|
|
22
|
+
bun-version: 'latest'
|
|
23
|
+
|
|
24
|
+
- name: Update package.json version from release tag
|
|
25
|
+
env:
|
|
26
|
+
TAG_NAME: ${{ github.ref_name }}
|
|
27
|
+
run: |
|
|
28
|
+
TAG_STRIPPED="${TAG_NAME#v}"
|
|
29
|
+
node -e "
|
|
30
|
+
const fs = require('fs');
|
|
31
|
+
const pkg = JSON.parse(fs.readFileSync('./package.json', 'utf8'));
|
|
32
|
+
pkg.version = '${TAG_STRIPPED}';
|
|
33
|
+
fs.writeFileSync('./package.json', JSON.stringify(pkg, null, 2) + '\n');
|
|
34
|
+
"
|
|
35
|
+
|
|
36
|
+
- name: Install dependencies
|
|
37
|
+
env:
|
|
38
|
+
NODE_ENV: development # For devDependencies to be present
|
|
39
|
+
run: bun install --frozen-lockfile
|
|
40
|
+
|
|
41
|
+
- name: Fetch cross-platform dependencies
|
|
42
|
+
run: bun run fetch-cross-deps.ts
|
|
43
|
+
|
|
44
|
+
- name: Build cross-platform binaries
|
|
45
|
+
env:
|
|
46
|
+
NODE_ENV: development # For devDependencies to be present
|
|
47
|
+
run: bun run build-native
|
|
48
|
+
|
|
49
|
+
- name: Generate SHA256SUMS
|
|
50
|
+
working-directory: dist
|
|
51
|
+
run: |
|
|
52
|
+
shasum -a 256 \
|
|
53
|
+
dodo-cli-darwin-arm64 \
|
|
54
|
+
dodo-cli-darwin-x64 \
|
|
55
|
+
dodo-cli-linux-arm64 \
|
|
56
|
+
dodo-cli-linux-x64 \
|
|
57
|
+
dodo-cli-windows-x64.exe \
|
|
58
|
+
> SHA256SUMS.txt
|
|
59
|
+
echo "--- SHA256SUMS.txt ---"
|
|
60
|
+
cat SHA256SUMS.txt
|
|
61
|
+
|
|
62
|
+
- name: Upload binaries to release
|
|
63
|
+
env:
|
|
64
|
+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
65
|
+
TAG_NAME: ${{ github.ref_name }}
|
|
66
|
+
run: |
|
|
67
|
+
gh release upload "${TAG_NAME}" \
|
|
68
|
+
dist/dodo-cli-darwin-arm64 \
|
|
69
|
+
dist/dodo-cli-darwin-x64 \
|
|
70
|
+
dist/dodo-cli-linux-arm64 \
|
|
71
|
+
dist/dodo-cli-linux-x64 \
|
|
72
|
+
dist/dodo-cli-windows-x64.exe \
|
|
73
|
+
dist/SHA256SUMS.txt \
|
|
74
|
+
--clobber
|
|
75
|
+
|
|
12
76
|
publish:
|
|
77
|
+
name: Publish to npm
|
|
13
78
|
runs-on: ubuntu-latest
|
|
79
|
+
needs: binaries
|
|
14
80
|
steps:
|
|
15
81
|
- name: Checkout
|
|
16
82
|
uses: actions/checkout@v4
|
|
@@ -33,7 +99,7 @@ jobs:
|
|
|
33
99
|
echo "TAG_NAME=${TAG_NAME}"
|
|
34
100
|
TAG_STRIPPED="${TAG_NAME#v}"
|
|
35
101
|
echo "Updating package.json version to: ${TAG_STRIPPED}"
|
|
36
|
-
|
|
102
|
+
|
|
37
103
|
# Update package.json version using node
|
|
38
104
|
node -e "
|
|
39
105
|
const fs = require('fs');
|
|
@@ -42,7 +108,7 @@ jobs:
|
|
|
42
108
|
fs.writeFileSync('./package.json', JSON.stringify(pkg, null, 2) + '\n');
|
|
43
109
|
console.log('Updated package.json version to:', pkg.version);
|
|
44
110
|
"
|
|
45
|
-
|
|
111
|
+
|
|
46
112
|
# Verify the update
|
|
47
113
|
PKG_VERSION=$(node -p "require('./package.json').version")
|
|
48
114
|
echo "package.json version after update: ${PKG_VERSION}"
|
|
@@ -52,7 +118,7 @@ jobs:
|
|
|
52
118
|
fi
|
|
53
119
|
|
|
54
120
|
- name: Install dependencies
|
|
55
|
-
run: bun install
|
|
121
|
+
run: bun install --frozen-lockfile
|
|
56
122
|
|
|
57
123
|
- name: Build
|
|
58
124
|
run: bun run build
|
package/README.md
CHANGED
|
@@ -37,7 +37,7 @@ Manage your [Dodo Payments](https://dodopayments.com/) resources, test webhooks,
|
|
|
37
37
|
|
|
38
38
|
- **Interactive TUI** — launch `dodo` with no arguments to open the full interactive interface with command palette, history, and live notifications.
|
|
39
39
|
- **AI assistant built in** — ask questions or take actions in plain English with `/ai`. No extra setup, runs `dodopayments-mcp` locally.
|
|
40
|
-
- **
|
|
40
|
+
- **Encrypted at rest** — API keys are stored in `~/.dodopayments/config.json`, AES-256-GCM encrypted with a machine-derived key. No plaintext credentials on disk.
|
|
41
41
|
- **Auto update** — the CLI checks for new versions and notifies you in-app. Run `/update` to upgrade in place.
|
|
42
42
|
- **Webhook tooling** — listen for live webhooks or trigger payloads offline for local development.
|
|
43
43
|
|
|
@@ -103,9 +103,9 @@ The login flow will:
|
|
|
103
103
|
1. Open your browser to the Dodo Payments API Keys page.
|
|
104
104
|
2. Prompt you to paste your API Key.
|
|
105
105
|
3. Ask you to select an environment — **Test Mode** or **Live Mode**.
|
|
106
|
-
4. Store the credentials
|
|
106
|
+
4. Store the credentials encrypted at `~/.dodopayments/config.json` (AES-256-GCM, machine-bound key).
|
|
107
107
|
|
|
108
|
-
> **
|
|
108
|
+
> **Upgrading from v3.0.x?** Your previous keychain-stored credentials won't carry over — just run `dodo login` once to re-authenticate.
|
|
109
109
|
|
|
110
110
|
### Switching modes / logging out
|
|
111
111
|
|
|
@@ -151,11 +151,11 @@ For example:
|
|
|
151
151
|
|
|
152
152
|
```bash
|
|
153
153
|
dodo payments list 1
|
|
154
|
-
dodo customers
|
|
155
|
-
dodo wh trigger
|
|
154
|
+
dodo customers list
|
|
155
|
+
dodo wh trigger payment.success http://localhost:3000/webhook
|
|
156
156
|
```
|
|
157
157
|
|
|
158
|
-
The reference tables below show every command. In the TUI, prefix them with `/`; in direct mode, drop the `/`.
|
|
158
|
+
The reference tables below show every command. In the TUI, prefix them with `/`; in direct mode, drop the `/`. Commands marked `(TUI only)` are interactive wizards and only work inside the TUI.
|
|
159
159
|
|
|
160
160
|
---
|
|
161
161
|
|
|
@@ -198,16 +198,17 @@ The assistant respects your active environment (Test / Live).
|
|
|
198
198
|
| Command | Description |
|
|
199
199
|
| --- | --- |
|
|
200
200
|
| `/customers list <page>` | List customers |
|
|
201
|
-
| `/customers create` | Create a new customer |
|
|
202
|
-
| `/customers update <id>` | Update an existing customer |
|
|
201
|
+
| `/customers create` | Create a new customer (TUI only) |
|
|
202
|
+
| `/customers update <id>` | Update an existing customer (TUI only) |
|
|
203
|
+
| `/customers portal <id>` | Create a temporary customer portal session |
|
|
203
204
|
|
|
204
205
|
### Discounts
|
|
205
206
|
|
|
206
207
|
| Command | Description |
|
|
207
208
|
| --- | --- |
|
|
208
209
|
| `/discounts list <page>` | List discounts |
|
|
209
|
-
| `/discounts create` | Create a new percentage-based discount |
|
|
210
|
-
| `/discounts delete <id>` | Remove a discount by ID |
|
|
210
|
+
| `/discounts create` | Create a new percentage-based discount (TUI only) |
|
|
211
|
+
| `/discounts delete <id>` | Remove a discount by ID (TUI only) |
|
|
211
212
|
|
|
212
213
|
### Licenses
|
|
213
214
|
|
|
@@ -234,7 +235,7 @@ The assistant respects your active environment (Test / Live).
|
|
|
234
235
|
|
|
235
236
|
| Command | Description |
|
|
236
237
|
| --- | --- |
|
|
237
|
-
| `/checkout new` | Interactively create a hosted checkout session and get a payment link |
|
|
238
|
+
| `/checkout new` | Interactively create a hosted checkout session and get a payment link (TUI only) |
|
|
238
239
|
|
|
239
240
|
### Webhooks
|
|
240
241
|
|
|
@@ -242,10 +243,12 @@ Manage and test webhooks directly from the CLI.
|
|
|
242
243
|
|
|
243
244
|
| Command | Description |
|
|
244
245
|
| --- | --- |
|
|
245
|
-
| `/wh listen
|
|
246
|
-
| `/wh trigger
|
|
246
|
+
| `/wh listen <url>` | Listen for webhooks in real time and forward them to `<url>` |
|
|
247
|
+
| `/wh trigger <event> <url>` | Trigger a test webhook event offline — even while logged out |
|
|
247
248
|
|
|
248
|
-
|
|
249
|
+
In the TUI, omitting the args (`/wh listen` or `/wh trigger`) opens an interactive wizard. In direct mode (`dodo wh …`), both arguments are required.
|
|
250
|
+
|
|
251
|
+
The interactive `/wh trigger` flow guides you through:
|
|
249
252
|
|
|
250
253
|
1. Setting a destination **endpoint URL**
|
|
251
254
|
2. Selecting a specific **event** to trigger
|
package/SECURITY.md
CHANGED
|
@@ -64,11 +64,12 @@ When using Dodo Payments CLI, please follow these security best practices:
|
|
|
64
64
|
|
|
65
65
|
## Local Storage
|
|
66
66
|
|
|
67
|
-
The CLI stores the following data locally:
|
|
67
|
+
The CLI stores the following data locally within the `~/.dodopayments/` directory (created with strict `0o700` permissions):
|
|
68
68
|
|
|
69
69
|
| Data | Location | Purpose |
|
|
70
70
|
|------|----------|---------|
|
|
71
|
-
| API Key |
|
|
71
|
+
| API Key | `~/.dodopayments/config.json` | Encrypted authentication credentials (AES-256-GCM encrypted using a machine-derived key, stored with strict `0o600` permissions) |
|
|
72
|
+
| Active Mode / Session State | `~/.dodopayments/state.json` | Remembers the active environment mode (`test_mode` or `live_mode`) for the session |
|
|
72
73
|
|
|
73
74
|
## Vulnerability Disclosure Policy
|
|
74
75
|
|