Skip to content

lolieatapple/debank-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

debank-cli

CLI tool for DeBank Pro API — query wallet balances, DeFi positions, tokens, NFTs, and transaction history from your terminal.

GitHub: https://github.com/lolieatapple/debank-cli

Install

npm install -g debank-cli

Setup

Get your API key from cloud.debank.com, then:

debank config set-key YOUR_ACCESS_KEY

Usage

debank <command> [options]

Wallet / User

# Total balance across all chains
debank user balance 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045

# Token balances on a specific chain
debank user tokens 0x... eth

# Token balances across all chains (include small balances with --all)
debank user tokens 0x... --all

# DeFi protocol positions
debank user protocols 0x...
debank user protocols 0x... eth

# NFT holdings
debank user nfts 0x...
debank user nfts 0x... eth

# Transaction history
debank user history 0x... eth

# Token approvals / allowances
debank user approvals 0x... eth

# Chains with activity
debank user chains 0x...

Token

# Token info
debank token info eth 0xdac17f958d2ee523a2206206994597c13d831ec7

# Current price
debank token price eth 0xdac17f958d2ee523a2206206994597c13d831ec7

# Historical price
debank token price eth 0xdac17f958d2ee523a2206206994597c13d831ec7 2024-01-01

# Top holders
debank token holders eth 0xdac17f958d2ee523a2206206994597c13d831ec7 20

Chain

# List all supported chains
debank chain list

# Chain details
debank chain info eth

Gas

debank gas eth

Config

# Save API key (persisted to ~/.debank-cli/config.json)
debank config set-key YOUR_ACCESS_KEY

# Show current config
debank config show

# Remove saved key
debank config remove-key

Account

# Check API unit balance and usage
debank account units

Environment Variable

You can also set the API key via environment variable (takes precedence over saved config):

export DEBANK_ACCESS_KEY=your_key

Development

# Run directly with Bun
bun src/cli.ts user balance 0x...

# Build for Node.js
bun run build
node dist/cli.js user balance 0x...

License

MIT

About

CLI tool for DeBank Pro API - query wallet balances, DeFi positions, tokens, NFTs, and transaction history

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors