dodopayments-cli 3.1.0 → 3.3.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.
@@ -5,12 +5,78 @@ on:
5
5
  types: [published]
6
6
 
7
7
  permissions:
8
- contents: read
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
@@ -40,6 +40,7 @@ Manage your [Dodo Payments](https://dodopayments.com/) resources, test webhooks,
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
+ - **Scaffolding support** — scaffold billing routes for Next.js, Express, and Better-Auth.
43
44
 
44
45
  ## Installation
45
46
 
@@ -200,6 +201,7 @@ The assistant respects your active environment (Test / Live).
200
201
  | `/customers list <page>` | List customers |
201
202
  | `/customers create` | Create a new customer (TUI only) |
202
203
  | `/customers update <id>` | Update an existing customer (TUI only) |
204
+ | `/customers portal <id>` | Create a temporary customer portal session |
203
205
 
204
206
  ### Discounts
205
207
 
@@ -268,6 +270,14 @@ The interactive `/wh trigger` flow guides you through:
268
270
  | **Dispute** | `opened`, `expired`, `accepted`, `cancelled`, `challenged`, `won`, `lost` |
269
271
  | **License** | `created` |
270
272
 
273
+ ### Init commands
274
+
275
+ | Command | Description |
276
+ | --- | --- |
277
+ | `/init nextjs` | Initialize Next.js App Router billing routes |
278
+ | `/init express` | Initialize Express server billing routes |
279
+ | `/init better-auth [plugins]` | Initialize Better-Auth plugin configuration (plugins: `checkout`, `portal`, `usage`, `webhooks`) |
280
+
271
281
  ### Session commands
272
282
 
273
283
  | Command | Description |
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 | OS secret store (Credential Vault, Keychain, etc.) | Authentication |
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