Skip to content

Commit 56fabb7

Browse files
authored
Add a beautiful help page for the CLI and clean up docs. (#300)
![Screenshot 2026-03-26 at 1.55.50 PM.png](https://app.graphite.com/user-attachments/assets/017c2383-67b5-4a66-9e6e-f1a3fab6480c.png)
1 parent e9198e1 commit 56fabb7

4 files changed

Lines changed: 278 additions & 59 deletions

File tree

cli/README.md

Lines changed: 52 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,15 @@ A command-line interface for the Grid API, enabling global payments across fiat,
88
cd cli
99
npm install
1010
npm run build
11+
npm link # makes `grid` available globally
1112
```
1213

1314
## Quick Start
1415

1516
Configure your credentials interactively:
1617

1718
```bash
18-
node cli/dist/index.js configure
19+
grid configure
1920
```
2021

2122
This will prompt for your API Token ID and Client Secret, validate them, and save to `~/.grid-credentials`.
@@ -29,10 +30,8 @@ export GRID_API_CLIENT_SECRET="your-client-secret"
2930

3031
## Usage
3132

32-
Run commands from the repository root:
33-
3433
```bash
35-
node cli/dist/index.js <command> [options]
34+
grid <command> [options]
3635
```
3736

3837
### Global Options
@@ -64,36 +63,36 @@ Example: `grid tx list` is equivalent to `grid transactions list`
6463

6564
```bash
6665
# Interactive configuration
67-
node cli/dist/index.js configure
66+
grid configure
6867

6968
# Non-interactive configuration
70-
node cli/dist/index.js configure --token-id <id> --client-secret <secret>
69+
grid configure --token-id <id> --client-secret <secret>
7170

7271
# Skip credential verification
73-
node cli/dist/index.js configure --no-verify
72+
grid configure --no-verify
7473
```
7574

7675
### Platform Configuration
7776

7877
```bash
7978
# Get platform config (currencies, limits, webhook)
80-
node cli/dist/index.js config get
79+
grid config get
8180

8281
# Update webhook endpoint
83-
node cli/dist/index.js config update --webhook-endpoint https://example.com/webhooks
82+
grid config update --webhook-endpoint https://example.com/webhooks
8483
```
8584

8685
### Customers
8786

8887
```bash
8988
# List customers
90-
node cli/dist/index.js customers list [--limit 20] [--type INDIVIDUAL|BUSINESS]
89+
grid customers list [--limit 20] [--type INDIVIDUAL|BUSINESS]
9190

9291
# Get customer details
93-
node cli/dist/index.js customers get <customerId>
92+
grid customers get <customerId>
9493

9594
# Create individual customer
96-
node cli/dist/index.js customers create \
95+
grid customers create \
9796
--platform-id "your-id" \
9897
--type INDIVIDUAL \
9998
--full-name "John Doe" \
@@ -105,25 +104,25 @@ node cli/dist/index.js customers create \
105104
--address-country "US"
106105

107106
# Create business customer
108-
node cli/dist/index.js customers create \
107+
grid customers create \
109108
--platform-id "biz-123" \
110109
--type BUSINESS \
111110
--legal-name "Acme Inc" \
112111
--tax-id "12-3456789"
113112

114113
# Generate KYC link
115-
node cli/dist/index.js customers kyc-link \
114+
grid customers kyc-link \
116115
--customer-id <id> \
117116
--redirect-url https://example.com/kyc-complete
118117

119118
# Update customer
120-
node cli/dist/index.js customers update <customerId> --full-name "Jane Doe"
119+
grid customers update <customerId> --full-name "Jane Doe"
121120

122121
# Delete customer (prompts for confirmation)
123-
node cli/dist/index.js customers delete <customerId>
122+
grid customers delete <customerId>
124123

125124
# Delete customer without confirmation
126-
node cli/dist/index.js customers delete <customerId> --yes
125+
grid customers delete <customerId> --yes
127126
```
128127

129128
### Accounts
@@ -132,20 +131,20 @@ node cli/dist/index.js customers delete <customerId> --yes
132131

133132
```bash
134133
# List customer internal accounts
135-
node cli/dist/index.js accounts internal list [--customer-id <id>] [--currency USD]
134+
grid accounts internal list [--customer-id <id>] [--currency USD]
136135

137136
# List platform internal accounts
138-
node cli/dist/index.js accounts internal list --platform
137+
grid accounts internal list --platform
139138
```
140139

141140
#### External Accounts (Bank accounts, wallets)
142141

143142
```bash
144143
# List external accounts
145-
node cli/dist/index.js accounts external list [--customer-id <id>]
144+
grid accounts external list [--customer-id <id>]
146145

147146
# Create US bank account
148-
node cli/dist/index.js accounts external create \
147+
grid accounts external create \
149148
--customer-id <id> \
150149
--currency USD \
151150
--account-type US_ACCOUNT \
@@ -156,7 +155,7 @@ node cli/dist/index.js accounts external create \
156155
--beneficiary-name "John Doe"
157156

158157
# Create Mexico CLABE account
159-
node cli/dist/index.js accounts external create \
158+
grid accounts external create \
160159
--customer-id <id> \
161160
--currency MXN \
162161
--account-type CLABE \
@@ -167,7 +166,7 @@ node cli/dist/index.js accounts external create \
167166
--beneficiary-nationality MX
168167

169168
# Create India UPI account
170-
node cli/dist/index.js accounts external create \
169+
grid accounts external create \
171170
--customer-id <id> \
172171
--currency INR \
173172
--account-type UPI \
@@ -178,7 +177,7 @@ node cli/dist/index.js accounts external create \
178177
--beneficiary-nationality IN
179178

180179
# Create Brazil PIX account
181-
node cli/dist/index.js accounts external create \
180+
grid accounts external create \
182181
--customer-id <id> \
183182
--currency BRL \
184183
--account-type PIX \
@@ -189,7 +188,7 @@ node cli/dist/index.js accounts external create \
189188
--beneficiary-nationality BR
190189

191190
# Create Nigeria account
192-
node cli/dist/index.js accounts external create \
191+
grid accounts external create \
193192
--customer-id <id> \
194193
--currency NGN \
195194
--account-type NGN_ACCOUNT \
@@ -202,7 +201,7 @@ node cli/dist/index.js accounts external create \
202201
--beneficiary-nationality NG
203202

204203
# Create Europe IBAN account
205-
node cli/dist/index.js accounts external create \
204+
grid accounts external create \
206205
--customer-id <id> \
207206
--currency EUR \
208207
--account-type IBAN \
@@ -211,7 +210,7 @@ node cli/dist/index.js accounts external create \
211210
--beneficiary-name "Hans Mueller"
212211

213212
# Create crypto wallet (Solana USDC)
214-
node cli/dist/index.js accounts external create \
213+
grid accounts external create \
215214
--customer-id <id> \
216215
--currency USDC \
217216
--account-type SOLANA_WALLET \
@@ -222,20 +221,20 @@ node cli/dist/index.js accounts external create \
222221

223222
```bash
224223
# List quotes
225-
node cli/dist/index.js quotes list [--status PENDING] [--customer-id <id>]
224+
grid quotes list [--status PENDING] [--customer-id <id>]
226225

227226
# Get quote details
228-
node cli/dist/index.js quotes get <quoteId>
227+
grid quotes get <quoteId>
229228

230229
# Create quote from internal account (prefunded)
231-
node cli/dist/index.js quotes create \
230+
grid quotes create \
232231
--source-account <internalAccountId> \
233232
--dest-uma '$user@domain.com' \
234233
--amount 10000 \
235234
--lock-side SENDING
236235

237236
# Create quote with JIT funding (real-time)
238-
node cli/dist/index.js quotes create \
237+
grid quotes create \
239238
--source-customer <customerId> \
240239
--source-currency USDC \
241240
--dest-account <externalAccountId> \
@@ -244,20 +243,20 @@ node cli/dist/index.js quotes create \
244243
--lock-side RECEIVING
245244

246245
# Execute a pending quote
247-
node cli/dist/index.js quotes execute <quoteId>
246+
grid quotes execute <quoteId>
248247
```
249248

250249
### Same-Currency Transfers
251250

252251
```bash
253252
# Transfer in (external → internal)
254-
node cli/dist/index.js transfers in \
253+
grid transfers in \
255254
--source <externalAccountId> \
256255
--dest <internalAccountId> \
257256
--amount 10000
258257

259258
# Transfer out (internal → external)
260-
node cli/dist/index.js transfers out \
259+
grid transfers out \
261260
--source <internalAccountId> \
262261
--dest <externalAccountId> \
263262
--amount 10000
@@ -267,44 +266,44 @@ node cli/dist/index.js transfers out \
267266

268267
```bash
269268
# List transactions
270-
node cli/dist/index.js transactions list \
269+
grid transactions list \
271270
[--customer-id <id>] \
272271
[--status PENDING|PROCESSING|COMPLETED|FAILED] \
273272
[--type INCOMING|OUTGOING] \
274273
[--start-date 2024-01-01] \
275274
[--end-date 2024-12-31]
276275

277276
# Get transaction details
278-
node cli/dist/index.js transactions get <transactionId>
277+
grid transactions get <transactionId>
279278

280279
# Approve incoming payment
281-
node cli/dist/index.js transactions approve <transactionId>
280+
grid transactions approve <transactionId>
282281

283282
# Reject incoming payment
284-
node cli/dist/index.js transactions reject <transactionId> --reason "Invalid sender"
283+
grid transactions reject <transactionId> --reason "Invalid sender"
285284
```
286285

287286
### Receiver Lookup
288287

289288
```bash
290289
# Look up UMA address
291-
node cli/dist/index.js receiver lookup-uma '$user@domain.com'
290+
grid receiver lookup-uma '$user@domain.com'
292291

293292
# Look up external account
294-
node cli/dist/index.js receiver lookup-account <accountId>
293+
grid receiver lookup-account <accountId>
295294
```
296295

297296
### Sandbox Testing
298297

299298
```bash
300299
# Fund an internal account
301-
node cli/dist/index.js sandbox fund <internalAccountId> --amount 100000
300+
grid sandbox fund <internalAccountId> --amount 100000
302301

303302
# Simulate sending funds to a JIT quote
304-
node cli/dist/index.js sandbox send --quote-id <quoteId> --currency USDC
303+
grid sandbox send --quote-id <quoteId> --currency USDC
305304

306305
# Simulate receiving an UMA payment
307-
node cli/dist/index.js sandbox receive \
306+
grid sandbox receive \
308307
--uma-address '$user@domain.com' \
309308
--amount 1000 \
310309
--currency USD
@@ -339,7 +338,7 @@ On error:
339338

340339
```bash
341340
# 1. Create external account
342-
node cli/dist/index.js accounts external create \
341+
grid accounts external create \
343342
--customer-id <customerId> \
344343
--currency MXN \
345344
--account-type CLABE \
@@ -350,7 +349,7 @@ node cli/dist/index.js accounts external create \
350349
--beneficiary-nationality MX
351350

352351
# 2. Create quote (returns payment instructions)
353-
node cli/dist/index.js quotes create \
352+
grid quotes create \
354353
--source-customer <customerId> \
355354
--source-currency USDC \
356355
--dest-account <externalAccountId> \
@@ -359,51 +358,51 @@ node cli/dist/index.js quotes create \
359358
--lock-side RECEIVING
360359

361360
# 3. In sandbox, simulate the USDC deposit
362-
node cli/dist/index.js sandbox send --quote-id <quoteId> --currency USDC
361+
grid sandbox send --quote-id <quoteId> --currency USDC
363362

364363
# 4. Check transaction status
365-
node cli/dist/index.js transactions get <transactionId>
364+
grid transactions get <transactionId>
366365
```
367366

368367
### Send to UMA Address
369368

370369
```bash
371370
# 1. Look up the receiver
372-
node cli/dist/index.js receiver lookup-uma '$alice@example.com'
371+
grid receiver lookup-uma '$alice@example.com'
373372

374373
# 2. Create and execute quote
375-
node cli/dist/index.js quotes create \
374+
grid quotes create \
376375
--source-account <internalAccountId> \
377376
--dest-uma '$alice@example.com' \
378377
--amount 5000 \
379378
--lock-side SENDING
380379

381380
# 3. Execute the quote
382-
node cli/dist/index.js quotes execute <quoteId>
381+
grid quotes execute <quoteId>
383382
```
384383

385384
## Output Formats
386385

387386
### JSON (default)
388387

389388
```bash
390-
node cli/dist/index.js customers list
389+
grid customers list
391390
```
392391

393392
Output includes syntax highlighting when running in a terminal.
394393

395394
### Table
396395

397396
```bash
398-
node cli/dist/index.js customers list --format table
397+
grid customers list --format table
399398
```
400399

401400
Displays results in a human-readable table format.
402401

403402
### Disable Colors
404403

405404
```bash
406-
node cli/dist/index.js customers list --no-color
405+
grid customers list --no-color
407406
```
408407

409408
## Notes

cli/package.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@
2323
"ts-node": "^10.9.2",
2424
"typescript": "^5.4.0"
2525
},
26-
"engines": {
27-
"node": ">=18.0.0"
28-
},
2926
"author": "Lightspark",
3027
"license": "Apache-2.0"
3128
}

0 commit comments

Comments
 (0)