defi-cli is an agent-first DeFi CLI for querying and acting on-chain, with a stable automation contract:
- Stable JSON envelope + deterministic field naming
- Stable exit codes
- Canonical chain and asset IDs (CAIP-2 / CAIP-19)
- Canonical amount handling (base units + decimal normalization)
Start here
- New user: Installation -> Quickstart
- Building automation: Output Contract -> Agent Overview
- Need exact command flags: Command Reference
- Need provider/key rules: Providers and Auth
Example
Key-gated routes
Most commands are keyless. Key requirements are driven by upstream providers, not by CLI licensing/auth.| Route | Env var |
|---|---|
swap quote --provider 1inch | DEFI_1INCH_API_KEY |
swap quote --provider uniswap | DEFI_UNISWAP_API_KEY |
swap quote --provider jupiter | DEFI_JUPITER_API_KEY (optional for higher limits) |
chains assets | DEFI_DEFILLAMA_API_KEY |
bridge list | DEFI_DEFILLAMA_API_KEY |
bridge details | DEFI_DEFILLAMA_API_KEY |
DEFI_BUNGEE_API_KEY and DEFI_BUNGEE_AFFILIATE.
Lending and yield routing
lend markets, lend rates, yield opportunities, and yield history use direct protocol adapters:
aave(read + execution)morpho(read + execution)moonwell(Base, Optimism; read + execution)kamino(Solana mainnet, read only)
plan, run, submit, status) are available for swap, bridge, lend, yield, rewards, approvals, and transfer workflows. See Commands Overview.

