Skip to main content

Authentication

The CLI uses the OAuth device authorization flow (RFC 8628) — the same pattern used by the GitHub CLI. No passwords are entered in the terminal.

How the Device Flow Works

Direct API Key Login

If you already have an API key (e.g., for CI/CD or scripts), skip the browser flow:
This verifies the key against the API and saves it locally. If you do not have an API key yet, use the public API onboarding flow first:
  1. dm signup developer@example.com --login creates the account, returns an API key, and stores it locally. Add --phone-number +15551234567 if the API environment requires phone numbers.
  2. dm plans lists public self-serve Basic and Pro plan prices.
  3. dm checkout --price-id price_xxx_monthly creates a Stripe checkout session with that API key.
You can also call POST /v1/signup, GET /v1/plans, and POST /v1/checkout directly.

Logout

Removes stored credentials from ~/.dealmachine/config.json.

Check Auth Status

Use --verify to test your key against the server:

Credential Storage

Credentials are stored at:
The file has 0600 permissions (owner-only read/write) and contains:
Never share your config.json file or commit it to version control. The API key provides full access to your organization’s data.

Revoking Access

To revoke a CLI key:
  1. Go to Developer Settings
  2. Find the key (named “CLI” or the device name)
  3. Click Revoke
After revoking, run dm logout to clean up local credentials, then dm login to re-authenticate.

Troubleshooting

Use the --no-browser flag and manually visit the URL:
Device codes expire after 30 days. Run dm login again to get a fresh code.
Run dm logout first, then dm login again. Make sure you select the correct organization in the browser.
Your key may have been revoked. Run:
If it fails, run dm logout && dm login to re-authenticate.