The LeadMagic CLI uses browser OAuth for chat, enrichment, validation, credits, and account-backed features. Your session is stored locally and refreshed when possible.
The recommended way to authenticate is the browser-based OAuth flow:
lm login
This opens your browser to sign in to LeadMagic. After authentication, your session is saved locally. You can skip the browser confirmation prompt with -y:
lm login -y
lm login also accepts the aliases lm auth, lm signin, and lm sign-in.
Authentication state is stored in the config file:
Global:~/.leadmagic/config.json
Project-local:.leadmagic/config.json (when run inside a project directory)
The CLI uses project-local config when a .leadmagic/ directory exists in the current or parent directory. Otherwise it falls back to the global config.
Keep authentication files secret. Never commit config.json to version control. The .leadmagic/ directory should be in your .gitignore.
This removes the stored auth token while preserving non-auth configuration such as database, theme, and integration settings. Aliases: lm signout, lm sign-out.