@@ -10,7 +10,14 @@ pnpm add -g @alchemyplatform/cli
1010
1111## Authentication
1212
13- Set your Alchemy API key (get one at [ alchemy.com] ( https://dashboard.alchemy.com/ ) ):
13+ The CLI uses two types of keys:
14+
15+ - ** API key** — for blockchain queries (balance, tx, block, nfts, tokens, rpc)
16+ - ** Access key** — for the Admin API (apps, chains)
17+
18+ Get both at [ alchemy.com] ( https://dashboard.alchemy.com/ ) .
19+
20+ ### API key
1421
1522``` bash
1623# Option 1: config file
@@ -23,10 +30,36 @@ export ALCHEMY_API_KEY=<your-key>
2330alchemy balance 0x... --api-key < your-key>
2431```
2532
26- Resolution order: ` --api-key ` flag → ` ALCHEMY_API_KEY ` env var → config file.
33+ Resolution order: ` --api-key ` flag → ` ALCHEMY_API_KEY ` env var → config file → configured app's API key.
34+
35+ ### Access key
36+
37+ ``` bash
38+ # Option 1: config file (triggers interactive app setup in TTY)
39+ alchemy config set access-key < your-key>
40+
41+ # Option 2: environment variable
42+ export ALCHEMY_ACCESS_KEY=< your-key>
43+
44+ # Option 3: per-command flag
45+ alchemy apps list --access-key < your-key>
46+ ```
47+
48+ Resolution order: ` --access-key ` flag → ` ALCHEMY_ACCESS_KEY ` env var → config file.
2749
2850## Usage
2951
52+ ### Interactive REPL
53+
54+ Run ` alchemy ` with no arguments in a terminal to enter interactive mode with tab-completion:
55+
56+ ``` bash
57+ alchemy
58+ alchemy ◆ balance 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045
59+ alchemy ◆ block latest
60+ alchemy ◆ exit
61+ ```
62+
3063### Get an ETH balance
3164
3265``` bash
@@ -65,6 +98,43 @@ alchemy rpc eth_blockNumber
6598alchemy rpc eth_getBalance " 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045" " latest"
6699```
67100
101+ ### Manage apps
102+
103+ Requires an access key.
104+
105+ ``` bash
106+ # List all apps
107+ alchemy apps list
108+
109+ # Get app details
110+ alchemy apps get < app-id>
111+
112+ # Create a new app
113+ alchemy apps create --name " My App" --networks eth-mainnet,polygon-mainnet
114+
115+ # Update an app
116+ alchemy apps update < app-id> --name " New Name"
117+
118+ # Delete an app
119+ alchemy apps delete < app-id>
120+
121+ # Update network allowlist
122+ alchemy apps networks < app-id> --networks eth-mainnet,arb-mainnet
123+
124+ # Update address/origin/IP allowlists
125+ alchemy apps address-allowlist < app-id> --addresses 0xabc,0xdef
126+ alchemy apps origin-allowlist < app-id> --origins https://example.com
127+ alchemy apps ip-allowlist < app-id> --ips 1.2.3.4,5.6.7.8
128+ ```
129+
130+ ### List chain networks
131+
132+ Requires an access key.
133+
134+ ``` bash
135+ alchemy chains list
136+ ```
137+
68138### List supported networks
69139
70140``` bash
@@ -75,16 +145,25 @@ alchemy network list
75145
76146``` bash
77147alchemy config set api-key < key>
148+ alchemy config set access-key < key>
149+ alchemy config set app # interactive app selector
78150alchemy config set network polygon-mainnet
79151alchemy config get api-key
80152alchemy config list
81153```
82154
155+ ### Print version
156+
157+ ``` bash
158+ alchemy version
159+ ```
160+
83161## Global Flags
84162
85163| Flag | Env Var | Description |
86164| ------| ---------| -------------|
87- | ` --api-key ` | ` ALCHEMY_API_KEY ` | API key for requests |
165+ | ` --api-key ` | ` ALCHEMY_API_KEY ` | API key for blockchain queries |
166+ | ` --access-key ` | ` ALCHEMY_ACCESS_KEY ` | Access key for Admin API operations |
88167| ` --network, -n ` | ` ALCHEMY_NETWORK ` | Target network (default: ` eth-mainnet ` ) |
89168| ` --json ` | — | Force JSON output |
90169| ` --quiet, -q ` | — | Suppress non-essential output |
0 commit comments