@stripe/link-cli 0.5.0 → 0.7.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 +31 -1
- package/dist/cli.js +1436 -745
- package/package.json +11 -11
package/README.md
CHANGED
|
@@ -58,6 +58,17 @@ Link CLI can run as a local MCP server. Add the following to your MCP client con
|
|
|
58
58
|
}
|
|
59
59
|
```
|
|
60
60
|
|
|
61
|
+
#### HTTP MCP Server
|
|
62
|
+
|
|
63
|
+
Use `serve` to expose link-cli as an MCP endpoint over HTTP. This is useful for remote or containerised agents that can't launch a local subprocess.
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
link-cli serve # listens on port 54321 by default
|
|
67
|
+
link-cli serve --port 8080
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
The MCP endpoint is available at `/mcp` on the chosen port.
|
|
71
|
+
|
|
61
72
|
## Quickstart
|
|
62
73
|
|
|
63
74
|
Run a guided onboarding and demo flow:
|
|
@@ -173,12 +184,15 @@ link-cli mpp pay https://climate.stripe.dev/api/contribute \
|
|
|
173
184
|
|
|
174
185
|
```bash
|
|
175
186
|
link-cli auth login --client-name "Claude Code" # identify the connecting agent
|
|
187
|
+
link-cli auth login --client-name "Claude Code" --interval 5 --timeout 300 # login + poll in one call
|
|
176
188
|
link-cli auth status # check auth status
|
|
177
189
|
link-cli auth logout # disconnect
|
|
178
190
|
```
|
|
179
191
|
|
|
180
192
|
When you provide `--client-name`, the Link app displays it when you approve the connection — for example, `Claude Code on my-macbook` instead of `link-cli on my-macbook`.
|
|
181
193
|
|
|
194
|
+
With `--interval`, the login command yields the verification code immediately and then polls inline until authenticated or timed out — no separate `auth status` call needed. This is recommended for agents that cannot relay the code while a separate polling command blocks their I/O channel.
|
|
195
|
+
|
|
182
196
|
`auth status` includes an `update` field when a newer version is available:
|
|
183
197
|
|
|
184
198
|
```json
|
|
@@ -202,7 +216,7 @@ A spend request moves through: **create** → **request approval** → **approve
|
|
|
202
216
|
|
|
203
217
|
**Required fields for create:** `payment_method_id`, `merchant_name`, `merchant_url`, `context`, `amount`
|
|
204
218
|
|
|
205
|
-
**Constraints:** `context` must be at least 100 characters; `amount` must not exceed 50000 (cents); `currency` must be a 3-letter ISO code.
|
|
219
|
+
**Constraints:** `context` must be at least 100 characters; `amount` must not exceed 50000 (cents); `currency` must be a 3-letter ISO code. The user has 10 minutes from when approval is requested to approve. Approved credentials (card or SPT) are valid for 12 hours from spend request creation.
|
|
206
220
|
**Test mode:** Pass `--test` to create testmode credentials (uses test card `4242424242424242`), useful for development and integration testing without real payment methods.
|
|
207
221
|
|
|
208
222
|
```bash
|
|
@@ -220,6 +234,19 @@ link-cli spend-request retrieve lsrq_001
|
|
|
220
234
|
link-cli spend-request cancel lsrq_001
|
|
221
235
|
```
|
|
222
236
|
|
|
237
|
+
### Limits
|
|
238
|
+
|
|
239
|
+
| Limit | Value |
|
|
240
|
+
|-------|-------|
|
|
241
|
+
| Max amount per spend request | $500 (50,000 cents) |
|
|
242
|
+
| Approval window | 10 minutes — user must approve within 10 min of `request-approval` |
|
|
243
|
+
| Card / SPT validity | 12 hours from spend request creation |
|
|
244
|
+
| Daily spend | $500 |
|
|
245
|
+
| Concurrent active requests (created + approved) | 30 |
|
|
246
|
+
| Concurrent approved requests | 10 |
|
|
247
|
+
| Hourly creation rate | 50 per hour |
|
|
248
|
+
| Rolling creation rate | 200 per 60 days |
|
|
249
|
+
|
|
223
250
|
### MPP
|
|
224
251
|
|
|
225
252
|
Use `mpp pay` to complete purchases on merchants that use the [Machine Payments Protocol](https://mpp.dev). The spend request must use `credential_type: "shared_payment_token"` and you must approve it before paying. The SPT is one-time-use — if payment fails, create a new spend request.
|
|
@@ -244,6 +271,9 @@ link-cli mpp decode \
|
|
|
244
271
|
| Variable | Effect |
|
|
245
272
|
|----------|--------|
|
|
246
273
|
| `LINK_AUTH_FILE` | Same as `--auth` — override the auth credential file path (flag takes precedence) |
|
|
274
|
+
| `LINK_ACCESS_TOKEN` | Use this access token directly, bypassing auth storage |
|
|
275
|
+
| `LINK_REFRESH_TOKEN` | Refresh token to use when `LINK_ACCESS_TOKEN` is expired |
|
|
276
|
+
| `LINK_NO_REFRESH` | When set, never auto-refresh the access token — error instead |
|
|
247
277
|
| `LINK_API_BASE_URL` | Override the API base URL |
|
|
248
278
|
| `LINK_AUTH_BASE_URL` | Override the auth base URL |
|
|
249
279
|
| `LINK_HTTP_PROXY` | Route all requests through an HTTP proxy (requires `undici`) |
|