@fastxyz/cli 1.0.1 → 1.0.3

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Fast.xyz
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -7,7 +7,13 @@ A command-line tool for the [Fast network](https://fast.xyz) — manage accounts
7
7
  **Requires Node.js 18+**
8
8
 
9
9
  ```bash
10
- npm install -g @fastxyz/cli
10
+ pnpm install -g @fastxyz/cli
11
+ ```
12
+
13
+ Or use via pnpm in the repo:
14
+
15
+ ```bash
16
+ pnpm cli --help
11
17
  ```
12
18
 
13
19
  Verify:
@@ -38,20 +44,374 @@ fast pay https://api.example.com/resource
38
44
 
39
45
  ## Environment
40
46
 
41
- | Variable | Description |
42
- |---|---|
47
+ | Variable | Description |
48
+ | --------------- | ---------------------------------------------------- |
43
49
  | `FAST_PASSWORD` | Keystore password (preferred over `--password` flag) |
44
50
 
45
51
  ## AI Agent Skill
46
52
 
47
- Install the Copilot CLI skill to let AI agents operate the `fast` CLI on your behalf:
53
+ Install the skill to let AI agents operate the `fast` CLI on your behalf:
48
54
 
49
55
  ```bash
50
56
  npx skills add https://github.com/fastxyz/fast-sdk/tree/main/skills
51
57
  ```
52
58
 
53
- The skill teaches the agent how to bootstrap, install, and use every `fast` command — including bridging flows, x402 payments, and JSON-mode scripting.
54
-
55
59
  ## Documentation
56
60
 
57
61
  Full command reference and workflows: [`skills/fast/SKILL.md`](https://github.com/fastxyz/fast-sdk/tree/main/skills/fast/SKILL.md)
62
+
63
+ ## Global Options
64
+
65
+ These options work with every command:
66
+
67
+ | Option | Description |
68
+ |--------|-------------|
69
+ | `--json` | Emit machine-readable JSON output instead of human-readable text |
70
+ | `--network <name>` | Override the active network (`mainnet`, `testnet`) for this command |
71
+ | `--account <name>` | Use a specific named account instead of the default |
72
+ | `--password <pwd>` | Provide the keystore password (defaults to `FAST_PASSWORD` env var, then interactive prompt) |
73
+ | `--non-interactive` | Auto-confirm confirmations and fail when required input is missing |
74
+ | `--debug` | Enable verbose debug logging to stderr |
75
+
76
+ ## Commands
77
+
78
+ ### `fast account create`
79
+
80
+ Create a new Ed25519 account and store it in the local keystore.
81
+
82
+ ```bash
83
+ fast account create --name my-account
84
+ ```
85
+
86
+ **Options:** `--name <alias>` — Optional human-readable alias for the account.
87
+
88
+ Prompts for an optional keystore password if `--password` is not given and `FAST_PASSWORD` is unset.
89
+
90
+ ---
91
+
92
+ ### `fast account import`
93
+
94
+ Import an existing account from a 32-byte hex private key.
95
+
96
+ ```bash
97
+ fast account import --name my-imported-account --private-key 0x...
98
+ ```
99
+
100
+ **Options:**
101
+ - `--name <alias>` — Optional human-readable alias for the imported account
102
+ - `--private-key <hex>` — Hex-encoded 32-byte private key
103
+ - `--key-file <path>` — Path to a JSON file containing a `privateKey` field
104
+
105
+ If `--name` is omitted, the CLI auto-generates one. You must provide exactly one of `--private-key` or `--key-file`.
106
+
107
+ ---
108
+
109
+ ### `fast account list`
110
+
111
+ List all stored accounts with their addresses and default status.
112
+
113
+ ```bash
114
+ fast account list
115
+ ```
116
+
117
+ ---
118
+
119
+ ### `fast account export`
120
+
121
+ Export an account's private key (requires password).
122
+
123
+ ```bash
124
+ fast account export my-account
125
+ ```
126
+
127
+ If no account name is provided, the CLI exports the current default account.
128
+
129
+ ---
130
+
131
+ ### `fast account set-default`
132
+
133
+ Set the default account for commands that need a signer.
134
+
135
+ ```bash
136
+ fast account set-default my-account
137
+ ```
138
+
139
+ ---
140
+
141
+ ### `fast account delete`
142
+
143
+ Delete an account from the local keystore.
144
+
145
+ ```bash
146
+ fast account delete my-account
147
+ ```
148
+
149
+ ---
150
+
151
+ ### `fast send <address> <amount>`
152
+
153
+ Send tokens between Fast and supported EVM chains.
154
+
155
+ ```bash
156
+ fast send fast1recipient... 10.5 --token USDC
157
+ ```
158
+
159
+ **Positional arguments:**
160
+ - `<address>` — Recipient address (`fast1...` for Fast, `0x...` for EVM)
161
+ - `<amount>` — Human-readable amount (for example, `10` or `1.5`)
162
+
163
+ **Options:**
164
+ - `--from-chain <chain>` — Source EVM chain for EVM → Fast transfers
165
+ - `--to-chain <chain>` — Destination EVM chain for Fast → EVM transfers
166
+ - `--token <token>` — Token symbol or token ID (defaults to the first configured bridge token, typically `USDC`)
167
+ - `--eip-7702` — Use the smart deposit flow for EVM → Fast transfers
168
+ - `--account <name>` — Sender account (defaults to the configured default)
169
+
170
+ ---
171
+
172
+ ### `fast info balance`
173
+
174
+ Check balances for the current account or a named account.
175
+
176
+ ```bash
177
+ # By account name
178
+ fast info balance --account my-account
179
+
180
+ # For a specific token
181
+ fast info balance --token USDC
182
+ ```
183
+
184
+ ---
185
+
186
+ ### `fast info status`
187
+
188
+ Check the current network configuration and whether the Fast RPC is reachable.
189
+
190
+ ```bash
191
+ fast info status
192
+ ```
193
+
194
+ ---
195
+
196
+ ### `fast info tx <hash>`
197
+
198
+ Look up a transaction by hash in the local CLI history store.
199
+
200
+ ```bash
201
+ fast info tx 0xabc123...
202
+ ```
203
+
204
+ ---
205
+
206
+ ### `fast info history`
207
+
208
+ Show recent locally recorded transaction history.
209
+
210
+ ```bash
211
+ fast info history --from fast1... --limit 20
212
+ ```
213
+
214
+ **Options:**
215
+ - `--from <address>` — Filter by sender address
216
+ - `--to <address>` — Filter by recipient address
217
+ - `--token <token>` — Filter by token name or token ID
218
+ - `--limit <n>` — Max number of records to return
219
+ - `--offset <n>` — Number of records to skip
220
+
221
+ ---
222
+
223
+ ### `fast info bridge-chains`
224
+
225
+ List EVM chains available for Fast-EVM transfers.
226
+
227
+ ```bash
228
+ fast info bridge-chains
229
+ ```
230
+
231
+ ---
232
+
233
+ ### `fast info bridge-tokens`
234
+
235
+ List tokens available for Fast-EVM transfers and the chains they are configured on.
236
+
237
+ ```bash
238
+ fast info bridge-tokens
239
+ ```
240
+
241
+ ---
242
+
243
+ ### `fast fund fiat`
244
+
245
+ Get a fiat on-ramp URL for funding a Fast address.
246
+
247
+ ```bash
248
+ fast fund fiat --network mainnet
249
+ ```
250
+
251
+ **Requirements:**
252
+ - Only available on `mainnet`
253
+ - Prints a funding URL for you to open in your browser
254
+
255
+ **Options:**
256
+ - `--address <fast-address>` — Fund a specific Fast address directly (otherwise uses the selected account)
257
+ - `--network <name>` — Must be `mainnet`
258
+
259
+ ---
260
+
261
+ ### `fast fund crypto <amount>`
262
+
263
+ Bridge crypto from an EVM chain to the Fast network.
264
+
265
+ ```bash
266
+ fast fund crypto 10.5 --chain arbitrum-sepolia --token USDC
267
+ ```
268
+
269
+ **Positional arguments:**
270
+ - `<amount>` — Human-readable amount
271
+
272
+ **Options:**
273
+ - `--chain <chain>` — Source EVM chain (required)
274
+ - `--token <token>` — Token symbol or token ID (defaults to `USDC` / `testUSDC`)
275
+ - `--eip-7702` — Use the smart deposit flow when supported
276
+
277
+ ---
278
+
279
+ ### `fast pay <url>`
280
+
281
+ Pay for an x402-protected HTTP resource. The CLI handles the 402 response, signs and submits payment, and retries the request automatically.
282
+
283
+ ```bash
284
+ fast pay https://api.example.com/premium
285
+ ```
286
+
287
+ **Positional arguments:**
288
+ - `<url>` — URL of the x402-protected resource (required)
289
+
290
+ **Options:**
291
+ - `--dry-run` — Show payment details without actually paying
292
+ - `--method <GET|POST|...>` — HTTP method (default: GET)
293
+ - `--header <key:value>` — Custom request header (can be repeated)
294
+ - `--body <data>` — Request body (use `@filepath` to read from a file)
295
+ - `--network <name>` — Network to use for payment
296
+
297
+ **Example with headers and body:**
298
+
299
+ ```bash
300
+ fast pay https://api.example.com/analyze \
301
+ --method POST \
302
+ --header "Content-Type: application/json" \
303
+ --body '{"text": "hello world"}'
304
+ ```
305
+
306
+ ---
307
+
308
+ ### `fast network list`
309
+
310
+ List all configured networks and show which one is the current default.
311
+
312
+ ```bash
313
+ fast network list
314
+ ```
315
+
316
+ ---
317
+
318
+ ### `fast network add <name>`
319
+
320
+ Add a custom network configuration by name.
321
+
322
+ ```bash
323
+ fast network add my-custom-net --config ./network-config.json
324
+ ```
325
+
326
+ **Positional arguments:**
327
+ - `<name>` — Unique name for the network
328
+
329
+ **Options:**
330
+ - `--config <path>` — Path to a JSON file with the network configuration (required)
331
+
332
+ **Example JSON config (`network-config.json`):**
333
+ ```json
334
+ {
335
+ "url": "https://api.fast.xyz/proxy-rest",
336
+ "networkId": "fast:testnet",
337
+ "chainType": "fast"
338
+ }
339
+ ```
340
+
341
+ ---
342
+
343
+ ### `fast network set-default`
344
+
345
+ Set the default network for all subsequent commands.
346
+
347
+ ```bash
348
+ fast network set-default testnet
349
+ ```
350
+
351
+ ---
352
+
353
+ ### `fast network remove`
354
+
355
+ Remove a previously added network configuration.
356
+
357
+ ```bash
358
+ fast network remove my-custom-net
359
+ ```
360
+
361
+ ---
362
+
363
+ ## Configuration Files
364
+
365
+ The CLI stores data in `~/.fast/`:
366
+
367
+ ```
368
+ ~/.fast/
369
+ fast.db # SQLite database (accounts, networks, history, encrypted keys)
370
+ ```
371
+
372
+ ## Environment Variables
373
+
374
+ | Variable | Description |
375
+ |----------|-------------|
376
+ | `FAST_PASSWORD` | Default keystore password (avoids interactive prompt) |
377
+
378
+ ## Examples
379
+
380
+ ### Full workflow: fund, check balance, and send
381
+
382
+ ```bash
383
+ # 1. Create an account
384
+ fast account create --name my-account
385
+
386
+ # 2. Get a fiat on-ramp URL
387
+ fast fund fiat --network mainnet --address fast1...
388
+
389
+ # 3. Check your balance
390
+ fast info balance --account my-account
391
+
392
+ # 4. Send tokens to someone
393
+ fast send fast1recipient... 1.25 --account my-account --token USDC
394
+ ```
395
+
396
+ ### Pay for an x402-protected API
397
+
398
+ ```bash
399
+ # Simple GET request
400
+ fast pay https://api.example.com/premium
401
+
402
+ # POST with JSON body
403
+ fast pay https://api.example.com/analyze \
404
+ --method POST \
405
+ --header "Authorization: Bearer $API_KEY" \
406
+ --body '{"query": "summarize this text"}'
407
+
408
+ # Dry run to see payment details first
409
+ fast pay https://api.example.com/premium --dry-run
410
+ ```
411
+
412
+ ## See Also
413
+
414
+ - Root [README](../README.md) for monorepo overview
415
+ - [@fastxyz/sdk](../packages/fast-sdk/README.md) for SDK documentation — the CLI uses this internally for signing and REST API calls
416
+ - [@fastxyz/allset-sdk](../packages/allset-sdk/README.md) for bridging details
417
+ - [Fast Documentation](https://docs.fast.xyz) for protocol-level details
File without changes
@@ -7,7 +7,7 @@ import {
7
7
  getBundledNetworks,
8
8
  getVersion,
9
9
  isBundledNetwork
10
- } from "./chunk-MIRQRJSD.js";
10
+ } from "./chunk-UZZ2O26Y.js";
11
11
  import "./chunk-77HVPD4G.js";
12
12
  export {
13
13
  AppConfig,
File without changes
File without changes
File without changes