Skip to main content
The AI chat is the primary interface of the LeadMagic CLI. Describe the outcome you want and the CLI can load files, inspect columns, clean records, call LeadMagic enrichment tools, query the local database, and export the results.
lm chat
Running lm with no arguments also starts chat — it’s the default command.

How It Works

When you type a message, the AI:
  1. Interprets your intent — understands whether you want cleaning, enrichment, research, SQL, export, or troubleshooting
  2. Selects tools — picks the right file, database, LeadMagic, recipe, schedule, or outbound action
  3. Executes the workflow — runs steps in order, asks before spending credits, and stores results locally
  4. Streams progress — shows tool calls, progress, and results as the work runs

Example Conversations

You: Load contacts.csv and show me a summary
AI:  Loaded 1,247 rows with columns: name, email, company, title...

You: Find work emails for contacts that are missing them
AI:  Found 342 contacts without emails. I'll use the email finder...
     [Processing: ████████░░ 85/342 — 1 credit each]
     Found 298 emails. 44 contacts had insufficient data.

You: Export the results
AI:  Saved to .leadmagic/export/20260306-email-finder/contacts_enriched.csv
You: Validate all emails in campaign-list.csv
AI:  Loaded 5,000 emails from column "email"...
     [Validating: ████████████ 5000/5000 — 0.25 credits each]
     Results: 4,102 valid, 612 invalid, 286 unknown

You: Remove the invalid ones and export
AI:  Removed 612 invalid emails. Exported 4,388 contacts to
     .leadmagic/export/20260306-validation/campaign-list_validated.csv
You: What can you tell me about example.com?
AI:  Company: Example Robotics, Inc.
     Industry: Financial Technology
     Employees: 8,000+
     HQ: San Francisco, CA
     ...

You: What's their tech stack?
AI:  Looking up company technographics...
     React, Node.js, Ruby, Go, AWS, PostgreSQL...

You: Who are their main competitors?
AI:  Searching for competitor companies...
     Adyen, Square, PayPal, Braintree, Checkout.com...
You: I get this same leads.csv every Monday. Make a repeatable cleanup and enrichment flow.
AI:  I can turn this into a recipe: normalize names, validate emails,
     find missing work emails, and export eligible contacts.

You: Estimate the cost on this file before running it.
AI:  Estimated 1,247 rows. Validation + email discovery will cost up to...

You: Schedule it every weekday at 9am.
AI:  Created schedule. Start the scheduler with lm schedule daemon.
You: Which companies in my table have the most valid contacts?
AI:  Running SQL against the local database...
     SELECT company, COUNT(*) ...

You: Show only accounts with funding data and at least 3 contacts.
AI:  Here are the matching accounts. I can export this segment or push it.

Slash Commands

Type / followed by a command name for quick actions. Type /help to see all available commands.
CommandDescription
/browseBrowse files in a directory
/findFind CSV or XLSX files
/filesShow files in current directory
/outputSet output directory for exports
/cleanOpen cleaning operation picker
/mergeMerge CSV or Excel files

Local Context

The chat has access to your local LeadMagic workspace:
  • Imported CSV and Excel tables
  • Query results and visible table columns
  • Chat sessions and exported transcripts
  • Recipe definitions and schedule history
  • Outbound push history
  • Account status, credits, and pricing
Use @ to reference a file and /table or /columns to inspect the current data view.

AI Routing

The CLI routes AI requests through the LeadMagic AI Gateway. Check routing status with:
lm status
lm config show
Inside chat, use:
/model
This shows the current AI routing status.

Session Management

Chat sessions are automatically saved and can be resumed later.
ActionHow
List sessions/sessions
Start fresh/clear
Export history/export
Sessions are stored in the local database and persist across CLI restarts.

Keyboard Shortcuts

ShortcutAction
EnterSend message / execute command
↑ / ↓Recall previous commands
TabAutocomplete commands
EscapeClear input
Ctrl+CExit application
Ctrl+LClear screen
Ctrl+KOpen command palette
/Start a slash command
@Reference a file

Next Steps

Command Reference

All commands for non-chat workflows.

Configuration

Database, model, and theme settings.