> ## Documentation Index
> Fetch the complete documentation index at: https://leadmagic.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# LeadMagic CLI

> AI-powered command line workspace for B2B enrichment, local analytics, automation, and outbound handoff

# LeadMagic CLI Beta

The LeadMagic CLI turns your terminal into a B2B data workspace. Load CSV or Excel files, chat with your data, validate emails, find contacts, enrich companies, run local SQL, automate recurring workflows, monitor job changes, and push clean records into outbound platforms.

> [!WARNING]
>
> **Beta** — The CLI is fully functional but still in beta. Commands, flags, and behavior may change. We'd love your feedback — reach out at [support@leadmagic.io](mailto:support@leadmagic.io) or via the [Help Center](https://help.leadmagic.io/en).

> [!NOTE]
>
> **One-line install:**
>
> ```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
> curl -fsSL https://releases.leadmagic.io/install.sh | bash
> ```
>
> See the full [installation guide](https://leadmagic.io/docs/cli/installation.md) for all platforms.

## Key Features

> [card] AI Data Chat
>
> Ask for outcomes in plain English: load files, clean rows, enrich contacts, query tables, and export results.

> [card] 28+ Commands
>
> Direct commands for enrichment, research, recipes, schedules, watch folders, database health, outbound pushes, and more.

> [card] Powerful Local Database
>
> Files load into a local analytics database so you can run SQL, inspect tables, track runs, and keep an audit trail.

> [card] Automation Built In
>
> Create YAML recipes, schedule them on cron or intervals, or watch an inbound folder and auto-process new files.

## What You Can Do

> [tab] Chat With Data
>
> Start an AI chat and describe what you need in plain English:
>
> ```
> > Load contacts.csv and find work emails for everyone
> > Validate all the emails in column B
> > Enrich the companies with funding, competitors, jobs, and tech stacks
> > Which rows are missing the fields we need for mobile lookup?
> > Export the results to a new CSV
> ```
>
> The AI coordinates file loading, column detection, LeadMagic API calls, SQL queries, and exports.

> [tab] Analyze Locally
>
> Scan, profile, and query files before spending credits:
>
> ```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
> lm scan ./exports
> lm analyze contacts.csv
> lm query sql "SELECT domain, COUNT(*) FROM contacts GROUP BY domain"
> lm db stats
> lm db health
> ```
>
> The CLI keeps your source data, enrichment results, chat sessions, schedules, and run history in a local database under `.leadmagic/` or `~/.leadmagic/`.

> [tab] Enrich & Research
>
> Use direct commands when you already know the lookup you want:
>
> ```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
> lm validate -f contacts.csv -c email
> lm find email -f "Alex" -l "Rivera" -d example.com
> lm find mobile -p https://linkedin.com/in/morgan-lee
> lm research competitors -d example.com
> lm research funding -d example.org
> lm find jobs -c Example Robotics --level senior --remote
> ```

> [tab] Automate Workflows
>
> Turn repeatable enrichment work into recipes, schedules, and folder watchers:
>
> ```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
> lm recipe list
> lm recipe estimate outbound-cleanup -i leads.csv
> lm recipe run outbound-cleanup -i leads.csv
> lm schedule create --recipe outbound-cleanup -i leads.csv --every daily
> lm watch setup
> lm watch start
> ```

> [tab] Ship To Outbound
>
> Push clean, eligible records into outbound tools after enrichment:
>
> ```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
> lm integrations instantly campaigns
> lm integrations instantly push --campaign <id>
> lm integrations emailbison push --campaign <id>
> lm integrations smartlead stats <campaign-id>
> ```

## Why It Is Powerful

The CLI is not just a wrapper around API calls. It gives you a local data layer, an AI chat interface, and a job runner in one place:

* **Local analytics** - query your imported files and enrichment output with SQL.
* **Credit-aware workflows** - estimate costs, check credits, and plan recipe spend before bulk runs.
* **Repeatability** - save multi-step enrichment logic as recipes and run it on demand, on a schedule, or when files appear in a folder.
* **Operational history** - inspect database health, job-change run history, schedule runs, and outbound push history.
* **AI plus exact commands** - chat when you want guidance; use direct commands when you want deterministic scripts.

Data is stored locally in a database at `~/.leadmagic/` or project-local `.leadmagic/`. Your files stay on your machine unless you choose to submit fields for LeadMagic enrichment.

## Get Started

> [card] [Installation](https://leadmagic.io/docs/cli/installation.md)
>
> Install on macOS, Linux, or Windows in one command.

> [card] [Quickstart](https://leadmagic.io/docs/cli/quickstart.md)
>
> Your first enrichment workflow in 5 minutes.

> [card] [Command Reference](https://leadmagic.io/docs/cli/commands.md)
>
> All major commands, subcommands, and examples.

> [card] [AI Chat Guide](https://leadmagic.io/docs/cli/chat.md)
>
> Natural language chat, slash commands, and session management.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.