> ## Documentation Index
> Fetch the complete documentation index at: https://api.docs.dealmachine.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Commands

> Complete DealMachine CLI command reference

# Command Reference

## Authentication

### `dm login`

Authenticate with your DealMachine account using the device authorization flow.

```bash theme={null}
dm login [--no-browser] [--key <api-key>] [--env <environment>]
```

| Option                | Description                                                                |
| --------------------- | -------------------------------------------------------------------------- |
| `--no-browser`        | Don't automatically open the browser                                       |
| `--key <api-key>`     | Login directly with an API key (skips browser flow)                        |
| `--env <environment>` | API environment: `local`, `staging`, or `production` (default: production) |

### `dm logout`

Remove stored credentials.

```bash theme={null}
dm logout
```

### `dm whoami`

Show current authentication status.

```bash theme={null}
dm whoami [--verify]
```

| Option     | Description                        |
| ---------- | ---------------------------------- |
| `--verify` | Verify credentials against the API |

***

## Account

### `dm account`

Show account information from the API.

```bash theme={null}
dm account [--json]
```

```
Account
----------------------------------------
Organization:  My Company
Org ID:        1
Created:       Jan 1, 2024
Auth Type:     api_key
```

### `dm usage`

Show credit usage for the current billing period.

```bash theme={null}
dm usage [--json]
```

```
Credit Usage
----------------------------------------
Data Credits Used:     150
Data Credits Limit:    1,000
Data Credits Remaining: 850
Period Start:     2024-01-01
Period End:       2024-01-31
```

***

## Agents

### `dm agents`

Print concise guidance for agents using the CLI.

```bash theme={null}
dm agents [--json]
```

Use this as the first command when an agent has access to `dm` but has not loaded the DealMachine Playbook.

### `dm agents guide`

Print the concise agent guide explicitly.

```bash theme={null}
dm agents guide [--json]
```

The guide tells agents to use JSON output, quiet mode, live filter and field discovery, free counts before searches, and credit confirmation before fetching records or exporting.

### `dm agents playbook`

Print the bundled DealMachine Playbook Markdown for property intelligence workflows.

```bash theme={null}
dm agents playbook [--json]
dm agents skill
```

Agents should load this before translating natural language property, people, contact, enrichment, list, export, comps, or credit-usage requests into CLI commands.

***

## Properties

### `dm properties search`

Search for properties with filters.

```bash theme={null}
# From a JSON file
dm properties search -f search.json [--json]

# Inline JSON body
dm properties search --body '{"filters":[...]}' [--json]

# From stdin
echo '{"filters":[...]}' | dm properties search [--json]
```

| Option              | Description                        |
| ------------------- | ---------------------------------- |
| `-f, --file <path>` | Read request body from a JSON file |
| `--body <json>`     | Inline JSON request body           |
| `--json`            | Output raw JSON response           |

### `dm properties count`

Count properties matching filters (no credits consumed).

```bash theme={null}
dm properties count -f search.json [--json]
dm properties count --body '{"filters":[...]}' [--json]
```

### `dm properties get <id>`

Get a single property by ID.

```bash theme={null}
dm properties get prop_12345 [--contact-audience <audience>] [--fields <csv>] [--json]
```

| Option                          | Description                                                                            |
| ------------------------------- | -------------------------------------------------------------------------------------- |
| `--contact-audience <audience>` | Include contacts: `owners`, `owners_and_family`, `renters`, `residents`, `all`, `none` |
| `--fields <csv>`                | Comma-separated property field IDs from `dm fields`                                    |
| `--json`                        | Output raw JSON response                                                               |

Use `--contact-audience none` when you only need property data. This omits contacts and avoids
people credits.

### `dm properties ids [ids...]`

Get multiple properties by IDs.

```bash theme={null}
# IDs as arguments
dm properties ids prop_12345 prop_67890 [--json]

# Or from JSON body
dm properties ids --body '{"ids":["prop_12345","prop_67890"]}' [--json]
```

| Option                          | Description                                                                            |
| ------------------------------- | -------------------------------------------------------------------------------------- |
| `--body <json>`                 | Request body as JSON string                                                            |
| `-f, --file <path>`             | Read request body from a JSON file                                                     |
| `--contact-audience <audience>` | Include contacts: `owners`, `owners_and_family`, `renters`, `residents`, `all`, `none` |
| `--json`                        | Output raw JSON response                                                               |

***

## People

### `dm people search`

Search for people/contacts with filters.

```bash theme={null}
dm people search -f search.json [--json]
dm people search --body '{"filters":[...]}' [--json]
```

### `dm people count`

Count people matching filters (no credits consumed).

```bash theme={null}
dm people count -f search.json [--json]
```

### `dm people get <id>`

Get a single person by ID.

```bash theme={null}
dm people get per_12345 [--include-properties] [--property-limit 20] [--fields <csv>] [--json]
```

| Option                 | Description                                      |
| ---------------------- | ------------------------------------------------ |
| `--include-properties` | Include associated properties                    |
| `--property-limit <n>` | Maximum associated properties to return, max 100 |
| `--fields <csv>`       | Comma-separated people or property field IDs     |
| `--json`               | Output raw JSON response                         |

### `dm people ids [ids...]`

Get multiple people by IDs.

```bash theme={null}
# IDs as arguments
dm people ids per_12345 per_67890 [--json]

# Or from JSON body
dm people ids --body '{"ids":["per_12345","per_67890"]}' [--json]
```

| Option                 | Description                                       |
| ---------------------- | ------------------------------------------------- |
| `--body <json>`        | Request body as JSON string                       |
| `-f, --file <path>`    | Read request body from a JSON file                |
| `--include-properties` | Include associated properties                     |
| `--property-limit <n>` | Maximum associated properties per person, max 100 |
| `--fields <csv>`       | Comma-separated people or property field IDs      |
| `--json`               | Output raw JSON response                          |

***

## Enrichment

### `dm enrich address [address]`

Enrich a property by street address.

```bash theme={null}
dm enrich address "123 Main St, Austin, TX 78704" [--json]
```

| Option                          | Description                                                                     |
| ------------------------------- | ------------------------------------------------------------------------------- |
| `--contact-audience <audience>` | Include contacts: `owners`, `owners_and_family`, `renters`, `residents`, `none` |
| `--fields <csv>`                | Comma-separated property or people field IDs                                    |
| `--body <json>`                 | Request body as JSON string                                                     |
| `-f, --file <path>`             | Read request body from a JSON file                                              |
| `--json`                        | Output raw JSON response                                                        |

### `dm enrich latlng [coords]`

Enrich a property by latitude/longitude.

```bash theme={null}
dm enrich latlng "30.2672,-97.7431" [--json]
```

| Option                          | Description                                                                     |
| ------------------------------- | ------------------------------------------------------------------------------- |
| `--contact-audience <audience>` | Include contacts: `owners`, `owners_and_family`, `renters`, `residents`, `none` |
| `--fields <csv>`                | Comma-separated property or people field IDs                                    |
| `--body <json>`                 | Request body as JSON string                                                     |
| `-f, --file <path>`             | Read request body from a JSON file                                              |
| `--json`                        | Output raw JSON response                                                        |

<Note>Coordinates are passed as a single comma-separated string: `lat,lng`</Note>

### `dm enrich apn [apn]`

Enrich a property by Assessor's Parcel Number.

```bash theme={null}
dm enrich apn "12345678" [--json]
```

| Option                          | Description                                                                     |
| ------------------------------- | ------------------------------------------------------------------------------- |
| `--contact-audience <audience>` | Include contacts: `owners`, `owners_and_family`, `renters`, `residents`, `none` |
| `--fields <csv>`                | Comma-separated property or people field IDs                                    |
| `--body <json>`                 | Request body as JSON string                                                     |
| `-f, --file <path>`             | Read request body from a JSON file                                              |
| `--json`                        | Output raw JSON response                                                        |

<Note>
  For APNs that require a FIPS code, use `--body` to pass the full request: `dm enrich apn --body '{"apns":[{"apn":"12345678","fips":"48453"}]}'`
</Note>

### `dm enrich email [email]`

Enrich by email address.

```bash theme={null}
dm enrich email "john@example.com" [--json]
```

| Option                 | Description                                  |
| ---------------------- | -------------------------------------------- |
| `--include-properties` | Include associated properties                |
| `--fields <csv>`       | Comma-separated people or property field IDs |
| `--body <json>`        | Request body as JSON string                  |
| `-f, --file <path>`    | Read request body from a JSON file           |
| `--json`               | Output raw JSON response                     |

### `dm enrich phone [phone]`

Enrich by phone number.

```bash theme={null}
dm enrich phone "5551234567" [--json]
```

| Option                 | Description                                  |
| ---------------------- | -------------------------------------------- |
| `--include-properties` | Include associated properties                |
| `--fields <csv>`       | Comma-separated people or property field IDs |
| `--body <json>`        | Request body as JSON string                  |
| `-f, --file <path>`    | Read request body from a JSON file           |
| `--json`               | Output raw JSON response                     |

### `dm enrich name [name]`

Enrich by person name.

```bash theme={null}
dm enrich name "David Oster" [--state MO] [--zip 63101] [--json]
dm enrich name "David Oster" --state MO --estimate-cost
```

| Option                 | Description                                             |
| ---------------------- | ------------------------------------------------------- |
| `--state <code>`       | Two-letter state code to narrow results                 |
| `--zip <code>`         | ZIP code to narrow results                              |
| `--include-properties` | Include associated properties                           |
| `--fields <csv>`       | Comma-separated people or property field IDs            |
| `--estimate-cost`      | Preview people and property counts and credits for free |
| `--page <n>`           | Page number                                             |
| `--per-page <n>`       | Results per page                                        |
| `--body <json>`        | Request body as JSON string                             |
| `-f, --file <path>`    | Read request body from a JSON file                      |
| `--json`               | Output raw JSON response                                |

Email, phone, and name enrichment include `property_count` for each matched person at no extra
cost. Phone types in JSON output use `wireless`, `landline`, `voip`, or `unknown`.
For name enrichment, combine `--estimate-cost` with `--include-properties` to include associated
property totals and page-aware property credits in the free estimate.

***

## Discovery

### `dm filters`

List available search filters.

```bash theme={null}
dm filters [--source-type <type>] [--json]
```

| Option                 | Description                                      |
| ---------------------- | ------------------------------------------------ |
| `--source-type <type>` | Filter by source type (`properties` or `people`) |
| `--group-id <id>`      | Filter by group ID                               |
| `--search <term>`      | Search filters by name                           |
| `--page <n>`           | Page number                                      |
| `--per-page <n>`       | Results per page                                 |
| `--json`               | Output raw JSON response                         |

### `dm fields`

List available data fields.

```bash theme={null}
dm fields [--source-type <type>] [--json]
```

| Option                 | Description              |
| ---------------------- | ------------------------ |
| `--source-type <type>` | Filter by source type    |
| `--group-id <id>`      | Filter by group ID       |
| `--search <term>`      | Search fields by name    |
| `--page <n>`           | Page number              |
| `--per-page <n>`       | Results per page         |
| `--json`               | Output raw JSON response |

### `dm locations`

Search and look up US locations, including states, counties, cities, and ZIP codes.

```bash theme={null}
dm locations search -q "Harris" [--type county] [--state TX] [--json]
dm locations search -q "saint louis" --type city --state MO --json
dm locations search -q "MO" --type state --json
dm locations get loc_city_48106 [--json]
```

| Option        | Description                                             |
| ------------- | ------------------------------------------------------- |
| `-q, --query` | Search by name, code, state abbreviation, or state name |
| `--type`      | Filter by `state`, `county`, `city`, or `zip_code`      |
| `--state`     | Filter by two-letter state abbreviation                 |
| `--page`      | Page number                                             |
| `--per-page`  | Results per page, max 100                               |
| `--json`      | Output raw JSON response                                |

`dm locations autocomplete` remains available as a deprecated alias for `dm addresses autocomplete`.

***

## Activity

### `dm activity search`

Search your API activity/history.

```bash theme={null}
dm activity search [--json]
dm activity search -t search_properties enrich_address [--json]
dm activity search -q "123 Main St" [--json]
```

| Option                   | Description                                                            |
| ------------------------ | ---------------------------------------------------------------------- |
| `-t, --types <types...>` | Filter by activity types (e.g., `search_properties`, `enrich_address`) |
| `-q, --query <text>`     | Free-text search across activity                                       |
| `--page <n>`             | Page number                                                            |
| `--per-page <n>`         | Results per page                                                       |
| `--body <json>`          | Request body as JSON string                                            |
| `-f, --file <path>`      | Read request body from a JSON file                                     |
| `--json`                 | Output raw JSON response                                               |

### `dm activity get <id>`

Get a specific activity record by ID.

```bash theme={null}
dm activity get abc123 [--json]
```

***

## Addresses

### `dm addresses autocomplete <query>`

Return free, bounded address and normalized location suggestions.

```bash theme={null}
dm addresses autocomplete "1200 Barton Springs" --state TX
dm addresses autocomplete "saint louis 63101" --scope location --limit 5 --json
```

| Option                 | Description                                     |
| ---------------------- | ----------------------------------------------- |
| `--scope <scope>`      | `all`, `address`, or `location`, default `all`  |
| `--state <code>`       | Prefer a two-letter state abbreviation          |
| `--limit <n>`          | Maximum suggestions, default 5 and max 10       |
| `--latitude <number>`  | Latitude for nearby ranking, requires longitude |
| `--longitude <number>` | Longitude for nearby ranking, requires latitude |
| `--json`               | Output raw JSON response                        |

Autocomplete is discovery-only. It does not request fields, perform enrichment, or consume data
credits.

### `dm addresses validate [address]`

Validate and standardize addresses via USPS.

```bash theme={null}
# Single address
dm addresses validate "123 Main St, Austin, TX" [--json]

# Multiple addresses via JSON
dm addresses validate --body '{"addresses":["123 Main St, Austin, TX","456 Oak Ave, Dallas, TX"]}' [--json]
dm addresses validate -f addresses.json [--json]
```

***

## Configuration

### `dm config get [key]`

Get a configuration value, or all values if no key specified.

```bash theme={null}
dm config get
dm config get apiEnvironment
```

### `dm config set <key> <value>`

Set a configuration value.

```bash theme={null}
dm config set apiEnvironment local
dm config set apiEnvironment staging
dm config set apiEnvironment production
```

### `dm config path`

Show the config file path.

```bash theme={null}
dm config path
```

***

## Global Options

| Option      | Description                                  |
| ----------- | -------------------------------------------- |
| `--version` | Show CLI version                             |
| `--help`    | Show help for any command                    |
| `--json`    | Output raw JSON (available on most commands) |
| `--quiet`   | Suppress spinners for agents and scripts     |

```bash theme={null}
dm --version
dm --help
dm enrich --help
dm properties search --help
```
