polkadot-cli 1.1.1 → 1.3.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.
Files changed (3) hide show
  1. package/README.md +63 -0
  2. package/dist/cli.mjs +1253 -741
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -79,6 +79,10 @@ dot accounts # shorthand, same as above
79
79
  # List all accounts (dev + stored)
80
80
  dot account list
81
81
 
82
+ # Add a watch-only address (no secret — for use as tx recipient or query target)
83
+ dot account add treasury 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY
84
+ dot account add council 0xd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d
85
+
82
86
  # Create a new account (generates a mnemonic)
83
87
  dot account create my-validator
84
88
 
@@ -113,6 +117,36 @@ dot account inspect alice --prefix 0 # Polkadot mainnet prefix
113
117
  dot account inspect alice --output json # JSON output
114
118
  ```
115
119
 
120
+ #### Watch-only accounts
121
+
122
+ Add named addresses without secrets — useful for saving frequently-used recipients, multisig members, or query targets:
123
+
124
+ ```bash
125
+ dot account add treasury 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY
126
+ dot account add council 0xd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d
127
+ ```
128
+
129
+ Watch-only accounts appear in `dot account list` with a `(watch-only)` badge and can be inspected and removed like any other account. They cannot be used with `--from` (signing) or as a source for `derive`.
130
+
131
+ The `add` subcommand is context-sensitive: bare `add <name> <address>` creates a watch-only entry, while `add --secret` or `add --env` imports a keyed account (same as `import`).
132
+
133
+ #### Named address resolution
134
+
135
+ Named accounts (both watch-only and keyed) resolve automatically everywhere an AccountId32 or MultiAddress is expected — in `dot tx` arguments and `dot query` keys:
136
+
137
+ ```bash
138
+ # Use a named account as transfer recipient
139
+ dot tx Balances.transferKeepAlive treasury 1000000000000 --from alice
140
+
141
+ # Query by account name
142
+ dot query System.Account treasury
143
+
144
+ # Dev accounts also resolve
145
+ dot tx Balances.transferKeepAlive bob 1000000000000 --from alice
146
+ ```
147
+
148
+ Resolution order: dev account name > stored account name > SS58 address > hex public key. If the input doesn't match any, the CLI shows an error listing available account names.
149
+
116
150
  #### Inspect accounts
117
151
 
118
152
  Convert between SS58 addresses, hex public keys, and account names. Accepts any of:
@@ -505,6 +539,35 @@ dot query System.Number --output json | jq
505
539
 
506
540
  In an interactive terminal, both streams render together so you see progress and results normally.
507
541
 
542
+ ### Shell completions
543
+
544
+ Generate shell completion scripts for tab-completing subcommands, chain names, pallet names, and item names. Completions use cached metadata — no network calls are made.
545
+
546
+ ```bash
547
+ # zsh — add to ~/.zshrc
548
+ eval "$(dot completions zsh)"
549
+
550
+ # bash — add to ~/.bashrc
551
+ eval "$(dot completions bash)"
552
+
553
+ # fish — save to completions directory
554
+ dot completions fish > ~/.config/fish/completions/dot.fish
555
+ ```
556
+
557
+ Once installed, press Tab to complete:
558
+
559
+ ```bash
560
+ dot qu<Tab> # → query
561
+ dot query.<Tab> # → query.System, query.Balances, ...
562
+ dot query.System.<Tab> # → query.System.Account, query.System.Number, ...
563
+ dot polkadot.<Tab> # → polkadot.query, polkadot.tx, ...
564
+ dot --chain <Tab> # → polkadot, paseo, ...
565
+ dot --from <Tab> # → alice, bob, ..., stored account names
566
+ dot chain <Tab> # → add, remove, update, list, default
567
+ ```
568
+
569
+ 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.
570
+
508
571
  ## How it compares
509
572
 
510
573
  | | polkadot-cli | @polkadot/api-cli | subxt-cli | Pop CLI |