Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.compasslabs.ai/llms.txt

Use this file to discover all available pages before exploring further.

What is the Compass CLI?

compass is a single binary that wraps the Compass DeFi API. Every endpoint is available as a subcommand, output can be rendered as JSON / YAML / table / TOON, and an --agent-mode flag tunes the experience for AI agents calling tools. Use it for:
  • Inspecting positions, balances, and vaults from the terminal
  • Scripting workflows in shell or CI
  • Giving an autonomous AI agent a typed tool surface for Compass

Install

curl -fsSL https://compasslabs.ai/install.sh | bash
Verify the install:
compass version

Authenticate

Run the interactive configure command — it stores your API key in the OS keychain (macOS Keychain, GNOME Keyring/KWallet on Linux, Windows Credential Locker):
compass configure
Or set it via environment variable for CI:
export COMPASS_API_KEY_AUTH="your_api_key_here"
Or pass it per-command:
compass --api-key-auth "your_api_key_here" earn earn-vaults --order-by tvl_usd
Priority order: CLI flags > environment variables > saved credentials (from compass configure).
Get a free API key at compasslabs.ai/login.

Quickstart

List the top 5 vaults by TVL:
compass earn earn-vaults \
  --order-by tvl_usd \
  --direction desc \
  --limit 5 \
  -o table \
  -q '.vaults'
Check the live state of an earn position:
compass earn earn-positions --chain base --owner 0xYourAddress -o json
Filter with jq directly from the CLI — list only Morpho vaults by name:
compass earn earn-vaults --order-by tvl_usd -q '.vaults[] | select(.protocol == "Morpho") | .name'

Agent mode

The CLI ships with an --agent-mode flag that:
  • Switches default output to TOON (a compact, token-efficient format ideal for LLM context)
  • Emits structured errors that agents can parse and react to
It auto-activates when invoked from a known agent environment (CLAUDE_CODE, CURSOR_AGENT, etc.) — so when an AI assistant shells out to compass …, it already gets agent-friendly output.
# Explicitly enable
compass --agent-mode earn earn-vaults --order-by tvl_usd

# Explicitly disable (e.g. inside an agent env but you want pretty output)
compass --agent-mode=false earn earn-vaults --order-by tvl_usd
You can also dump the full command schema in KDL for tool generation:
compass --usage

Output formats

-o pretty    # default — human-friendly, colored
-o json      # machine-readable
-o yaml      # readable + machine-parseable
-o table     # tabular, great for terminals
-o toon      # token-efficient, default in agent mode
Combine with -q '<jq expression>' to filter / reshape on the way out.

Command groups

GroupWhat it does
compass authManage authentication credentials
compass configureInteractive credential + preference setup
compass earnVault discovery, positions, balances, deposits, withdrawals, swaps
compass creditCredit lines: balances, borrow, repay, positions
compass gas-sponsorshipPrepare gas-sponsored transactions
compass tokenized-assetsTokenized equities operations
compass global-markets-perpsPerpetuals on global markets
compass exploreInteractively browse and run any command
Run compass <group> --help for the full subcommand list, or compass explore to browse interactively.

Shell completion

# Bash
source <(compass completion bash)

# Zsh
source <(compass completion zsh)

# Fish
compass completion fish | source

# PowerShell
compass completion powershell | Out-String | Invoke-Expression

Full command reference

Per-command documentation (every flag, every subcommand) lives in the CLI source tree:

Browse the full command reference

Auto-generated docs for every compass subcommand.

Coding Assistant

Want an AI assistant to write the integration for you? Point it at Compass’s LLM-optimized docs.

API Reference

The REST endpoints the CLI wraps. Useful for understanding what each subcommand does on the wire.