> ## Documentation Index
> Fetch the complete documentation index at: https://defi-cli.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# defi-cli Docs

> Query and act on DeFi lending, yield, bridge, and swap from a single agent-first CLI.

`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](/installation) -> [Quickstart](/quickstart)
* Building automation: [Output Contract](/concepts/output-contract) -> [Agent Overview](/agents/overview)
* Need exact command flags: [Command Reference](/reference/commands-overview)
* Need provider/key rules: [Providers and Auth](/concepts/providers-and-auth)

## Example

```bash theme={null}
defi providers list --results-only
```

```json theme={null}
[
  {
    "name": "aave",
    "type": "lending+yield",
    "requires_key": false,
    "capabilities": ["lend.markets", "lend.rates", "lend.positions", "yield.opportunities", "yield.positions", "yield.history", "lend.plan", "lend.execute", "yield.plan", "yield.execute", "rewards.plan", "rewards.execute"]
  },
  {
    "name": "taikoswap",
    "type": "swap",
    "requires_key": false,
    "capabilities": ["swap.quote", "swap.plan", "swap.execute"]
  },
  {
    "name": "across",
    "type": "bridge",
    "requires_key": false,
    "capabilities": ["bridge.quote", "bridge.plan", "bridge.execute"]
  }
]
```

## 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`                            |

Bungee quotes are keyless by default. Dedicated backend mode requires both `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)

Execution commands (`plan`, `run`, `submit`, `status`) are available for swap, bridge, lend, yield, rewards, approvals, and transfer workflows. See [Commands Overview](/reference/commands-overview).

## Next

* [Quickstart](/quickstart)
* [Providers and Auth](/concepts/providers-and-auth)
