炼金液
Alchemy CLI是查询块链数据和管理Alchemy应用/配置的命令行工具. 它既支持人性友好的终端输出,也支持JSON输出自动化. 您可以根据命令使用浏览器登录、 API 密钥或 x402 钱包认证 .
能力一览
| 尽你所能 | 指挥区 |
|---|---|
| 管理 Alchemy 应用程序、 网络、 允许列表、 webhooks 和本地 CLI 配置 | alchemy app, (中文(简体) ), alchemy webhook, (中文(简体) ), alchemy config |
| 用摘要和时间序列报告跟踪和可视化API的使用(alpha;早期访问) | alchemy usage summary, (中文(简体) ), alchemy usage timeseries |
| 向Alchemy团队发送产品反馈 | alchemy feedback |
| 查询整个EVM和索拉纳的链条数据,包括余额、NFT、转移、价格、块、日志、痕迹、模拟和原始RPC | alchemy evm, (中文(简体) ), alchemy solana |
| 为 EVM 和 Solana 动作使用代理钱包, 包括发送、 互换、 合同呼叫、 批准和跨链连接 | alchemy wallet, (中文(简体) ), alchemy evm send, (中文(简体) ), alchemy solana send, (中文(简体) ), alchemy xchain bridge |
| 在 USDC 中支付第三方 x402 API , 并设置支出上限, 并检查 Circle 网关余额 | alchemy x402 request, (中文(简体) ), alchemy x402 balance |
安装
从 npm 全球安装 :
npm i -g @alchemy/cli
或者不在全球安装就运行 :
npx @alchemy/cli <command>
贝壳补全
为所有命令和子命令启用标签补全 :
# zsh (add to ~/.zshrc)
echo 'eval "$(alchemy completions zsh)"' >> ~/.zshrc
source ~/.zshrc
# bash (add to ~/.bashrc)
echo 'eval "$(alchemy completions bash)"' >> ~/.bashrc
source ~/.bashrc
# fish
alchemy completions fish > ~/.config/fish/completions/alchemy.fish
开始
认证快速启动
在提出请求之前需要认证。 建议的路径是浏览器登录 :
alchemy auth
这将打开浏览器链接您的 Alchemy 账户, 然后提示您选择一个应用程序 。 选中的应用程序的 API 密钥自动保存到您的配置中 。 过 -y 以跳过确认提示.
如果你运行 alchemy 没有命令和未配置认证, CLI 将自动引导您通过浏览器登录 .
如果您有认证符但还没有选择应用程序, CLI 将提示您在运行任何需要 API 密钥的命令之前先选择一个 。 拥有许多应用程序的团队可以按名进行打入搜索.
如果您使用 Noty webhooks,请在上方通过 alchemy config set webhook-api-key <key>, (中文(简体) ), --webhook-api-key 打开 alchemy webhook 命令,或 ALCHEMY_WEBHOOK_API_KEY。 。 。 .
按工作流程使用
Auth 配置后, 根据驾驶者使用不同的 CLI :
- 人类(互动终端): 开始
alchemy并使用终端 UI/设置流程;这是推荐给人类使用的路径 - 代理/记录(自动): 使用情况
--json --no-interactive以保证 JSON 输出和禁用提示( JSON 在管道被自动启用, 但是--json是安全默认)
快速使用示例 :
# Human recommended entrypoint
alchemy
# Agent/script-friendly command
alchemy evm data balance 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045 -n eth-mainnet --json --no-interactive
# Agent checks whether a newer CLI version is available
alchemy update-check --json --no-interactive
代理拖带
让你的经纪人跑 agent-prompt 作为获得完整、机器可读合同的第一步,该合同描述了每个命令、认证方法、错误代码和执行规则:
# Agent runs this once to learn everything the CLI can do
alchemy --json --no-interactive agent-prompt
这将返回一个带有执行策略的 JSON 文件、 运行时发现指示、 飞行前指示、 认证矩阵、 包含所有参数和选项的完整命令树、 包含恢复动作的错误代码以及实例引用 。 不需要外部文件 .
特工也可以打电话 alchemy --json --no-interactive update-check 以获取当前 CLI 版本、最新已知版本并安装升级命令.
命令参考
运行命令为 alchemy <command>。 。 。 .
使用 alchemy help 或者说 alchemy help <command> 用于生成命令帮助.
EVM( 视频)
| 命令 | 它会做什么 | 示例 |
|---|---|---|
evm rpc <method> [params...] | 给伊特鲁姆JSON -RPC打电话 | alchemy evm rpc eth_blockNumber -n eth-mainnet |
evm data balance [address] | 获取地址的本地符号平衡 | alchemy evm data balance 0x... -n eth-mainnet |
evm data tokens balances [address] | 列出 ERC-20 地址余额 | alchemy evm data tokens balances 0x... -n eth-mainnet |
evm data nfts [address] | 地址拥有的 NFT 列表 | alchemy evm data nfts 0x... -n eth-mainnet |
evm data history [address] | 获取传输历史( E)alchemy_getAssetTransfers(中文(简体) ) | alchemy evm data history 0x... --category erc20,erc721 -n eth-mainnet |
evm data price symbol <symbols> | 以符号方式获得当前符号价格 | alchemy evm data price symbol ETH,USDC |
evm data portfolio tokens --body <json> | 获得令牌组合数据 | alchemy evm data portfolio tokens --body '{...}' |
evm send <to> <amount> | 发送本地令牌 --network,或 ERC-20 符号 --token | alchemy evm send vitalik.eth 0.1 -n base-mainnet |
evm contract read/call | 阅读或撰写智能合同 | alchemy evm contract read 0x... "balanceOf(address)(uint256)" --args '["0x..."]' -n eth-mainnet |
evm swap quote/execute | 同一链上的交换符 | alchemy evm swap quote --from 0xEeee... --to 0xA0b8... --amount 1 -n eth-mainnet |
evm approve <spender_address> | 核准 ERC-20 象征性津贴 | alchemy evm approve 0x... --token-address 0x... --amount 10 -n eth-mainnet |
evm status [id] | 检查交易或运行状态 | alchemy evm status 0x... -n eth-mainnet |
evm network list | 列出供使用的 RPC 网络ID --network | alchemy evm network list --search base |
evm tx/receipt/block/gas/logs | 获取共同节点资源 | alchemy evm block latest -n eth-mainnet |
evm trace/debug | 调用跟踪和调试 API 方法 | alchemy evm trace call '{"to":"0x..."}' '["trace"]' latest -n eth-mainnet |
evm simulate * | 调用模拟 API | alchemy evm simulate execution --tx '{"to":"0x..."}' -n eth-mainnet |
钱包
alchemy wallet 暴露出一个统一的链动表面. 这个 会话钱包 (Alchemy/Privy管理,P-256授权签字人)是建议流量;a 本地钱包 (私钥存储于磁盘上)作为替代支持.
| 命令 | 它会做什么 | 示例 |
|---|---|---|
wallet connect | 默认连接会话钱包。 过 --mode local 只当您明确需要本地密钥时. | alchemy wallet connect |
wallet connect --mode local | 创建新的本地 EVM 和 Solana 密钥 . | alchemy wallet connect --mode local |
wallet connect --mode local --import <path> | 从文件中导入已有的 EVM 私钥 . | alchemy wallet connect --mode local --import ./key.txt |
wallet connect --mode session --instance-name <name> | 连接一个已命名的会话钱包实例 . | alchemy wallet connect --mode session --instance-name laptop |
wallet status [--verify] | 报告会 本地的EVM 本地的索拉纳 以及活跃的签名人. --verify 将会话与后端相协调. | alchemy wallet status --verify |
wallet address | 为每个已配置的签名符打印地址 . | alchemy wallet address |
wallet use <session|local> | 选择哪个签名符 evm send, (中文(简体) ), evm swap, (中文(简体) ), evm approve, (中文(简体) ), xchain bridge,以及 evm contract call 用于EVM交易. | alchemy wallet use local |
wallet disconnect | 撤销当前会话(本地+后端). 清除 active_signer 如果它指向会议. | alchemy wallet disconnect |
wallet qr [--type <evm|solana>] | 将配置的地址作为 QR 代码. | alchemy wallet qr --type evm |
每个命令覆盖: 通过 --signer <session\|local> 改为 evm send, (中文(简体) ), evm approve, (中文(简体) ), evm swap, (中文(简体) ), xchain bridge,或 evm contract call 为单一引用而覆盖当前签名符.
链条
| 命令 | 它会做什么 | 示例 |
|---|---|---|
solana rpc <method> [params...] | 索拉纳 JSON-RPC方法 | alchemy solana rpc getBalance '"<pubkey>"' -n solana-mainnet |
solana das <method> [params...] | 索拉纳DAS方法 | alchemy solana das getAssetsByOwner '{"ownerAddress":"<pubkey>"}' -n solana-mainnet |
solana network list | 列出来自索拉纳命名空间的网络 | alchemy solana network list --search solana |
solana send <to> <amount> | 向地址发送 SOL 或 SPL 令牌 | alchemy solana send <pubkey> 0.1 -n solana-mainnet |
solana send <to> <amount> --token <mint> | 发送 SPL 令牌并在需要时创建收件人 ATA | alchemy solana send <pubkey> 10 --token <mint> -n solana-mainnet |
solana program accounts/account/show | 检查索拉纳程序账户和账户元数据 | alchemy solana program accounts <program-id> -n solana-mainnet |
solana delegate approve/revoke | 批准或撤销SPL标志代表 | alchemy solana delegate approve --token-account <addr> --mint <mint> --delegate <addr> --amount 1 --decimals 6 -n solana-mainnet |
solana status [id] | 检查索拉纳交易或运行状态 | alchemy solana status <signature> -n solana-mainnet |
xchain bridge quote/execute | 跨链的桥牌 | alchemy xchain bridge quote --from 0xEeee... --to 0xEeee... --amount 0.1 --to-network base-mainnet -n eth-mainnet |
x402 (韩语)
| 命令 | 它会做什么 | 示例 |
|---|---|---|
x402 request <url> | 请求一个 URL 并用会话或本地签名器支付其 x402 v2 引号(USDC); --estimate 显示引用而不支付 | alchemy x402 request https://api.example.com/data --max-payment 0.01 |
x402 balance | 显示每个链条的圆形网关 USDC 平衡 | alchemy x402 balance |
非交互式运行(包括 --json要求 --max-payment,它作为支付授权;支付签名在当地核实,以便在发送前恢复到钱包地址.
CLI 管理员
| 命令 | 它会做什么 | 示例 |
|---|---|---|
(no command) | 启动交互式 REPL 模式( 仅限 TTY) | alchemy |
auth (单位:千美元)auth login(中文(简体) ) | 通过浏览器登录( PKCE) | alchemy auth |
auth status | 显示当前认证状态 | alchemy auth status |
auth logout | 清除已保存的认证符 | alchemy auth logout |
team list | 列出您的队伍并标记选中的队伍 | alchemy team list |
team select [id] | 选择命令应用的团队; 切换清除选中的应用 | alchemy team select <team-id> |
app list | 列出应用( 支持 pagination/ filtering) | alchemy app list --all |
app chains | 列出管理API链标识符(如. ETH_MAINNET(中文(简体) ) | alchemy app chains |
app get <id> | 获取应用程序细节 | alchemy app get <app-id> |
app create | 创建应用程序 | alchemy app create --name "My App" --networks eth-mainnet |
app update <id> | 更新应用程序名称/描述 | alchemy app update <app-id> --name "New Name" |
app delete <id> | 删除应用程序 | alchemy app delete <app-id> |
app networks <id> | 更新应用程序网络允许列表 | alchemy app networks <app-id> --networks eth-mainnet,polygon-mainnet |
app address-allowlist <id> | 更新应用程序地址许可列表 | alchemy app address-allowlist <app-id> --addresses 0xabc,0xdef |
app origin-allowlist <id> | 更新应用程序源代码允许列表 | alchemy app origin-allowlist <app-id> --origins https://example.com |
app ip-allowlist <id> | 更新应用 IP 许可列表 | alchemy app ip-allowlist <app-id> --ips 1.2.3.4,5.6.7.8 |
app configured-networks | 列出为应用程序配置的 RPC 网络 satters | alchemy app configured-networks --app-id <app-id> |
app select [id] | 选择默认的应用或通过 ID 交互 | alchemy app select <app-id> |
feedback [message...] | 提交产品反馈- 从 stdin 读取多行文本) | alchemy feedback Love the new usage command |
webhook list | 列表通知webhooks | alchemy webhook list --webhook-api-key <key> |
webhook create --body <json> | 创建通知 webhook | alchemy webhook create --body '{...}' --webhook-api-key <key> |
webhook update --body <json> | 更新通知网点 | alchemy webhook update --body '{...}' --webhook-api-key <key> |
webhook delete <id> | 删除通知网点 | alchemy webhook delete <id> --webhook-api-key <key> |
webhook addresses <id> | 获取地址活动网络hook地址 | alchemy webhook addresses <id> --webhook-api-key <key> |
webhook nft-filters <id> | 获取 NFT 活动 Webhook 过滤器 | alchemy webhook nft-filters <id> --webhook-api-key <key> |
doctor | 进行准备状态检查和建议 | alchemy doctor |
init | 登录、安装 MCP 服务器和技能,并添加Alchemy 指令 AGENTS.md | alchemy init --client claude --dry-run |
install mcp | 安装 Alchemy 的远程 MCP 服务器配置 | alchemy install mcp --client claude --dry-run |
install skills | 安装捆绑的炼金术 | alchemy install skills --client cursor --dry-run |
update-check | 检查是否有更新的 CLI 版本可用 | alchemy update-check --json --no-interactive |
config set ... | 设置配置值 | alchemy config set app <app-id> |
config get <key> | 获得一个配置值 | alchemy config get verbose |
config list | 列出所有配置值 | alchemy config list |
config reset [key] | 重置一个或全部配置值 | alchemy config reset --yes |
completions <shell> | 生成贝壳完成脚本( bash/zsh/ fish) | eval "$(alchemy completions zsh)" |
agent-prompt | 提供完整的代理/自动调试使用指令 | alchemy --json --no-interactive agent-prompt |
version | 打印 CLI 版本 | alchemy version |
反馈
feedback 为经认证的Alchemy用户/团队提交产品反馈。 这个
使用浏览器-login auth,不需要选择的应用或应用 API 密钥.
alchemy feedback Love the new usage command
printf "Line one\nLine two\n" | alchemy feedback -
用法 API( alpha)
这个 usage 命令在 阿尔法 反应形状可能改变,以及
访问仅限于在使用法API alpha注册的队伍.
使用时间序列范围受计划限制:
| 计划 | 最大范围 |
|---|---|
| 免费 | 1天时间 |
| 随你便 | 7天时间 |
| 企业 | 每天使用90天 |
| 距离更长 | 联系销售 |
小时查询( E)--granularity hour),每个计划限为后7天.
CLI 获取请求的全部范围 。 用法 API 页面回复 7天块; CLI 自动跟随这些页.
alchemy --json usage summary
alchemy usage timeseries --start-date 2026-06-01 --granularity day
旗帜
全球旗帜
这些适用于所有命令.
认证网络( N)
| 旗帜 | 新闻 var | 说明 |
|---|---|---|
--api-key <key> | ALCHEMY_API_KEY | 块链查询命令的 API 密钥 |
-n, --network <network> | —— 说 | 网络化命令的目标网络 |
--x402 | —— 说 | 启用基于钱包的x402 网关认证 |
--wallet-key-file <path> | —— 说 | X402 认证和本地签名的 EVM 钱包私钥文件 |
--solana-wallet-key-file <path> | —— 说 | 本地签名的 Solana 钱包私钥文件 |
输出格式化( F)
| 旗帜 | 新闻 var | 说明 |
|---|---|---|
--json | —— 说 | 强制 JSON 输出( 管道时自动启用) |
-q, --quiet | —— 说 | 禁止非必要产出 |
--verbose | —— 说 | 启用动词输出 |
--no-color | NO_COLOR | 禁用颜色输出 |
--reveal | —— 说 | 用纯文本显示机密( 只有 TTY) |
运行时间行为( P)
| 旗帜 | 新闻 var | 说明 |
|---|---|---|
--timeout <ms> | —— 说 | 请求超时( 毫秒) |
--debug | —— 说 | 启用内部调试诊断 |
--no-interactive | —— 说 | 禁用REPL和即时驱动的交互 |
移交
| 旗帜 | 新闻 var | 说明 |
|---|---|---|
--ref <source> | ALCHEMY_REF | 转录源标记,当远程测量状态首次创建时记录一次(隐藏于 --help(中文(简体) ) |
外壳:
| 新闻 var | 说明 |
|---|---|
ALCHEMY_CONFIG | 自定义配置文件的路径 |
ALCHEMY_AUTH_TOKEN | 管理 API 认证符号覆盖 |
ALCHEMY_WALLET_KEY | X402 认证和本地签名的 EVM 钱包私钥 |
ALCHEMY_SOLANA_WALLET_KEY | 索拉纳钱包私钥 |
ALCHEMY_ACTIVE_SIGNER | 活动 EVM 签名器覆盖( U)session 或者说 local(中文(简体) ) |
ALCHEMY_EVM_GAS_SPONSORED | 设定为时启用 EVM 气体赞助 true |
ALCHEMY_EVM_GAS_POLICY_ID | EVM天然气赞助政策 |
ALCHEMY_SOLANA_FEE_SPONSORED | 设置到时启用索拉纳费赞助 true |
ALCHEMY_SOLANA_FEE_POLICY_ID | 索拉纳费赞助政策 |
ALCHEMY_WEBHOOK_API_KEY | 通知命令的 Webhook API 密钥 |
命令专用旗帜
| 命令 | 旗帜 |
|---|---|
auth login | --force, (中文(简体) ), -y, --yes |
evm data nfts | --limit <n>, (中文(简体) ), --page-key <key> |
evm data nfts metadata | --contract <address> (必须), --token-id <id> (必须) |
evm data tokens balances | --page-key <key> |
evm data tokens allowance | --owner <address> (必须), --spender <address> (必须), --contract <address> (必须) |
evm data history | --from-address <address>, (中文(简体) ), --to-address <address>, (中文(简体) ), --from-block <block>, (中文(简体) ), --to-block <block>, (中文(简体) ), --category <list>, (中文(简体) ), --max-count <n>, (中文(简体) ), --page-key <key> |
evm data price address | --addresses <json> (必须) |
evm data price historical | --body <json> (必须) |
evm data portfolio * | --body <json> (每个子命令都需要) |
evm simulate * | --tx <json> 或者说 --txs <json> (必须) |
evm send | -n, --network <network> (必须), --token <address>, (中文(简体) ), --gas-sponsored, (中文(简体) ), --gas-policy-id <id>, (中文(简体) ), --signer <session|local> |
evm contract call | --args <json>, (中文(简体) ), --abi-file <path>, (中文(简体) ), --abi <json>, (中文(简体) ), --value <ether>, (中文(简体) ), --gas-sponsored, (中文(简体) ), --gas-policy-id <id>, (中文(简体) ), --signer <session|local> |
evm swap quote | --from <token_address>, (中文(简体) ), --to <token_address>, (中文(简体) ), --amount <number>, (中文(简体) ), --slippage <percent>, (中文(简体) ), --signer <session|local> |
evm swap execute | --from <token_address>, (中文(简体) ), --to <token_address>, (中文(简体) ), --amount <number>, (中文(简体) ), --slippage <percent>, (中文(简体) ), --gas-sponsored, (中文(简体) ), --gas-policy-id <id>, (中文(简体) ), --signer <session|local> |
evm approve | --token-address <token_address>, (中文(简体) ), --amount <decimal_amount>, (中文(简体) ), --unlimited, (中文(简体) ), --revoke, (中文(简体) ), --reset-first, (中文(简体) ), -y, --yes, (中文(简体) ), --gas-sponsored, (中文(简体) ), --gas-policy-id <id>, (中文(简体) ), --signer <session|local> |
xchain bridge quote | --from <token_address>, (中文(简体) ), --to <token_address>, (中文(简体) ), --amount <number>, (中文(简体) ), --to-network <network>, (中文(简体) ), --slippage <percent>, (中文(简体) ), --signer <session|local> |
xchain bridge execute | --from <token_address>, (中文(简体) ), --to <token_address>, (中文(简体) ), --amount <number>, (中文(简体) ), --to-network <network>, (中文(简体) ), --slippage <percent>, (中文(简体) ), --gas-sponsored, (中文(简体) ), --gas-policy-id <id>, (中文(简体) ), --signer <session|local> |
x402 request | -X, --method <method>, (中文(简体) ), -H, --header <header>, (中文(简体) ), -d, --data <body>, (中文(简体) ), --scheme <gateway|exact|any>, (中文(简体) ), --max-payment <usdc>, (中文(简体) ), --estimate, (中文(简体) ), -o, --output <file>, (中文(简体) ), -y, --yes, (中文(简体) ), --signer <session|local> |
x402 balance | --address <address>, (中文(简体) ), --testnet, (中文(简体) ), --signer <session|local> |
wallet connect | --mode <session|local>, (中文(简体) ), --chain <evm|solana|both>, (中文(简体) ), --import <path>, (中文(简体) ), --instance-name <name>, (中文(简体) ), --force |
wallet status | --verify |
wallet qr | --type <evm|solana>, (中文(简体) ), --solana |
solana send | --token <mint>, (中文(简体) ), --dry-run, (中文(简体) ), --fail-if-associated-token-account-missing, (中文(简体) ), --from-token-account <address>, (中文(简体) ), --recipient-token-account <address>, (中文(简体) ), --fee-sponsored, (中文(简体) ), --fee-policy-id <id>, (中文(简体) ), --signer <session|local> |
solana program accounts | --filters <json>, (中文(简体) ), --encoding <encoding>, (中文(简体) ), --limit <n> |
solana delegate approve | --token-account <address>, (中文(简体) ), --mint <address>, (中文(简体) ), --delegate <address>, (中文(简体) ), --amount <number>, (中文(简体) ), --decimals <n>, (中文(简体) ), --fee-sponsored, (中文(简体) ), --fee-policy-id <id> |
solana delegate revoke | --token-account <address>, (中文(简体) ), --fee-sponsored, (中文(简体) ), --fee-policy-id <id> |
webhook * | --webhook-api-key <key> (或 ALCHEMY_WEBHOOK_API_KEY, (中文(简体) ), ALCHEMY_NOTIFY_AUTH_TOKEN配置 webhook-api-key,或应用 webhook 键) |
app list | --cursor <cursor>, (中文(简体) ), --limit <n>, (中文(简体) ), --all, (中文(简体) ), --search <query>, (中文(简体) ), --id <appId> |
app create | --name <name> (必须), --networks <networks> (必须), --description <desc>, (中文(简体) ), --products <products>, (中文(简体) ), --dry-run |
app update | --name <name>, (中文(简体) ), --description <desc>, (中文(简体) ), --dry-run |
app delete | --dry-run, (中文(简体) ), -y, --yes |
app networks | --networks <networks> (必须), --dry-run |
app address-allowlist | --addresses <addrs> (必须), --dry-run |
app origin-allowlist | --origins <origins> (必须), --dry-run |
app ip-allowlist | --ips <ips> (必须), --dry-run |
app configured-networks | --app-id <id> |
init | --client <claude,cursor,codex,all>, (中文(简体) ), --no-login, (中文(简体) ), --no-mcp, (中文(简体) ), --no-skills, (中文(简体) ), --no-agents-md, (中文(简体) ), --dry-run |
install mcp | --client <claude,cursor,codex,other,all>, (中文(简体) ), --dry-run |
install skills | --client <claude,cursor,codex,all>, (中文(简体) ), --dry-run |
evm network list | --mainnet-only, (中文(简体) ), --testnet-only, (中文(简体) ), --search <term> |
config set | webhook-api-key, (中文(简体) ), app, (中文(简体) ), network, (中文(简体) ), verbose, (中文(简体) ), wallet-key-file, (中文(简体) ), x402, (中文(简体) ), evm-gas-sponsored, (中文(简体) ), evm-gas-policy-id, (中文(简体) ), solana-fee-sponsored, (中文(简体) ), solana-fee-policy-id |
config reset | -y, --yes |
认证引用
# Interactive login — opens browser to link your Alchemy account
alchemy auth
# Skip the confirmation prompt
alchemy auth -y
# Force re-authentication
alchemy auth login --force
# Check auth status
alchemy auth status
# Log out
alchemy auth logout
登录后,CLI会提示您选择一个团队,如果您属于多个团队,然后是应用程序. 该app的API密钥被保存为配置并用于所有后续的命令. 如果您在登录时跳过应用程序选择, CLI 将提示您在运行任何需要 API 密钥的命令之前先选择一个 .
通知/webhook 命令使用有分辨率命令的webhook API 密钥 :
--webhook-api-key - > (中文) ALCHEMY_WEBHOOK_API_KEY - > (中文) ALCHEMY_NOTIFY_AUTH_TOKEN - > 配置 webhook-api-key - > 配置了 app webhook 密钥 .
遥测
本节介绍CLI的选出用法遥测:它涵盖什么,当有人告诉你时,以及如何关闭.
默认启用收藏 。 在收集或发送任何事件之前,适用以下选择退出控制.
收集的内容: 命令和设置步骤,结果和时间,CLI版本,节点主版本,OS与环境(CI,终端,JSON或REPL模式),网络,旗名,引用源,以及被检测到的AI工具及其版本,当知道时.
链接到: 您的Alchemy用户和团队ID,您的计划,以及随机安装和每个运行的ID.
从未收集 : 提示、秘密、地址、文件路径或参数值,但允许的网络和推荐标签除外.
通知出现时: 在第一次适用遥测时,CLI显示一次性通知,说明上述情况.
- 在终端: 在第一个命令之前.
- 在 JSON 模式下 (单位:千美元)
--json,或当stdout被管: 在错误中 JSON 表示error.notice如果第一个命令失败, 否则在结果后作为 JSON 线在 stderr 上 :{"notice": "..."}。 。 。 . - 预览失败和
--help编号 :--version旗帜 别显出. 这些跑道上没有任何东西被收集,通知出现在下一个命令上.
选择退出 :
alchemy telemetry disable # persistent opt-out; deletes queued events
alchemy telemetry enable # opt back in
alchemy telemetry status # show the current state
export ALCHEMY_TELEMETRY_DISABLED=1 # or DO_NOT_TRACK=1, per shell or CI job
ALCHEMY_TELEMETRY_DISABLED 财务报告和审定财务报表 DO_NOT_TRACK 当遥测被设定为真实值时,例如 1,无论节省的偏好。 空着, 0, (中文(简体) ), false, (中文(简体) ), no 财务报告和审定财务报表 off 不要数.
在州内生活: $XDG_CONFIG_HOME/alchemy/telemetry.json (默认) ~/.config/alchemy/telemetry.json),或位于由 ALCHEMY_CONFIG。它持有随机安装ID、打开/关闭首选和查询源。 通知是否在 telemetry/notice-shown 在同一目录中.
转介来源: --ref <source> 或者说 ALCHEMY_REF 被记录一次,当遥测状态最初创建,然后被忽略.
RAPL 模式
运行 alchemy 在交互式终端中没有命令 :
alchemy
alchemy ◆ evm data balance 0x...
alchemy ◆ evm block latest
alchemy ◆ exit
使用 --no-interactive 在自动化中禁用 REPL/ prompts.
输出模式
- TTY( 直线) : 格式化的人类产出(表、颜色、旋转器)
- 非TTY(管道/重定向): JSON 自动输出——不需要旗帜
--json: 强迫 JSON 输出, 甚至在终端--verbose或者说alchemy config set verbose true: 日志请求/答复细节(方法、 URL、 状态、 时间) 到 stderr
错误格式
错误在 JSON 模式中是结构化的 JSON :
{
"error": {
"code": "AUTH_REQUIRED",
"message": "Not authenticated. Run 'alchemy auth' to log in, or set ALCHEMY_API_KEY.",
"hint": "alchemy auth"
}
}