Build

CLI Setup

Install lev-cli, authenticate with an API key, validate the connection, and run your first deal query from the terminal.

Updated March 2026

When to Use the CLI

If you are building a product integration, prefer the REST API directly. If you want AI agents working with Lev, prefer MCP Setup.

Install

Requires Python 3.13+

Check your version with python3 --version. We recommend pipx because it installs the CLI in an isolated environment without polluting your global packages.

Authenticate

Create an API key in the Lev platform or via the API Keys endpoint before authenticating.

Validate the Connection

lev auth status

This shows your user, account, tier, granted scopes, and rate limits. If you see your account name, the CLI is ready.

Make Your First Call

lev deals list

The CLI renders a formatted table in your terminal:

                       Deals (7 total)
┌──────┬──────────────────────────┬─────────────┬───────────┬──────────┐
│ Id   │ Title                    │ Loan Amount │ Type      │ Updated  │
├──────┼──────────────────────────┼─────────────┼───────────┼──────────┤
│ 2303 │ Office Tower Acquisition │ $50,000,000 │ permanent │ 2d ago   │
│ 2301 │ 500 Broadway Refinance   │ $22,500,000 │ permanent │ 5d ago   │
│ 2000 │ Palm Avenue Residence    │ $19,125,000 │ permanent │ 1mo ago  │
└──────┴──────────────────────────┴─────────────┴───────────┴──────────┘

When you pipe the output, it switches to JSON automatically:

lev deals list | jq '.data[0].title'
# "Office Tower Acquisition"

Output Formats

The CLI auto-detects: tables for terminals, JSON for pipes. This means LLM coding agents that execute shell commands (Claude Code, Cursor, Windsurf, etc.) automatically receive structured JSON they can parse and act on — no extra flags needed.

Next steps
More in this section