polkadot-cli 1.2.0 → 1.4.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 +39 -3
- package/dist/cli.mjs +1153 -719
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -251,11 +251,17 @@ dot query System.Number
|
|
|
251
251
|
# Map entry by key
|
|
252
252
|
dot query System.Account 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY
|
|
253
253
|
|
|
254
|
-
#
|
|
255
|
-
dot query System.Account
|
|
254
|
+
# Map without key — shows help/usage (use --dump to fetch all entries)
|
|
255
|
+
dot query System.Account
|
|
256
|
+
|
|
257
|
+
# Dump all map entries (requires --dump, default limit: 100)
|
|
258
|
+
dot query System.Account --dump --limit 10
|
|
259
|
+
|
|
260
|
+
# Enum variant as map key (case-insensitive)
|
|
261
|
+
dot query people-preview.ChunksManager.Chunks R2e9 1
|
|
256
262
|
|
|
257
263
|
# Pipe-safe — stdout is clean data, progress messages go to stderr
|
|
258
|
-
dot query System.Account --limit 5 | jq '.[0].value.data.free'
|
|
264
|
+
dot query System.Account --dump --limit 5 | jq '.[0].value.data.free'
|
|
259
265
|
dot query System.Number --output json | jq '.+1'
|
|
260
266
|
|
|
261
267
|
# Query a specific chain using chain prefix
|
|
@@ -526,6 +532,7 @@ dot tx.System.remark 0xdead # shows call help (no error)
|
|
|
526
532
|
| `--rpc <url>` | Override RPC endpoint(s) for this call (repeat for fallback) |
|
|
527
533
|
| `--light-client` | Use Smoldot light client |
|
|
528
534
|
| `--output json` | Raw JSON output (default: pretty) |
|
|
535
|
+
| `--dump` | Dump all entries of a storage map (required for keyless map queries) |
|
|
529
536
|
| `--limit <n>` | Max entries for map queries (0 = unlimited, default: 100) |
|
|
530
537
|
|
|
531
538
|
### Pipe-safe output
|
|
@@ -539,6 +546,35 @@ dot query System.Number --output json | jq
|
|
|
539
546
|
|
|
540
547
|
In an interactive terminal, both streams render together so you see progress and results normally.
|
|
541
548
|
|
|
549
|
+
### Shell completions
|
|
550
|
+
|
|
551
|
+
Generate shell completion scripts for tab-completing subcommands, chain names, pallet names, and item names. Completions use cached metadata — no network calls are made.
|
|
552
|
+
|
|
553
|
+
```bash
|
|
554
|
+
# zsh — add to ~/.zshrc
|
|
555
|
+
eval "$(dot completions zsh)"
|
|
556
|
+
|
|
557
|
+
# bash — add to ~/.bashrc
|
|
558
|
+
eval "$(dot completions bash)"
|
|
559
|
+
|
|
560
|
+
# fish — save to completions directory
|
|
561
|
+
dot completions fish > ~/.config/fish/completions/dot.fish
|
|
562
|
+
```
|
|
563
|
+
|
|
564
|
+
Once installed, press Tab to complete:
|
|
565
|
+
|
|
566
|
+
```bash
|
|
567
|
+
dot qu<Tab> # → query
|
|
568
|
+
dot query.<Tab> # → query.System, query.Balances, ...
|
|
569
|
+
dot query.System.<Tab> # → query.System.Account, query.System.Number, ...
|
|
570
|
+
dot polkadot.<Tab> # → polkadot.query, polkadot.tx, ...
|
|
571
|
+
dot --chain <Tab> # → polkadot, paseo, ...
|
|
572
|
+
dot --from <Tab> # → alice, bob, ..., stored account names
|
|
573
|
+
dot chain <Tab> # → add, remove, update, list, default
|
|
574
|
+
```
|
|
575
|
+
|
|
576
|
+
Completions are context-aware: `query.` shows pallets with storage items, `tx.` shows pallets with calls, `events.` and `errors.` filter accordingly. Chain prefix paths like `polkadot.query.System.` work at any depth.
|
|
577
|
+
|
|
542
578
|
## How it compares
|
|
543
579
|
|
|
544
580
|
| | polkadot-cli | @polkadot/api-cli | subxt-cli | Pop CLI |
|