Skip to main content
The LeadMagic CLI stores configuration in a JSON file and supports environment variable overrides.

Config File Location

The CLI checks for a project-local .leadmagic/ directory first, walking up the directory tree. If none is found, it uses the global directory at ~/.leadmagic/. Initialize a project-local directory:
Initialize the global directory:

Configuration Keys

Manage config values with lm config:

User Config Keys

These keys can be set via lm config set <key> <value>:

Internal Config Keys

These are managed automatically by the CLI:

Environment Variables

Database Configuration

The CLI uses a local embedded database for storing loaded data, query results, and metadata.
Database management commands:
lm db reset is destructive and cannot be undone. Exported files in .leadmagic/export/ are preserved.

AI Gateway Routing

The CLI routes AI chat and prompt workflows through the LeadMagic AI Gateway. Concrete model selection is managed server-side so the CLI can use the best available model for each workflow. Check AI routing:
In chat, view routing status:

Themes

The CLI supports multiple terminal themes: Set a theme:
Or switch in chat:

Export Directory

All enrichment, validation, and export results are saved to timestamped subdirectories:
Each operation creates a new timestamped directory to prevent overwriting previous results. Set a custom output directory:

Interactive Configuration

Open the full interactive configuration UI:
This provides a terminal-based interface for browsing and editing all settings. Aliases: lm config ui, lm config tui.

Next Steps

Command Reference

Commands for enrichment, local SQL, automation, and integrations.

Troubleshooting

Common issues and how to fix them.