@stripe/link-cli 0.1.2 → 0.2.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 +27 -26
- package/dist/cli.js +1080 -1528
- package/package.json +4 -2
package/README.md
CHANGED
|
@@ -65,7 +65,7 @@ By default, a spend request provisions a virtual card. For merchants that suppor
|
|
|
65
65
|
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.
|
|
66
66
|
|
|
67
67
|
```bash
|
|
68
|
-
link-cli spend-request retrieve lsrq_001 --
|
|
68
|
+
link-cli spend-request retrieve lsrq_001 --format json
|
|
69
69
|
```
|
|
70
70
|
By default, retrieving a spend request will not include card details. Use the `--include=card` to see unmasked card details.
|
|
71
71
|
|
|
@@ -76,7 +76,7 @@ link-cli mpp pay https://climate.stripe.dev/api/contribute \
|
|
|
76
76
|
--spend-request-id lsrq_001 \
|
|
77
77
|
--method POST \
|
|
78
78
|
--data '{"amount":100}' \
|
|
79
|
-
--
|
|
79
|
+
--format json
|
|
80
80
|
```
|
|
81
81
|
|
|
82
82
|
## Advanced
|
|
@@ -84,13 +84,28 @@ link-cli mpp pay https://climate.stripe.dev/api/contribute \
|
|
|
84
84
|
### Authentication
|
|
85
85
|
|
|
86
86
|
```bash
|
|
87
|
-
link-cli auth login --client-name "Claude Code" --
|
|
88
|
-
link-cli auth status --
|
|
89
|
-
link-cli auth logout --
|
|
87
|
+
link-cli auth login --client-name "Claude Code" --format json # identify the connecting agent
|
|
88
|
+
link-cli auth status --format json # check auth status
|
|
89
|
+
link-cli auth logout --format json # disconnect
|
|
90
90
|
```
|
|
91
91
|
|
|
92
92
|
When `--client-name` is provided, the name is shown in the Link app when the user approves the connection — e.g. `Claude Code on my-macbook` instead of `link-cli on my-macbook`.
|
|
93
93
|
|
|
94
|
+
`auth status --format json` includes an `update` field when a newer version is available:
|
|
95
|
+
|
|
96
|
+
```json
|
|
97
|
+
{
|
|
98
|
+
"authenticated": true,
|
|
99
|
+
"update": {
|
|
100
|
+
"current_version": "0.1.2",
|
|
101
|
+
"latest_version": "0.2.0",
|
|
102
|
+
"update_command": "npm install -g @stripe/link-cli"
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
Set `NO_UPDATE_NOTIFIER=1` to suppress update checks (e.g. in CI).
|
|
108
|
+
|
|
94
109
|
### Spend request lifecycle
|
|
95
110
|
|
|
96
111
|
A spend request moves through: **create** → **request approval** → **approved** (with credentials).
|
|
@@ -104,32 +119,18 @@ A spend request moves through: **create** → **request approval** → **approve
|
|
|
104
119
|
# Update before approval
|
|
105
120
|
link-cli spend-request update lsrq_001 \
|
|
106
121
|
--merchant-url https://press.stripe.com/working-in-public \
|
|
107
|
-
--
|
|
122
|
+
--format json
|
|
108
123
|
|
|
109
124
|
# Request approval separately (alternative to create --request-approval)
|
|
110
|
-
link-cli spend-request request-approval lsrq_001 --
|
|
125
|
+
link-cli spend-request request-approval lsrq_001 --format json
|
|
111
126
|
|
|
112
127
|
# Retrieve at any time (includes card credentials once approved)
|
|
113
|
-
link-cli spend-request retrieve lsrq_001 --
|
|
128
|
+
link-cli spend-request retrieve lsrq_001 --format json
|
|
114
129
|
```
|
|
115
130
|
|
|
116
|
-
###
|
|
117
|
-
|
|
118
|
-
All commands accept `--json` for structured input (mutually exclusive with flags):
|
|
119
|
-
|
|
120
|
-
```bash
|
|
121
|
-
link-cli spend-request create --json '{
|
|
122
|
-
"payment_method_id": "csmrpd_xxx",
|
|
123
|
-
"merchant_name": "Stripe Press",
|
|
124
|
-
"merchant_url": "https://press.stripe.com/working-in-public",
|
|
125
|
-
"context": "Purchasing '\''Working in Public'\'' from press.stripe.com. The user initiated this purchase through the shopping assistant.",
|
|
126
|
-
"amount": 3500,
|
|
127
|
-
"line_items": [{ "name": "Working in Public", "unit_amount": 3500, "quantity": 1 }],
|
|
128
|
-
"totals": [{ "type": "total", "display_text": "Total", "amount": 3500 }]
|
|
129
|
-
}' --output-json
|
|
130
|
-
```
|
|
131
|
+
### Output formats
|
|
131
132
|
|
|
132
|
-
All commands
|
|
133
|
+
All commands accept `--format json` for structured JSON output. Other formats: `yaml`, `md`, `jsonl`, `toon` (default). Errors are returned as JSON with `code` and `message` fields, with exit code 1.
|
|
133
134
|
|
|
134
135
|
### MPP
|
|
135
136
|
|
|
@@ -141,7 +142,7 @@ link-cli mpp pay https://climate.stripe.dev/api/contribute \
|
|
|
141
142
|
--method POST \
|
|
142
143
|
--data '{"amount":100}' \
|
|
143
144
|
--header "X-Custom: value" \
|
|
144
|
-
--
|
|
145
|
+
--format json
|
|
145
146
|
```
|
|
146
147
|
|
|
147
148
|
Use `mpp decode` to validate a raw `WWW-Authenticate` header and extract the `network_id` needed for `shared_payment_token` spend requests:
|
|
@@ -149,7 +150,7 @@ Use `mpp decode` to validate a raw `WWW-Authenticate` header and extract the `ne
|
|
|
149
150
|
```bash
|
|
150
151
|
link-cli mpp decode \
|
|
151
152
|
--challenge 'Payment id="ch_001", realm="merchant.example", method="stripe", intent="charge", request="..."' \
|
|
152
|
-
--
|
|
153
|
+
--format json
|
|
153
154
|
```
|
|
154
155
|
|
|
155
156
|
### Environment variables
|