@stripe/link-cli 0.14.0 → 0.14.1
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 +165 -134
- package/dist/cli.js +4 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -2,13 +2,38 @@
|
|
|
2
2
|
|
|
3
3
|
Link CLI lets agents get secure, one-time-use payment credentials from a Link wallet to complete purchases on your behalf — without storing your real card details.
|
|
4
4
|
|
|
5
|
-
The CLI can produce one of
|
|
5
|
+
The CLI can produce one of three credential types:
|
|
6
6
|
|
|
7
7
|
- A virtual card (PAN) for use with a standard web checkout form. The issued card works anywhere, and is not restricted to Link-enabled sellers or sellers that use Stripe.
|
|
8
|
-
- A
|
|
8
|
+
- A Link Pay Token (LPT) for use with a Stripe hosted payment form. Stripe checkout pages expose an agent steering block that allows agents to complete the checkout.
|
|
9
|
+
- A [Shared Payment Token](https://docs.stripe.com/agentic-commerce/concepts/shared-payment-tokens) (SPT) for use when the seller accepts programmatic payments through [Machine Payment Protocols](https://mpp.dev) (MPP)
|
|
9
10
|
|
|
10
11
|
For now, this is only available to US Link accounts.
|
|
11
12
|
|
|
13
|
+
Documentation:
|
|
14
|
+
|
|
15
|
+
- [Installation](#installation)
|
|
16
|
+
- [Quickstart](#quickstart)
|
|
17
|
+
- [Advanced usage](#advanced)
|
|
18
|
+
- [Authentication](#authentication)
|
|
19
|
+
- [The spend request lifecycle](#spend-request-lifecycle)
|
|
20
|
+
- [Credential type: Shared Payment Token](#shared-payment-token)
|
|
21
|
+
- [Credential type: Link Pay Token](#link-pay-token)
|
|
22
|
+
- [Limits](#limits)
|
|
23
|
+
- [Reporting issues](#report-outcomes)
|
|
24
|
+
- [Handling step ups](#handle-step-ups)
|
|
25
|
+
- [Adding line items and totals](#line-items-and-totals)
|
|
26
|
+
- [Approval details](#approval-details)
|
|
27
|
+
- [Metadata](#metadata)
|
|
28
|
+
- [Environment variables](#environment-variables)
|
|
29
|
+
- [Integrating into your agent](#integrating-into-agents)
|
|
30
|
+
- [Onboarding and Demos](#onboarding-and-demos)
|
|
31
|
+
- [Development](#development)
|
|
32
|
+
- [Releasing](#releasing)
|
|
33
|
+
|
|
34
|
+
> [!TIP]
|
|
35
|
+
> If you're looking to integrate the Link CLI into your product or agent for consumers to pay with, be sure to look at [Integrating into your agent](#integrating-into-agents).
|
|
36
|
+
|
|
12
37
|
## Installation
|
|
13
38
|
|
|
14
39
|
```bash
|
|
@@ -23,7 +48,7 @@ npx @stripe/link-cli
|
|
|
23
48
|
|
|
24
49
|
### Use with agents
|
|
25
50
|
|
|
26
|
-
Install the
|
|
51
|
+
Install the skills:
|
|
27
52
|
|
|
28
53
|
```bash
|
|
29
54
|
npx skills add stripe/link-cli
|
|
@@ -58,9 +83,7 @@ Link CLI can run as a local MCP server. Add the following to your MCP client con
|
|
|
58
83
|
}
|
|
59
84
|
```
|
|
60
85
|
|
|
61
|
-
|
|
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.
|
|
86
|
+
Alternatively, use `serve` to expose link-cli as an MCP endpoint over HTTP.
|
|
64
87
|
|
|
65
88
|
```bash
|
|
66
89
|
link-cli serve # binds 127.0.0.1:54321 (loopback only)
|
|
@@ -80,7 +103,7 @@ link-cli onboard
|
|
|
80
103
|
|
|
81
104
|
### Login
|
|
82
105
|
|
|
83
|
-
The `link-cli` requires a Link account. You can log in to your existing one or [
|
|
106
|
+
The `link-cli` requires a Link account. You can log in to your existing one or [create one online](https://app.link.com).
|
|
84
107
|
|
|
85
108
|
```bash
|
|
86
109
|
link-cli auth login
|
|
@@ -120,88 +143,10 @@ link-cli spend-request create \
|
|
|
120
143
|
--request-approval
|
|
121
144
|
```
|
|
122
145
|
|
|
123
|
-
The `--request-approval` flag triggers a push notification to the user for approval, then polls until the request is approved or denied.
|
|
146
|
+
The `--request-approval` flag triggers a push notification to the user for approval, then polls until the request is approved or denied. Polling exits successfully only after the request reaches a terminal status such as `approved`, `denied`, `expired`, or `canceled`.
|
|
124
147
|
|
|
125
148
|
Easily approve requests with the [Link app](https://link.com/download).
|
|
126
149
|
|
|
127
|
-
If the created spend request comes back with `status: "requires_action"`, no approval is needed yet — the payment method or account needs attention first. Check `status_details.requires_action.next_action` for `type`, `display_message`, `action_url`, and `resolution`. For 3D Secure (`resolution: "auto_resume"`), keep polling `spend-request retrieve` — the request resolves on its own once the challenge is completed. For any other resolution, complete the indicated action and create a new spend request.
|
|
128
|
-
|
|
129
|
-
#### Line items and totals
|
|
130
|
-
|
|
131
|
-
`--line-item` and `--total` use repeatable `key:value` format.
|
|
132
|
-
|
|
133
|
-
**`--line-item` keys:** `name` (required), `quantity`, `unit_amount`, `description`, `sku`, `url`, `image_url`, `product_url`
|
|
134
|
-
|
|
135
|
-
```bash
|
|
136
|
-
--line-item "name:Running Shoes,unit_amount:12000,quantity:1,description:Trail runners"
|
|
137
|
-
```
|
|
138
|
-
|
|
139
|
-
**`--total` keys:** `type` (required; one of: `subtotal`, `tax`, `total`, `items_base_amount`, `items_discount`, `discount`, `fulfillment`, `shipping`, `fee`, `gift_wrap`, `tip`, `store_credit`), `display_text` (required), `amount` (required)
|
|
140
|
-
|
|
141
|
-
```bash
|
|
142
|
-
--total "type:subtotal,display_text:Subtotal,amount:12000" \
|
|
143
|
-
--total "type:total,display_text:Total,amount:12000"
|
|
144
|
-
```
|
|
145
|
-
|
|
146
|
-
#### Approval details
|
|
147
|
-
|
|
148
|
-
For delegated/pre-approved flows, pass `--approval-detail` with a JSON object describing how the user approved the request. Required fields: `approved_at` (unix timestamp), `approval_method` (`click`, `programmatic`, or `voice`), `app_name`, `external_user_id`. Optional: `ip_address`, `user_agent`, `device_type` (`mobile` or `web`), `agent_log_id`, `external_user_name`, `external_session_id`, `authentication_method` (`biometric_face`, `biometric_fingerprint`, or `passkey`).
|
|
149
|
-
|
|
150
|
-
In CLI mode, pass as a JSON string:
|
|
151
|
-
|
|
152
|
-
```bash
|
|
153
|
-
link-cli spend-request create ... \
|
|
154
|
-
--approval-detail '{"approved_at":1720000000,"approval_method":"click","app_name":"MyApp","external_user_id":"usr_123"}'
|
|
155
|
-
```
|
|
156
|
-
|
|
157
|
-
In MCP/agent mode, pass as a structured object.
|
|
158
|
-
|
|
159
|
-
#### Metadata
|
|
160
|
-
|
|
161
|
-
Attach arbitrary string data to a spend request with the repeatable `--metadata` flag (`key:value` format). Max 50 keys, key ≤ 40 chars, value ≤ 500 chars.
|
|
162
|
-
|
|
163
|
-
```bash
|
|
164
|
-
link-cli spend-request create ... \
|
|
165
|
-
--metadata "order_id:ord_123" \
|
|
166
|
-
--metadata "team:growth"
|
|
167
|
-
```
|
|
168
|
-
|
|
169
|
-
In MCP/agent mode, pass `metadata` as a structured `{ key: value }` object.
|
|
170
|
-
|
|
171
|
-
#### Credential types
|
|
172
|
-
|
|
173
|
-
By default, a spend request provisions a virtual card. For merchants that support the [Machine Payments Protocol](https://mpp.dev) (HTTP 402) and the Stripe payment method, instead pass `--credential-type "shared_payment_token"`.
|
|
174
|
-
|
|
175
|
-
#### Link Pay Token
|
|
176
|
-
|
|
177
|
-
Some Stripe checkout pages expose an AI-agent steering block that supports a
|
|
178
|
-
Link Pay Token (LPT). Inspect the checkout in a browser before creating the
|
|
179
|
-
SpendRequest: enable the agent checkbox, then verify that both
|
|
180
|
-
`input[name="link_pay_token"]` and
|
|
181
|
-
`data-stripe-merchant-account="acct_..."` are present in the same Stripe
|
|
182
|
-
frame.
|
|
183
|
-
|
|
184
|
-
Create an LPT-bound request with the DOM-derived account ID. Do not pass
|
|
185
|
-
`--merchant-name` or `--merchant-url`; Link resolves the canonical merchant
|
|
186
|
-
identity from the account ID for the approval screen.
|
|
187
|
-
|
|
188
|
-
```bash
|
|
189
|
-
link-cli spend-request create \
|
|
190
|
-
--payment-method-id csmrpd_xxx \
|
|
191
|
-
--execution-method link_pay_token \
|
|
192
|
-
--merchant-account-id acct_... \
|
|
193
|
-
--context "Purchasing an item from the checkout the agent inspected. The user initiated this purchase through the shopping assistant." \
|
|
194
|
-
--amount 3500 \
|
|
195
|
-
--request-approval
|
|
196
|
-
```
|
|
197
|
-
|
|
198
|
-
LPT requests use the default `card` credential type and do not support
|
|
199
|
-
`--test`, `--network-id`, or `shared_payment_token`. After approval, retrieve
|
|
200
|
-
`--include link_pay_token` immediately before using it on the same checkout
|
|
201
|
-
surface. Each returned LPT is valid for up to 30 minutes, or until the
|
|
202
|
-
SpendRequest expires. If either DOM marker is absent, create a regular virtual
|
|
203
|
-
card SpendRequest instead; do not create an LPT request.
|
|
204
|
-
|
|
205
150
|
### Execute payment
|
|
206
151
|
|
|
207
152
|
The approved spend request includes a `card` object with `number`, `cvc`, `exp_month`, `exp_year`, `billing_address`, and `valid_until`. Enter these into the merchant's checkout form.
|
|
@@ -225,17 +170,6 @@ For agent polling, pass `--interval` and optionally `--max-attempts`:
|
|
|
225
170
|
link-cli spend-request retrieve lsrq_001 --interval 2 --max-attempts 300
|
|
226
171
|
```
|
|
227
172
|
|
|
228
|
-
Polling exits successfully only after the request reaches a terminal status such as `approved`, `denied`, `expired`, or `canceled`. If the status becomes `requires_action`, behavior depends on `next_action.resolution`: `auto_resume` (used for 3D Secure) means polling continues automatically — the request resolves on its own once the user completes the challenge. Any other resolution stops polling immediately and the command exits with the `next_action` details instead of waiting for a terminal status; the caller must have the user act, then create a new spend request. If `--timeout` is reached or `--max-attempts` is exhausted while the request is still non-terminal, the command exits non-zero with `code: "POLLING_TIMEOUT"` so callers do not treat a still-pending request as complete.
|
|
229
|
-
|
|
230
|
-
If the merchant supports MPP, use `link-cli mpp pay` instead:
|
|
231
|
-
|
|
232
|
-
```bash
|
|
233
|
-
link-cli mpp pay https://climate.stripe.dev/api/contribute \
|
|
234
|
-
--spend-request-id lsrq_001 \
|
|
235
|
-
--method POST \
|
|
236
|
-
--data '{"amount":100}'
|
|
237
|
-
```
|
|
238
|
-
|
|
239
173
|
## Advanced
|
|
240
174
|
|
|
241
175
|
### Authentication
|
|
@@ -250,7 +184,7 @@ link-cli auth logout # disconnect
|
|
|
250
184
|
|
|
251
185
|
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`.
|
|
252
186
|
|
|
253
|
-
With `--interval`, the login command yields the verification code immediately and then polls inline until authenticated or
|
|
187
|
+
With `--interval`, the login command yields the verification code immediately and then polls inline until authenticated or time 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.
|
|
254
188
|
|
|
255
189
|
`auth upgrade` takes the same flags as `auth login` but is meant for widening access when you're already logged in. Unlike `auth login` — which stops with an "already logged in" message when a valid session exists — `auth upgrade` merges the flags you pass with your currently granted `scope` and `authorization_details` and starts a new approval for the **superset**, so you never accidentally drop access. If there's no valid session, it prints a warning and continues with just the access you requested. Your current session stays valid throughout the approval and is only replaced (and the old grant revoked) once you approve the new one — so abandoning the approval leaves your existing session untouched.
|
|
256
190
|
|
|
@@ -305,23 +239,22 @@ link-cli spend-request retrieve lsrq_001
|
|
|
305
239
|
link-cli spend-request cancel lsrq_001
|
|
306
240
|
```
|
|
307
241
|
|
|
308
|
-
###
|
|
242
|
+
### Credential types
|
|
309
243
|
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
| Daily spend | $500 |
|
|
316
|
-
| Monthly spend (30 days) | $20,000 |
|
|
317
|
-
| Concurrent active requests (created + approved) | 30 |
|
|
318
|
-
| Concurrent approved requests | 10 |
|
|
319
|
-
| Hourly creation rate | 50 per hour |
|
|
320
|
-
| Rolling creation rate | 200 per 60 days |
|
|
244
|
+
By default, a spend request provisions a virtual card. Link can also provide a shared payment token (SPT) for use with the Machine Payment Protocol (MPP) and a Link Pay Token (LPT) for use on Stripe hosted checkout forms.
|
|
245
|
+
|
|
246
|
+
### Shared Payment Token
|
|
247
|
+
|
|
248
|
+
For merchants that support the [Machine Payments Protocol](https://mpp.dev) (HTTP 402) and the Stripe payment method, instead pass `--credential-type "shared_payment_token"` when creating the spend request. The SPT is one-time-use — if payment fails, create a new spend request.
|
|
321
249
|
|
|
322
|
-
|
|
250
|
+
Use `mpp decode` to validate a raw `WWW-Authenticate` header and extract the `network_id` needed for `shared_payment_token` spend requests:
|
|
251
|
+
|
|
252
|
+
```bash
|
|
253
|
+
link-cli mpp decode \
|
|
254
|
+
--challenge 'Payment id="ch_001", realm="merchant.example", method="stripe", intent="charge", request="..."'
|
|
255
|
+
```
|
|
323
256
|
|
|
324
|
-
Use `mpp pay` to complete purchases
|
|
257
|
+
Use `mpp pay` to complete purchases:
|
|
325
258
|
|
|
326
259
|
```bash
|
|
327
260
|
link-cli mpp pay https://climate.stripe.dev/api/contribute \
|
|
@@ -331,13 +264,53 @@ link-cli mpp pay https://climate.stripe.dev/api/contribute \
|
|
|
331
264
|
--header "X-Custom: value"
|
|
332
265
|
```
|
|
333
266
|
|
|
334
|
-
|
|
267
|
+
### Link Pay Token
|
|
268
|
+
|
|
269
|
+
Some Stripe checkout pages expose an AI-agent steering block that supports a
|
|
270
|
+
Link Pay Token (LPT). Inspect the checkout in a browser before creating the
|
|
271
|
+
SpendRequest: enable the agent checkbox, then verify that both
|
|
272
|
+
`input[name="link_pay_token"]` and
|
|
273
|
+
`data-stripe-merchant-account="acct_..."` are present in the same Stripe
|
|
274
|
+
frame.
|
|
275
|
+
|
|
276
|
+
Create an LPT-bound request with the DOM-derived account ID. Do not pass
|
|
277
|
+
`--merchant-name` or `--merchant-url`; Link resolves the canonical merchant
|
|
278
|
+
identity from the account ID for the approval screen.
|
|
335
279
|
|
|
336
280
|
```bash
|
|
337
|
-
link-cli
|
|
338
|
-
--
|
|
281
|
+
link-cli spend-request create \
|
|
282
|
+
--payment-method-id csmrpd_xxx \
|
|
283
|
+
--execution-method link_pay_token \
|
|
284
|
+
--merchant-account-id acct_... \
|
|
285
|
+
--context "Purchasing an item from the checkout the agent inspected. The user initiated this purchase through the shopping assistant." \
|
|
286
|
+
--amount 3500 \
|
|
287
|
+
--request-approval
|
|
339
288
|
```
|
|
340
289
|
|
|
290
|
+
LPT requests use the default `card` credential type and do not support
|
|
291
|
+
`--test`, `--network-id`, or `shared_payment_token`. After approval, retrieve
|
|
292
|
+
`--include link_pay_token` immediately before using it on the same checkout
|
|
293
|
+
surface. Each returned LPT is valid for up to 30 minutes, or until the
|
|
294
|
+
SpendRequest expires. If either DOM marker is absent, create a regular virtual
|
|
295
|
+
card SpendRequest instead; do not create an LPT request.
|
|
296
|
+
|
|
297
|
+
|
|
298
|
+
### Limits
|
|
299
|
+
|
|
300
|
+
| Limit | Value |
|
|
301
|
+
|-------|-------|
|
|
302
|
+
| Max amount per spend request | $500 (50,000 cents) |
|
|
303
|
+
| Approval window | 10 minutes — user must approve within 10 min of `request-approval` |
|
|
304
|
+
| Card / SPT validity | 12 hours from spend request creation |
|
|
305
|
+
| Daily spend | $500 |
|
|
306
|
+
| Monthly spend (30 days) | $20,000 |
|
|
307
|
+
| Concurrent active requests (created + approved) | 30 |
|
|
308
|
+
| Concurrent approved requests | 10 |
|
|
309
|
+
| Hourly creation rate | 50 per hour |
|
|
310
|
+
| Rolling creation rate | 200 per 60 days |
|
|
311
|
+
|
|
312
|
+
|
|
313
|
+
|
|
341
314
|
### Report outcomes
|
|
342
315
|
|
|
343
316
|
Use `report` to record the outcome of a purchase attempt. Reporting is optional, but calling it after attempts — success or failure — helps Stripe improve checkout for agents.
|
|
@@ -357,6 +330,58 @@ link-cli report --domain shop.example.com --outcome abandoned --spend-request-id
|
|
|
357
330
|
|
|
358
331
|
Outcomes: `success`, `blocked`, `abandoned`. Tags: `stripe_checkout`, `captcha`, `anti_bot_script`, `cdn_block`, `waf_block`, `dns_block`, `rate_limited`, `login_required`, `3ds_challenge`, `page_inaccessible`, `timeout`, `site_error`, `payment_declined`, `other`.
|
|
359
332
|
|
|
333
|
+
|
|
334
|
+
|
|
335
|
+
### Handle step-ups
|
|
336
|
+
|
|
337
|
+
If the created spend request comes back with `status: "requires_action"`, no approval is needed yet — the payment method or account needs attention first. Check `status_details.requires_action.next_action` for `type`, `display_message`, `action_url`, and `resolution`.
|
|
338
|
+
|
|
339
|
+
For 3D Secure (`resolution: "auto_resume"`), keep polling `spend-request retrieve` — the request resolves on its own once the challenge is completed. For any other resolution, complete the indicated action and create a new spend request.
|
|
340
|
+
|
|
341
|
+
### Line items and totals
|
|
342
|
+
|
|
343
|
+
Optionally pass additional data on the specific items being purchased, and any tax, shipping or other amounts.
|
|
344
|
+
|
|
345
|
+
`--line-item` and `--total` use repeatable `key:value` format.
|
|
346
|
+
|
|
347
|
+
**`--line-item` keys:** `name` (required), `quantity`, `unit_amount`, `description`, `sku`, `url`, `image_url`, `product_url`
|
|
348
|
+
|
|
349
|
+
```bash
|
|
350
|
+
--line-item "name:Running Shoes,unit_amount:12000,quantity:1,description:Trail runners"
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
**`--total` keys:** `type` (required; one of: `subtotal`, `tax`, `total`, `items_base_amount`, `items_discount`, `discount`, `fulfillment`, `shipping`, `fee`, `gift_wrap`, `tip`, `store_credit`), `display_text` (required), `amount` (required)
|
|
354
|
+
|
|
355
|
+
```bash
|
|
356
|
+
--total "type:subtotal,display_text:Subtotal,amount:12000" \
|
|
357
|
+
--total "type:total,display_text:Total,amount:12000"
|
|
358
|
+
```
|
|
359
|
+
|
|
360
|
+
### Approval details
|
|
361
|
+
|
|
362
|
+
For delegated/pre-approved flows, pass `--approval-detail` with a JSON object describing how the user approved the request. Required fields: `approved_at` (unix timestamp), `approval_method` (`click`, `programmatic`, or `voice`), `app_name`, `external_user_id`. Optional: `ip_address`, `user_agent`, `device_type` (`mobile` or `web`), `agent_log_id`, `external_user_name`, `external_session_id`, `authentication_method` (`biometric_face`, `biometric_fingerprint`, or `passkey`).
|
|
363
|
+
|
|
364
|
+
In CLI mode, pass as a JSON string:
|
|
365
|
+
|
|
366
|
+
```bash
|
|
367
|
+
link-cli spend-request create ... \
|
|
368
|
+
--approval-detail '{"approved_at":1720000000,"approval_method":"click","app_name":"MyApp","external_user_id":"usr_123"}'
|
|
369
|
+
```
|
|
370
|
+
|
|
371
|
+
In MCP/agent mode, pass as a structured object.
|
|
372
|
+
|
|
373
|
+
### Metadata
|
|
374
|
+
|
|
375
|
+
Attach arbitrary string data to a spend request with the repeatable `--metadata` flag (`key:value` format). Max 50 keys, key ≤ 40 chars, value ≤ 500 chars.
|
|
376
|
+
|
|
377
|
+
```bash
|
|
378
|
+
link-cli spend-request create ... \
|
|
379
|
+
--metadata "order_id:ord_123" \
|
|
380
|
+
--metadata "team:growth"
|
|
381
|
+
```
|
|
382
|
+
|
|
383
|
+
In MCP/agent mode, pass `metadata` as a structured `{ key: value }` object.
|
|
384
|
+
|
|
360
385
|
### Environment variables
|
|
361
386
|
|
|
362
387
|
| Variable | Effect |
|
|
@@ -369,7 +394,12 @@ Outcomes: `success`, `blocked`, `abandoned`. Tags: `stripe_checkout`, `captcha`,
|
|
|
369
394
|
| `LINK_AUTH_BASE_URL` | Override the auth base URL |
|
|
370
395
|
| `LINK_HTTP_PROXY` | Route all requests through an HTTP proxy (requires `undici`) |
|
|
371
396
|
|
|
372
|
-
##
|
|
397
|
+
## Integrating into agents
|
|
398
|
+
|
|
399
|
+
If you are building an agent and want to offer Link as a native experience to your consumers (as a connector, plugin, pre-installed capability etc.),
|
|
400
|
+
please reach out to `danhill at stripe.com`. We can support higher limits, more embedded approval flows, and additional advanced capabilities.
|
|
401
|
+
|
|
402
|
+
## Onboarding and Demos
|
|
373
403
|
|
|
374
404
|
Run the guided setup flow — authenticates, checks payment methods, shows the app download QR, and runs both demo flows:
|
|
375
405
|
|
|
@@ -377,8 +407,6 @@ Run the guided setup flow — authenticates, checks payment methods, shows the a
|
|
|
377
407
|
link-cli onboard
|
|
378
408
|
```
|
|
379
409
|
|
|
380
|
-
## Demo
|
|
381
|
-
|
|
382
410
|
Run an interactive demo of both Link payment flows (always uses test mode — no real charges):
|
|
383
411
|
|
|
384
412
|
```bash
|
|
@@ -416,35 +444,38 @@ pnpm biome check .
|
|
|
416
444
|
|
|
417
445
|
## Releasing
|
|
418
446
|
|
|
419
|
-
This project uses [Changesets](https://github.com/changesets/changesets) to
|
|
447
|
+
This project uses [Changesets](https://github.com/changesets/changesets) to
|
|
448
|
+
version and publish `@stripe/link-cli` and `@stripe/link-sdk`.
|
|
449
|
+
`@stripe/link-typescript-config` is private and is not published.
|
|
420
450
|
|
|
421
451
|
### Add a changeset
|
|
422
452
|
|
|
423
|
-
|
|
453
|
+
Add a changeset for any user-facing change before merging:
|
|
424
454
|
|
|
425
455
|
```bash
|
|
426
456
|
pnpm changeset
|
|
427
457
|
```
|
|
428
458
|
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
### Version
|
|
459
|
+
Select each affected public package and its semver bump. Commit the generated
|
|
460
|
+
file in `.changeset/` with the change.
|
|
432
461
|
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
```bash
|
|
436
|
-
pnpm changeset version
|
|
437
|
-
```
|
|
462
|
+
### Publish
|
|
438
463
|
|
|
439
|
-
|
|
464
|
+
After changesets reach `main`, the release workflow creates or updates the
|
|
465
|
+
**Version Packages** pull request. Review and merge that PR to publish the
|
|
466
|
+
new package versions to npm. The workflow uses npm trusted publishing and
|
|
467
|
+
generates provenance attestations for the SDK; no npm token or local publish
|
|
468
|
+
command is needed.
|
|
440
469
|
|
|
441
|
-
|
|
470
|
+
CLI releases also upload the bundled JavaScript, standalone executables, and
|
|
471
|
+
checksums to the corresponding GitHub Release. SDK-only releases skip that CLI
|
|
472
|
+
artifact work.
|
|
442
473
|
|
|
443
|
-
|
|
474
|
+
To inspect the packages without publishing them:
|
|
444
475
|
|
|
445
476
|
```bash
|
|
446
|
-
pnpm run build
|
|
447
|
-
pnpm
|
|
477
|
+
pnpm turbo run build
|
|
478
|
+
pnpm --filter @stripe/link-cli --filter @stripe/link-sdk publish --dry-run --no-git-checks
|
|
448
479
|
```
|
|
449
480
|
|
|
450
|
-
|
|
481
|
+
CI runs the same publish dry-run for every pull request.
|
package/dist/cli.js
CHANGED
|
@@ -2798,6 +2798,9 @@ function buildHeaders(data, headers) {
|
|
|
2798
2798
|
const value = line.slice(idx + 1).trim();
|
|
2799
2799
|
if (key) result[key] = value;
|
|
2800
2800
|
}
|
|
2801
|
+
if (!Object.keys(result).some((key) => key.toLowerCase() === "user-agent")) {
|
|
2802
|
+
result["User-Agent"] = `link-cli/${"0.14.1"}`;
|
|
2803
|
+
}
|
|
2801
2804
|
return result;
|
|
2802
2805
|
}
|
|
2803
2806
|
async function readPayResult(response) {
|
|
@@ -7577,7 +7580,7 @@ function cacheUpdateInfo(value, ttlMs = UPDATE_CACHE_TTL_MS) {
|
|
|
7577
7580
|
}
|
|
7578
7581
|
|
|
7579
7582
|
// src/cli.tsx
|
|
7580
|
-
var cliVersion = "0.14.
|
|
7583
|
+
var cliVersion = "0.14.1";
|
|
7581
7584
|
var cliName = "@stripe/link-cli";
|
|
7582
7585
|
var defaultHeaders = {
|
|
7583
7586
|
"User-Agent": `link-cli/${cliVersion}`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stripe/link-cli",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"link-cli": "./dist/cli.js"
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"tsx": "^4.23.5",
|
|
46
46
|
"typescript": "^5.9.3",
|
|
47
47
|
"vitest": "^4.1.10",
|
|
48
|
-
"@stripe/link-sdk": "
|
|
48
|
+
"@stripe/link-sdk": "0.2.0",
|
|
49
49
|
"@stripe/link-typescript-config": "0.0.0"
|
|
50
50
|
},
|
|
51
51
|
"scripts": {
|