DealMachine CLI
Maintainers: agent instructions, development, current Command reference, and npm releases.
DealMachine CLI (dm) -- property intelligence from the command line.
A standalone Commander.js CLI that talks to the DealMachine REST API. Provides Commands for authentication, property and people research, enrichment, lists, prospects, tags, webhooks, mail and developer utilities. Compiles to ESM JavaScript via tsc.
This package has zero @dealmachine/* dependencies -- it is a self-contained binary that communicates exclusively through the public API.
AI agent integrations
This repository is also the public distribution package for the DealMachine MCP server and DealMachine skill.
- Hosted MCP server:
https://mcp.dealmachine.com
- API documentation:
https://api.docs.dealmachine.com
- Account and API keys:
https://dealmachine.com/settings/developer
- Privacy policy:
https://dealmachine.com/privacy-policy
- Terms of service:
https://dealmachine.com/terms-of-service
- Support:
[email protected]
The MCP server supports OAuth 2.1 for ChatGPT, Claude, Cursor, Codex, and other compatible clients. It can also use a DealMachine API key in developer clients that support bearer-token configuration.
The plugin package includes:
- A hosted MCP connection for property, people, enrichment, comparable-sales, and account tools
- A credit-aware skill that discovers filters and fields, counts first, and confirms large paid operations
- A portable Agent Plugins package for compatible clients
- Manifests for OpenAI, Claude, Cursor, GitHub Copilot, and Gemini
- Official MCP Registry metadata in
server.json
The portable package follows Agent Plugins 1.0.0:
Compatible clients discover the DealMachine skill from skills/dealmachine/ and connect to the
hosted Streamable HTTP MCP server declared in mcp.json. Client-specific manifests remain in the
repository for compatibility, marketplace metadata, and richer presentation.
Example requests:
- "Find high-equity absentee-owned properties in Austin and estimate the credit cost first."
- "Look up the owner of this property and find available contact data."
- "Find comparable sales for this property."
- "Research people who match these criteria for a targeted prospecting list."
Direct skill installation:
Table of Contents
- AI agent integrations
- Installation
- Authentication
- Configuration
- Commands
- Agents --
agents, agents guide, agents playbook, agents install, agents permissions
- Auth --
login, logout, whoami
- Config --
config get, config set, config path
- Account --
account
- Usage --
usage
- Properties --
search, count, get, ids, export
- People --
search, count, get, ids, export
- Enrich --
address, latlng, apn, email, phone, name
- Comps -- comparable property analysis
- Lists --
search, create, get, update, delete, build, import, items, add, remove, export
- Filters -- list available search filters
- Fields -- list available data fields
- Activity --
search, get
- Addresses --
autocomplete, validate
- Dev --
license add, license list, license remove
- Global Options
- Input Methods
- Project Structure
- Building
- Adding New Commands
- Dependencies
Installation
From npm (global)
The canonical implementation package is @dealmachine/cli. The dealmachine package is the short install alias and provides the same dm command.
From source
Link for local development
The binary entry is dist/index.js, declared in package.json under bin.dm. Requires Node.js >= 18.
Authentication
The CLI supports two authentication methods.
Device Auth Flow (RFC 8628)
The default dm login command uses the OAuth 2.0 Device Authorization Grant (RFC 8628). This is the recommended flow for interactive use:
- The CLI requests a device code from
POST /v1/auth/device/code with client ID dealmachine-next-cli and your machine's hostname.
- A verification URL and user code are displayed. The browser opens automatically (unless
--no-browser).
- You authorize the device in the browser by entering the user code.
- The CLI polls
POST /v1/auth/device/token at the server-specified interval.
- On success, the API key, key ID, and organization details are stored to
~/.dealmachine/config.json.
The polling handles all RFC 8628 responses: authorization_pending, slow_down (backs off by 5s), access_denied, and expired_token.
Direct API Key Login
For CI pipelines, scripts, or local development, pass an API key directly:
The key is verified against GET /v1/account before being stored. If verification fails, the CLI exits with a non-zero code.
If you do not have an API key yet, use dm signup <email> --login or dm login. Free accounts can count matches and estimate costs before paying. Public plan checkout only accepts self-serve Basic and Pro prices from the shared plan catalog and is capped at 60,000 monthly data credits.
Switching Environments
If you are already logged in, you can switch the target API environment without logging out:
Logout
Removes the config file at ~/.dealmachine/config.json.
Configuration
Credentials are stored at ~/.dealmachine/config.json with file permissions 0600 (owner read/write only). The config directory ~/.dealmachine/ is created with mode 0700.
Config File Schema
Environment Variables
The CLI checks these environment variables for API URL resolution (in priority order):
If none are set, the CLI falls back to the apiEnvironment field in the config file, then defaults to production.
API Environments
Commands
Agents Commands
dm agents
Print concise guidance for agents using the CLI. This is the recommended first command when an agent has access to dm but has not loaded the DealMachine Playbook yet.
The guide tells agents to use --json and --quiet, verify auth, fetch live filters and fields before searches, count before credit-consuming work, and confirm expected credit usage before fetching records or exporting.
dm agents guide
Print the same concise agent guidance explicitly.
dm agents playbook
Print the bundled DealMachine Playbook Markdown. Agents should load this before translating natural language property, people, contact, enrichment, list, export, comps, or credit-usage requests into CLI commands.
The public CLI source keeps its bundled Playbook at playbook/PLAYBOOK.md. The build writes the selected source to dist/agents/dealmachine-playbook.md, so the command works from a published CLI package as well as a local source checkout.
dm agents install claude-code
Install the Playbook as a native Claude Code skill. Personal scope is the default. Project scope
installs under the current repository.
dm agents permissions
Print the narrow Claude Code allowlist for free discovery and count commands. Paid and mutating
commands are not pre-approved.
Auth Commands
dm signup
Create a public API account and receive an API key. With --login, the credential is saved locally and omitted from output (including JSON); use this form from an agent:
dm plans
List live self-serve plans, included credits, features and free API access. Connected customers receive their workspace prices:
dm checkout
Preview the recurring terms using a current price ID from dm plans. After the customer approves the exact price, billing interval and quantity, add --yes to create the Stripe checkout link:
Payment is completed on Stripe. Creating checkout does not activate a plan; check dm account --json and dm usage after payment before retrying enrichment. Counts do not award credits. Free operations still require authentication and obey permissions and rate limits.
dm login
Authenticate with your DealMachine account.
dm logout
Remove stored credentials.
dm whoami
Show current authentication status.
Config Commands
dm config get [key]
Get a configuration value, or display all values when no key is given.
Available keys: organizationName, organizationSlug, organizationId, apiEnvironment, keyId, apiKey.
dm config set <key> <value>
Set a configuration value. Only apiEnvironment is editable.
dm config path
Print the absolute path to the config file.
Account Commands
dm account
Display account information including organization name, ID, creation date, and auth type.
Output:
Usage Commands
dm usage
Show credit usage for the current billing cycle.
Output:
Properties Commands
dm properties search
Search properties with filters and locations.
dm properties count
Count properties matching filters without consuming credits.
dm properties get <id>
Get a single property by its DealMachine ID.
Property lookup defaults to owners. If you only need property data, use --contact-audience none. This omits contacts and avoids people credits.
dm properties ids [ids...]
Get multiple properties by their IDs in a single batch request.
dm properties export
Export properties as CSV (up to 1,000,000 records). Returns signed download URLs.
People Commands
dm people search
Search people with filters and locations.
Non-interactive People Search returns a free estimate unless --yes is supplied. A specific person
by name uses dm enrich name, not People Search.
dm people count
Count people matching filters without consuming credits.
dm people get <id>
Get a single person by their DealMachine ID.
dm people ids [ids...]
Get multiple people by their IDs in a single batch request.
dm people export
Export people as CSV (up to 1,000,000 records). Returns signed download URLs.
Contact filter options are the same as dm properties export.
Enrich Commands
All enrichment commands support three input modes: a positional argument for single-item lookup, --body/-f for JSON payloads, and -f with a .csv file for batch enrichment from CSV. Batches larger than 250 items are automatically chunked. Every enrichment command accepts --fields <csv> and sends the selected field IDs to the API. Email, phone, and name matches also include a free property_count; use --include-properties when you need the property records themselves.
dm enrich address [address]
Look up a property by street address.
Use --contact-audience none whenever you only need the property. The response omits contacts and consumes zero people credits.
dm enrich latlng [coords]
Look up a property by latitude/longitude coordinates.
dm enrich apn [apn]
Look up a property by Assessor's Parcel Number. Narrow results with --state or --zip.
dm enrich email [email]
Look up a person by email address.
dm enrich phone [phone]
Look up a person by phone number.
dm enrich name [name]
Look up people by name. Supports "First Last" or just "Last" format.
Comps Commands
dm comps [property_ids...]
Find comparable properties (sales comps) for one or more properties.
Output includes subject property details, value estimation with confidence interval, summary statistics (average/median price, price per sqft), and a table of comparable properties.
Lists Commands
dm lists search
Search and list all saved lists.
dm lists create
Create a new list.
dm lists get <id>
Get details of a specific list including status, progress, and error state.
dm lists update <id>
Rename a list.
dm lists delete <id>
Delete a list and all its items.
dm lists build <id>
Build a list from search filters. This is an asynchronous operation -- poll with dm lists get for status.
dm lists import <id>
Import record IDs into an existing list.
dm lists items <id>
List items in a list with pagination.
dm lists add <id>
Add items to a list by ID.
dm lists remove <id>
Remove items from a list by ID.
dm lists export <id>
Export list items. Credits are charged per record.
Filters Commands
dm filters
List available search filters with their types, operators, and groupings.
Fields Commands
dm fields
List available data fields with filterable/sortable flags.
Locations Commands
Search and retrieve DealMachine locations.
dm locations autocomplete remains available as a deprecated alias for dm addresses autocomplete.
Activity Commands
dm activity search
Search past API activity with type filters and free-text search.
dm activity get <id>
Get full details of a specific activity record, including the original request, result summary, and entity IDs (people and properties).
Addresses Commands
dm addresses autocomplete <query>
Return free, bounded address and normalized location suggestions.
Autocomplete does not request fields, perform enrichment, or consume data credits.
dm addresses validate [address]
Validate and standardize addresses via USPS.
Output shows each address as valid, corrected (with corrections listed), or invalid (with reason).
Dev Commands
Local development utilities that operate directly against the Docker MySQL container (dealmachine-next-mysql). These require the local database to be running (npm run db:start from the repo root).
dm dev license add <key_id>
Add a license to an API key in the local database.
dm dev license list [key_id]
List all licenses, optionally filtered by key ID.
dm dev license remove <license_id>
Remove a license by its numeric ID.
Global Options
Every command supports these flags:
Input Methods
Commands that accept a request body support three input methods, checked in this order:
--body <json> -- Inline JSON string.
-f, --file <path> -- Read from a JSON file. Enrichment commands also accept .csv files for batch processing.
- Stdin pipe -- Read JSON from piped input (detected when stdin is not a TTY).
CSV Batch Enrichment
The enrich commands detect .csv files by extension and auto-parse them. Expected column names per command:
Batches larger than 250 items are automatically chunked with progress spinners. If an export limit is reached mid-batch, the CLI stops and returns results collected so far.
Project Structure
Key Modules
Building
The published and deployed checks are release gates. They are expected to fail before a release is
published or the documentation deployment reaches production. The scenario catalog is stored in
evals/claude-code-name-lookup.json so the same prompt variants remain visible and reviewable.
Testing
npm test never calls an API. smoke:live:coverage builds the CLI and runs the real dm binary against
the API named by DM_API_URL, authenticated with DM_API_KEY. Both are required; the key is never
printed. Each Command runs with a temporary home directory, so the smoke never reads or changes
your own dm login credentials. It runs only read-only, credit-free Commands:
Requests pass through a local relay that refuses anything outside those read-only Endpoints
(property search must carry estimate_cost: true) and confirms each request sends
X-DealMachine-Source: cli and the CLI User-Agent. The smoke prints one PASS or FAIL line per
Command and exits 0 only when every Command passes.
Standalone Binary
The compiled dist/index.js includes a #!/usr/bin/env node shebang and is declared in package.json under bin.dm. When installed globally via npm, it becomes available as dm on the PATH.
For distribution as a standalone binary without npm:
The files array in package.json ensures only dist/ is included in the published package.
TypeScript Configuration
- Target: ES2022
- Module: NodeNext (ESM)
- Strict mode enabled
- Outputs declarations, declaration maps, and source maps
- No project references (standalone compilation)
Adding New Commands
Step 1: Create the command file
Create src/commands/mycommand.ts:
Step 2: Register in index.ts
Import and wire up the command in src/index.ts:
Step 3: Build and test
Conventions
- One file per command group in
src/commands/.
- Always support
--json for machine-readable output.
- Use
ora for spinners during API calls.
- Use
chalk for colored terminal output.
- Use
apiRequest<T> from lib/client.ts for all API calls -- it handles auth, errors, and exits.
- Use
parseRequestBody from lib/output.ts when the command accepts --body, -f, or stdin input.
- Use
printHeader, printTable, printKeyValue, printCredits, printPagination for consistent output formatting.
- All imports must use the
.js extension (ESM requirement with NodeNext resolution).
Dependencies
Runtime
Dev
Internal Package Dependencies
None. This package is a fully standalone binary with zero @dealmachine/* dependencies. It communicates exclusively through the public REST API.
Used By
The Playbook at packages/playbooks/playbook/ uses dm commands to execute property intelligence workflows. The CLI is the primary interface through which the Playbook interacts with DealMachine data. Agents can load the bundled Playbook directly with dm agents playbook.
Factory staging work tracking
The factory-release-intake.yml workflow is maintained on master and reads merged PRs from staging. It reports source and, where registered, the exact staging deployment to Factory Releases, reusing Linear links or creating one configurable pilot tracking issue. Scheduled reconciliation retries missed events without duplicate issues. It does not deploy this repository, run QA or approve production.
The collector is generated from Factory. See automatic staging intake for configuration, source ownership, regeneration and recovery. Staging remains the branch being checked even though the reporting workflow lives on master.