> ## 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 <Badge color="purple">Beta</Badge>

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).
</Warning>

<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](/docs/cli/installation) for all platforms.
</Note>

## Key Features

<CardGroup cols={2}>
  <Card title="AI Data Chat" icon="message">
    Ask for outcomes in plain English: load files, clean rows, enrich contacts, query tables, and export results.
  </Card>

  <Card title="28+ Commands" icon="terminal">
    Direct commands for enrichment, research, recipes, schedules, watch folders, database health, outbound pushes, and more.
  </Card>

  <Card title="Powerful Local Database" icon="database">
    Files load into a local analytics database so you can run SQL, inspect tables, track runs, and keep an audit trail.
  </Card>

  <Card title="Automation Built In" icon="clock">
    Create YAML recipes, schedule them on cron or intervals, or watch an inbound folder and auto-process new files.
  </Card>
</CardGroup>

## What You Can Do

<Tabs>
  <Tab title="Chat With Data" icon="message">
    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>

  <Tab title="Analyze Locally" icon="database">
    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>

  <Tab title="Enrich & Research" icon="magnifying-glass">
    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>

  <Tab title="Automate Workflows" icon="clock">
    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>

  <Tab title="Ship To Outbound" icon="paper-plane">
    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>
    ```
  </Tab>
</Tabs>

## 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

<CardGroup cols={2}>
  <Card title="Installation" icon="download" href="/docs/cli/installation">
    Install on macOS, Linux, or Windows in one command.
  </Card>

  <Card title="Quickstart" icon="bolt" href="/docs/cli/quickstart">
    Your first enrichment workflow in 5 minutes.
  </Card>

  <Card title="Command Reference" icon="book" href="/docs/cli/commands">
    All major commands, subcommands, and examples.
  </Card>

  <Card title="AI Chat Guide" icon="message" href="/docs/cli/chat">
    Natural language chat, slash commands, and session management.
  </Card>
</CardGroup>
