LeadMagic CLI Authentication
Sign in to LeadMagic CLI securely. The lm login session powers interactive work, enrichment, validation, credits, and connected services.
LeadMagic CLI uses secure browser sign-in. Run lm login once, then the CLI commands and interactive workspace use that session for enrichment, chat, validation, credits, and connected services. Do not paste a LeadMagic API key into LeadMagic CLI for normal use.
Sign In
This opens your browser for OAuth sign-in. After you authenticate, the CLI stores a Bearer session locally. Skip the confirmation prompt with:
Verify you're connected:
If the session expired, run lm login again. Token refresh is attempted automatically; a failed refresh needs a fresh login.
How Auth Works
| Surface | Auth |
|---|---|
| CLI enrich / validate / find | OAuth session → short-lived assertion |
AI Chat (lm chat) | Same OAuth session via ai.leadmagic.io |
| Hosted MCP | OAuth Bearer: see MCP setup |
| Instantly / Smartlead / EmailBison | Separate third-party keys via lm config set |
| HubSpot / Salesforce | Secure browser connection via lm integrations … connect |
Scoped LeadMagic API keys for programmatic/API use are managed separately with lm keys: they are not required for interactive LeadMagic CLI usage.
Config File
Session tokens live in:
- Global:
~/.leadmagic/config.json - Project-local:
.leadmagic/config.json(when a.leadmagic/directory exists in the current or parent tree)
What Requires Login
| Feature | Login required |
|---|---|
AI Chat (lm chat) | Yes |
Enrichment (lm enrich) | Yes |
Email validation (lm validate) | Yes |
Contact finding (lm find) | Yes |
| Recipes with paid steps | Yes |
| Credits / dashboard / whoami | Yes |
| File scan / analyze | No |
Local SQL (lm query) | No |
Health check (lm doctor) | No (auth is one of the checks) |
Sign Out
Clears the stored OAuth session. Aliases: lm signout, lm sign-out.
Next Steps
Was this page helpful?
We value your feedback.