alchemy-cli
Original:🇺🇸 English
Translated
The Alchemy CLI (`@alchemy/cli`) is installed. Use `alchemy` commands for all blockchain data, wallet, webhook, and app management tasks instead of curl or raw HTTP. Covers auth setup, command discovery via `agent-prompt`, and common task-to-command mappings.
18installs
Sourcealchemyplatform/skills
Added on
NPX Install
npx skill4agent add alchemyplatform/skills alchemy-cliTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →Alchemy CLI
The Alchemy CLI () is installed. Use it for all Alchemy API interactions instead of curl or raw HTTP.
@alchemy/cliInstall
bash
npm i -g @alchemy/cliBootstrap
Run this at the start of any session to get the full command contract (every command, flag, auth method, error code, and example):
bash
alchemy --json --no-interactive agent-promptExecution Rules
- ALWAYS pass on every command
--json --no-interactive - Parse stdout as JSON on exit code 0
- Parse stderr as JSON on nonzero exit code
- NEVER run bare without
alchemy--json --no-interactive - NEVER use curl or raw HTTP when an CLI command exists for the task
alchemy
Preflight
Before the first command, check auth readiness:
bash
alchemy --json --no-interactive setup statusIf is false, follow the in the response to configure auth.
completenextCommandsAuth Setup
The fastest way to authenticate is via browser login:
bash
alchemy auth loginThis opens a browser to authenticate with your Alchemy account and automatically configures the CLI with your credentials.
To check auth status:
To log out:
alchemy auth statusalchemy auth logoutAlternative auth methods
| Method | Config command | Env var | Used by |
|---|---|---|---|
| Browser login | | -- | All commands (provides both API key and access key) |
| API key | | | balance, tx, block, rpc, tokens, nfts, transfers, prices, portfolio, simulate, solana |
| Access key | | | apps, network list |
| Webhook key | | | webhooks |
| x402 wallet | | | balance, tx, block, rpc, tokens, nfts, transfers |
Get API/access keys at dashboard.alchemy.com.
Task-to-Command Map
Node (EVM)
| Task | Command |
|---|---|
| ETH balance | |
| Transaction details | |
| Transaction receipt | |
| Block details | |
| Gas prices | |
| Event logs | |
| Raw JSON-RPC | |
| Trace methods | |
| Debug methods | |
Data
| Task | Command |
|---|---|
| ERC-20 balances | |
| ERC-20 balances (formatted) | |
| Token metadata | |
| Token allowance | |
| List owned NFTs | |
| NFT metadata | |
| NFT contract metadata | |
| Transfer history | |
| Spot prices by symbol | |
| Spot prices by address | |
| Historical prices | |
| Token portfolio | |
| NFT portfolio | |
| Portfolio transactions | |
| Simulate asset changes | |
| Simulate execution | |
Solana
| Task | Command |
|---|---|
| Solana JSON-RPC | |
| Solana DAS (NFTs/assets) | |
Webhooks
| Task | Command |
|---|---|
| List webhooks | |
| Create webhook | |
| Update webhook | |
| Delete webhook | |
App Management
| Task | Command |
|---|---|
| List apps | |
| Create app | |
| Update app | |
| Delete app | |
| List networks | |
CLI Admin
| Task | Command |
|---|---|
| Check for CLI updates | |
| View config | |
| Reset config | |
| CLI version | |
Global Flags
| Flag | Description |
|---|---|
| Force JSON output |
| Disable prompts and REPL |
| Target network (default: |
| Override API key per command |
| Override access key per command |
| Use x402 wallet auth for this command |
| Request timeout in milliseconds |
| Suppress non-essential output |
| Log request/response details to stderr |
Error Handling
Errors return structured JSON on stderr. Key error codes:
| Code | Retryable | Recovery |
|---|---|---|
| No | Set |
| Yes | Wait and retry with backoff |
| No | Fund x402 wallet or switch to API key auth |
| No | Check method, params, and network |
| Yes | Check connection and retry |
| No | Run |
For the full error code list, see output.
agent-prompt