DeBank CLI Skill
This skill uses debank-cli to query blockchain data via the DeBank Pro API.
Skill repo: https://github.com/lolieatapple/debank-skill
CLI repo: https://github.com/lolieatapple/debank-cli
Prerequisites
Ensure debank-cli is installed globally:
CODEBLOCK0
If NOT_INSTALLED, install it:
CODEBLOCK1
Then check if the API key is configured:
CODEBLOCK2
If no API key is configured, ask the user for their DeBank Pro API key (obtain at https://cloud.debank.com/) and run:
CODEBLOCK3
Available Commands
Wallet Queries
| Command | Description |
|---|
| INLINECODE1 | Total USD balance across all chains |
| INLINECODE2 |
Token balances (optionally filter by chain,
--all includes dust) |
|
debank user protocols <address> [chain_id] | DeFi protocol positions with full detail (supply, borrow, rewards) |
|
debank user nfts <address> [chain_id] | NFT holdings |
|
debank user history <address> [chain_id] [count] | Transaction history (max 20 per page) |
|
debank user approvals <address> <chain_id> | Token approval/allowance list |
|
debank user chains <address> | Chains where this address has activity |
Token Queries
| Command | Description |
|---|
| INLINECODE9 | Token details (name, symbol, decimals, price) |
| INLINECODE10 |
Current or historical price |
|
debank token holders <chain_id> <token_id> [limit] | Top holders (default 20) |
Chain & Gas
| Command | Description |
|---|
| INLINECODE12 | All supported chains |
| INLINECODE13 |
Chain details |
|
debank gas <chain_id> | Gas prices (slow/normal/fast) |
Config & Account
| Command | Description |
|---|
| INLINECODE15 | Save API key to INLINECODE16 |
| INLINECODE17 |
Show current API key source and masked value |
|
debank config remove-key | Remove saved API key |
|
debank account units | Check remaining API units and usage |
Common Chain IDs
INLINECODE20 , bsc, matic, arb, op, base, avax, ftm, xdai, cro, linea, scroll, INLINECODE32
Native Token Addresses
For native tokens (ETH, BNB, etc.), use: INLINECODE33
Handling the Request
If the user provides $ARGUMENTS, parse them and run the appropriate debank command directly.
Otherwise, determine the best command based on the user's natural language request:
- - "What's in this wallet?" / "Show me the portfolio" →
debank user balance + debank user tokens + INLINECODE38 - "DeFi positions" / "protocol positions" → INLINECODE39
- "Token balances" → INLINECODE40
- "NFTs" → INLINECODE41
- "Transaction history" → INLINECODE42
- "Token price" / "How much is X?" → INLINECODE43
- "Gas price" → INLINECODE44
- "Approvals" / "allowances" → INLINECODE45
For a comprehensive portfolio overview, run balance, tokens, and protocols in sequence to give a full picture.
Present the results clearly. When showing financial data, highlight the most significant positions and totals.
DeBank CLI 技能
该技能使用 debank-cli 通过 DeBank Pro API 查询区块链数据。
技能仓库: https://github.com/lolieatapple/debank-skill
CLI 仓库: https://github.com/lolieatapple/debank-cli
前置条件
确保 debank-cli 已全局安装:
!which debank 2>/dev/null || echo NOT_INSTALLED
如果未安装,请执行安装:
bash
npm install -g debank-cli
然后检查 API 密钥是否已配置:
!debank config show 2>&1
如果未配置 API 密钥,请向用户索要其 DeBank Pro API 密钥(在 https://cloud.debank.com/ 获取)并运行:
bash
debank config set-key <密钥>
可用命令
钱包查询
| 命令 | 描述 |
|---|
| debank user balance <地址> | 所有链上的总美元余额 |
| debank user tokens <地址> [链ID] [--all] |
代币余额(可选按链筛选,--all 包含小额代币) |
| debank user protocols <地址> [链ID] | DeFi 协议持仓详情(供应、借贷、奖励) |
| debank user nfts <地址> [链ID] | NFT 持有情况 |
| debank user history <地址> [链ID] [数量] | 交易历史(每页最多20条) |
| debank user approvals <地址> <链ID> | 代币授权/额度列表 |
| debank user chains <地址> | 该地址有活动的链 |
代币查询
| 命令 | 描述 |
|---|
| debank token info <链ID> <代币ID> | 代币详情(名称、符号、小数位、价格) |
| debank token price <链ID> <代币ID> [YYYY-MM-DD] |
当前或历史价格 |
| debank token holders <链ID> <代币ID> [数量] | 持仓大户(默认20个) |
链与 Gas
| 命令 | 描述 |
|---|
| debank chain list | 所有支持的链 |
| debank chain info <链ID> |
链详情 |
| debank gas <链ID> | Gas 价格(慢速/正常/快速) |
配置与账户
| 命令 | 描述 |
|---|
| debank config set-key <密钥> | 保存 API 密钥到 ~/.debank-cli/config.json |
| debank config show |
显示当前 API 密钥来源及掩码值 |
| debank config remove-key | 移除已保存的 API 密钥 |
| debank account units | 检查剩余 API 额度及使用情况 |
常用链 ID
eth, bsc, matic, arb, op, base, avax, ftm, xdai, cro, linea, scroll, zksync
原生代币地址
对于原生代币(ETH、BNB 等),请使用:0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
处理请求
如果用户提供了 $ARGUMENTS,请解析参数并直接运行相应的 debank 命令。
否则,根据用户的自然语言请求确定最佳命令:
- - 这个钱包里有什么? / 查看投资组合 → debank user balance + debank user tokens + debank user protocols
- DeFi 持仓 / 协议持仓 → debank user protocols
- 代币余额 → debank user tokens
- NFT → debank user nfts
- 交易历史 → debank user history
- 代币价格 / X 多少钱? → debank token price
- Gas 价格 → debank gas
- 授权 / 额度 → debank user approvals
如需全面的投资组合概览,请依次运行余额、代币和协议查询,以提供完整信息。
清晰呈现结果。在展示财务数据时,突出显示最重要的持仓和总额。