~/.dealmachine/config.json. This file is created during dm login and contains your credentials and preferences.~/.dealmachine/config.json0600 (owner-only read/write)12345678{ "apiKey": "dm_sk_live_xxx", "keyId": "key_abc123def456", "organizationId": 1, "organizationName": "My Company", "organizationSlug": "my-company", "apiEnvironment": "production" }
| Key | Type | Editable | Description |
apiKey | string | No | Your API key (set during login) |
keyId | string | No | API key identifier |
organizationId | number | No | Internal organization ID |
organizationName | string | No | Organization display name |
organizationSlug | string | No | Organization URL slug |
apiEnvironment | string | Yes | API target: local, staging, or production |
12345678# Target local API server (http://localhost:3001) dm config set apiEnvironment local # Target staging (https://api-staging.v2.dealmachine.com) dm config set apiEnvironment staging # Target production (https://api.v2.dealmachine.com) dm config set apiEnvironment production
| Variable | Priority | Description |
DM_API_URL | Highest | Full API base URL |
DM_ENV | Medium | local, staging, or production |
Config apiEnvironment | Low | Stored preference |
| Default | Lowest | production |
12345678# One-off local request DM_ENV=local dm account # One-off staging request DM_ENV=staging dm account # Point to custom server DM_API_URL=https://api-staging.v2.dealmachine.com/v1 dm account
DEALMACHINE_API_URL and DEALMACHINE_ENVIRONMENT also work.| Environment | URL |
local | http://localhost:3001/v1 |
staging | https://api-staging.v2.dealmachine.com/v1 |
production | https://api.v2.dealmachine.com/v1 |
12345# 1. Set up the database (if you haven't already) npm run db:setup # 2. Set up the CLI (generates API key, builds, links `dm`, auto-logs in) npm run dm:setup
1npm run api:dev
dm:setup does not start or manage MySQL — it assumes you've already run npm run db:setup. It only generates an API key, builds the CLI, links it globally, and logs you in against localhost:3001.1npm update -g dealmachine
1npm uninstall -g dealmachine