# CLI Commands

> Per-command reference for the Lev CLI covering deals, contacts, companies, placements, pipelines, lenders, term sheets, market data, and API key management.

Source: https://www.lev.com/docs/build/cli-commands

Last updated: May 2026

---
## Auth

Manage authentication credentials and inspect the current session.

```bash
lev auth login                   # Store API key in OS keychain
lev auth login --profile staging # Store under a named profile
lev auth status                  # Show user, account, scopes, rate limits
lev auth logout                  # Remove stored credentials from the keychain
lev auth switch staging          # Change the default profile
```

  Credentials are stored in the OS keychain (macOS Keychain, Linux Secret Service) — never written to a config file.

## Config

Inspect and manage the CLI's local configuration file at `~/.config/lev/config.toml`.

```bash
lev config init          # Interactive first-time setup wizard
lev config show          # Print the resolved configuration (secrets masked)
lev config set key value # Set a single config key (e.g. default output format)
```

See **[CLI Reference → Configuration](/build/cli-reference#configuration)** for the resolution priority order (flags > env vars > project config > user config > defaults).

## Deals

Full CRUD operations on the core deal resource. See **[Deals](/build/deals)** for field definitions and schema details.

### List deals

**lev deals list**

### Basic

```bash
lev deals list
```

### With filters

```bash
lev deals list --loan-type permanent --sort -loan_amount --limit 20
```

### JSON output

```bash
lev deals list -o json | jq '.data[] | {id, title, loan_amount}'
```

### LLM agent

```bash
# An LLM coding agent (Claude Code, Cursor, etc.) can run this directly —
# piped output auto-switches to JSON, so the agent receives structured data
lev deals list --loan-type permanent --include financials
```

```
                         Deals (42 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  │
│ 1987 │ Industrial Park Bridge   │  $12,000,000 │ bridge    │ 1mo ago  │
│ 1920 │ Downtown Mixed-Use       │   $8,500,000 │ construct │ 2mo ago  │
└──────┴──────────────────────────┴──────────────┴───────────┴──────────┘
Showing 5 of 42. Use --offset to see more.
```

| Flag | Description |
|------|-------------|
| `--loan-type TYPE` | Filter by loan type (permanent, heavy_bridge, construction, etc.) |
| `--business-plan PLAN` | Filter by business plan (stabilized, value_add, etc.) |
| `--filter FIELD=VALUE` | Generic filter for any supported field |
| `--sort FIELD` | Sort by field (prefix with `-` for descending) |
| `--include RESOURCES` | Embed sub-resources: `financials`, `properties`, `team` |
| `--fields FIELDS` | Return only specific fields (id always included) |
| `--limit N` | Results per page (1–200, default 50) |
| `--all` | Fetch all pages with progress bar |

### Get a deal

```bash
lev deals get 2303
lev deals get 2303 --include financials,properties,team
lev deals get 2303 --fields title,loan_amount,loan_type
```

### Create a deal

```bash
lev deals create --title "456 Oak Ave Refinance" --loan-amount 3500000 --loan-type permanent
```

```
Created deal 2350: 456 Oak Ave Refinance
```

  Create, update, and delete commands prompt for confirmation in interactive terminals. Use `--yes` to skip prompts in scripts, and `--dry-run` to preview without executing. See **[CLI Workflows](/build/cli-workflows)** for scripting patterns.

### Update a deal

```bash
lev deals update 2303 --loan-amount 55000000 --description "Updated loan amount after reappraisal"
```

### Delete a deal

```bash
lev deals delete 2303
```

Performs a soft-delete (archive). The deal is not permanently removed.

### Move a deal

```bash
lev deals move 2303 --pipeline 10 --status 3
```

Pass the pipeline ID and status ID as integers — use `lev pipelines list` and `lev pipelines get <id>` to look them up. `--pipeline` and `--status` are both required.

  Moving a deal to a launching status (Outreach, Negotiating, Closing, Closed) in a financing pipeline automatically sets the deal's launch date if not already set.

### Related deal resources

Sub-resources on a deal are exposed as dedicated commands. Use these when you want one specific slice without loading the full deal payload:

```bash
lev deals financials 2303       # GET /deals/{id}/financials
lev deals properties 2303       # GET /deals/{id}/properties
lev deals team 2303             # GET /deals/{id}/team
```

## Contacts

Manage lender and sponsor contacts in the CRM. See **[Contacts](/build/contacts)** for field definitions.

### List contacts

**lev contacts list**

### All contacts

```bash
lev contacts list
```

### Filter by type

```bash
lev contacts list --type lender --sort -created_at
```

### Export to CSV

```bash
lev -o csv contacts list > contacts.csv
```

```
                     Contacts (156 total)
┌──────┬──────────────────┬───────────────────┬─────────┬──────────┐
│ Id   │ Name             │ Company           │ Type    │ Updated  │
├──────┼──────────────────┼───────────────────┼─────────┼──────────┤
│ 891  │ Jane Park        │ Capital One       │ lender  │ 1d ago   │
│ 887  │ Michael Torres   │ Wells Fargo       │ lender  │ 3d ago   │
│ 854  │ Sarah Chen       │ Brookfield Asset  │ sponsor │ 1wk ago  │
└──────┴──────────────────┴───────────────────┴─────────┴──────────┘
```

### Get, create, update

```bash
lev contacts get 891
lev contacts create --company-id 12 --type lender --first Alex --last Kim --email alex@example.com
lev contacts update 891 --title "Senior Vice President"
```

`--company-id`, `--type`, `--first`, and `--last` are all required on `create`. `--type` accepts `lender` or `sponsor`.

## Companies

Manage lender and sponsor company records. See **[Companies](/build/companies)** for field definitions.

### List companies

**lev companies list**

### All companies

```bash
lev companies list
```

### Filter by state

```bash
lev companies list --state NY --name "Capital"
```

```
                     Companies (89 total)
┌──────┬──────────────────────┬─────────┬───────┬──────────┐
│ Id   │ Name                 │ Type    │ State │ Updated  │
├──────┼──────────────────────┼─────────┼───────┼──────────┤
│ 312  │ Capital One CRE      │ lender  │ NY    │ 2d ago   │
│ 298  │ Wells Fargo CMBS     │ lender  │ CA    │ 5d ago   │
│ 245  │ Brookfield Asset Mgmt│ sponsor │ NY    │ 2wk ago  │
└──────┴──────────────────────┴─────────┴───────┴──────────┘
```

### Get, create, update

```bash
lev companies get 312
lev companies create --name "New Capital LLC" --type sponsor
lev companies update 312 --website "https://capitalcre.com"
```

## Placements

View lender outreach and placement progression. See **[Placements](/build/placements)** for field definitions.

### List placements

**lev placements list**

### By deal

```bash
lev placements list --deal-id 2303
```

### By status

```bash
lev placements list --deal-id 2303 --status sent
```

```
               Placements for Deal 2303 (12 total)
┌──────┬──────────────────┬──────────────┬──────────┬──────────┐
│ Id   │ Lender           │ Status       │ Score    │ Updated  │
├──────┼──────────────────┼──────────────┼──────────┼──────────┤
│ 4501 │ Capital One      │ sent         │ 92       │ 1d ago   │
│ 4498 │ Wells Fargo      │ interested   │ 88       │ 2d ago   │
│ 4490 │ JPMorgan Chase   │ reviewing    │ 85       │ 3d ago   │
└──────┴──────────────────┴──────────────┴──────────┴──────────┘
```

### Get a placement

```bash
lev placements get 4501
```

## Pipelines

View deal pipelines. To move a deal into a pipeline stage, see **[Move a deal](#move-a-deal)** under Deals — the CLI groups mutations under the resource being mutated. See **[Pipelines](/build/pipelines)** for field definitions.

### List pipelines

```bash
lev pipelines list
```

```
                     Pipelines (3 total)
┌──────┬──────────────────────┬──────────────────────────────┐
│ Id   │ Name                 │ Statuses                     │
├──────┼──────────────────────┼──────────────────────────────┤
│ 10   │ Financing            │ New → Outreach → Closing     │
│ 11   │ Acquisition          │ Sourcing → DD → Under PSA    │
│ 12   │ Internal Review      │ Submitted → Approved         │
└──────┴──────────────────────┴──────────────────────────────┘
```

### Get a pipeline

```bash
lev pipelines get 10
```

## Lender Directory

Search the institutional lender directory. See **[Lender Directory](/build/lender-directory)** for field definitions.

### Search lenders

**lev lenders search**

### By name

```bash
lev lenders search --name "Capital One"
```

### By state

```bash
lev lenders search --state NY --limit 10
```

### JSON for scripting

```bash
lev lenders search --state NY -o json | jq '.data[].name'
```

```
                   Lenders matching "Capital One" (3 total)
┌──────┬──────────────────────────┬───────────┬──────────────┐
│ Id   │ Name                     │ Type      │ Programs     │
├──────┼──────────────────────────┼───────────┼──────────────┤
│ 1042 │ Capital One CRE          │ bank      │ 5 programs   │
│ 1043 │ Capital One Multifamily  │ bank      │ 3 programs   │
│ 1044 │ Capital One Healthcare   │ bank      │ 2 programs   │
└──────┴──────────────────────────┴───────────┴──────────────┘
```

### Get a lender

```bash
lev lenders get 1042
lev lenders get 1042 --include programs
```

## Term Sheets

View term sheets for a deal. See **[Term Sheets](/build/term-sheets)** for field definitions.

### List term sheets

```bash
lev term-sheets list 2303
```

```
              Term Sheets for Deal 2303 (4 total)
┌──────┬──────────────────┬─────────┬───────────┬──────────┐
│ Id   │ Lender           │ Rate    │ Type      │ Updated  │
├──────┼──────────────────┼─────────┼───────────┼──────────┤
│ 780  │ Capital One      │ 5.25%   │ fixed     │ 1d ago   │
│ 778  │ Wells Fargo      │ S+185   │ floating  │ 2d ago   │
│ 775  │ JPMorgan Chase   │ 5.50%   │ fixed     │ 3d ago   │
│ 770  │ Signature Bank   │ S+200   │ floating  │ 5d ago   │
└──────┴──────────────────┴─────────┴───────────┴──────────┘
```

### Get a term sheet

```bash
lev term-sheets get 2303 780
```

Pass both the deal ID and the term sheet ID — term sheets are scoped to a deal.

## Market Data

Retrieve current base rates and reference data. See **[Market Data](/build/market-data)** for field definitions.

```bash
lev market rates
```

```
                     Base Rates
┌───────────────────┬────────┬─────────────────┐
│ Index             │ Rate   │ As Of           │
├───────────────────┼────────┼─────────────────┤
│ SOFR              │ 4.33%  │ 2026-04-04      │
│ 5Y Treasury       │ 3.92%  │ 2026-04-04      │
│ 10Y Treasury      │ 4.21%  │ 2026-04-04      │
│ Prime             │ 7.50%  │ 2026-04-04      │
└───────────────────┴────────┴─────────────────┘
```

## API Keys

Manage API keys for your account. See **[API Keys](/build/api-keys)** for details.

### List keys

```bash
lev api-keys list
```

```
                         API Keys (3 total)
┌──────┬────────────────┬──────────────────┬─────────────────┐
│ Id   │ Prefix         │ Label            │ Last Used       │
├──────┼────────────────┼──────────────────┼─────────────────┤
│ 42   │ lev_sk_a1b2... │ production-sync  │ 2h ago          │
│ 38   │ lev_sk_c3d4... │ staging          │ 3d ago          │
│ 31   │ lev_sk_e5f6... │ ci-pipeline      │ 1wk ago         │
└──────┴────────────────┴──────────────────┴─────────────────┘
```

### Create and revoke

```bash
lev api-keys create --label "new-integration"
# Created key: lev_sk_... (shown once — save it now)

lev api-keys revoke 42
```

Revoke takes the integer `Id` from `lev api-keys list` — the `lev_sk_*` prefix is not accepted.

  The full key is shown only at creation. Store it securely — you cannot retrieve it later.