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

# Quickstart

> Your first enrichment workflow with the LeadMagic CLI in 5 minutes

Go from zero to enriched data in 5 minutes. This guide walks you through installing the CLI, authenticating, and running your first enrichment.

## Step-by-Step

<Steps>
  <Step title="Install the CLI">
    ```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
    curl -fsSL https://releases.leadmagic.io/install.sh | bash
    ```

    Open a new terminal after install, then verify:

    ```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
    lm --version
    ```
  </Step>

  <Step title="Sign in">
    ```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
    lm login
    ```

    `lm login` opens your browser and saves a local OAuth session for chat, enrichment, dashboard, and account-backed commands.
  </Step>

  <Step title="Verify your setup">
    ```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
    lm doctor
    ```

    You should see all checks passing. If not, run `lm doctor --fix` to auto-repair.
  </Step>

  <Step title="Scan for data files">
    ```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
    lm scan
    ```

    This scans the current directory for CSV, TSV, and Excel files. You'll see a list of files with row counts and detected columns.
  </Step>

  <Step title="Analyze a file">
    ```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
    lm analyze contacts.csv
    ```

    Get a data health report: quality score, column coverage, and enrichment recommendations. Save the report with `-o report.md`.
  </Step>

  <Step title="Start an AI chat">
    ```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
    lm chat
    ```

    This opens the interactive AI chat. Try these prompts:

    ```
    > Load contacts.csv
    > How many rows have valid emails?
    > Validate all emails in the email column
    > Find work emails for contacts missing them
    > Export the enriched data
    ```

    The AI loads your file, calls the right LeadMagic tools, and saves results to `.leadmagic/export/`.
  </Step>
</Steps>

## Alternative: Direct Commands

If you prefer commands over chat, you can enrich and validate directly:

<Tabs>
  <Tab title="Validate Emails" icon="envelope-circle-check">
    Validate specific emails:

    ```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
    lm validate alex.rivera@example.com alex.rivera@example.com sam.taylor@example.com
    ```

    Validate from a CSV file:

    ```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
    lm validate -f contacts.csv -c email
    ```
  </Tab>

  <Tab title="Find Contacts" icon="magnifying-glass">
    Find a work email:

    ```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
    lm find email -f "Alex" -l "Rivera" -d example.com
    ```

    Find a mobile number:

    ```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
    lm find mobile -f "Alex" -l "Rivera" -c "Example Robotics"
    ```
  </Tab>

  <Tab title="Batch Enrich" icon="arrows-rotate">
    Enrich an entire CSV file:

    ```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
    lm enrich -i contacts.csv
    ```

    Specify columns explicitly:

    ```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
    lm enrich -i contacts.csv \
      --email-column email \
      --first-name-column first_name \
      --last-name-column last_name \
      --domain-column company_domain
    ```
  </Tab>
</Tabs>

## What Happens to Your Data

* **Local storage:** CSV/Excel files are loaded into a local database in `~/.leadmagic/` (or project-local `.leadmagic/`).
* **Exports:** Enriched results are saved to `.leadmagic/export/{timestamp}-{operation}/` with timestamped directories.
* **Privacy:** Only the specific fields needed for enrichment (emails, names, domains) are sent to the LeadMagic API. Your full dataset stays local.

## Check Your Credits

See your account balance and usage:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
lm dashboard
```

Or ask in chat: *"How many credits do I have?"*

## Next Steps

<CardGroup cols={2}>
  <Card title="Command Reference" icon="book" href="/docs/cli/commands">
    Commands for enrichment, local SQL, recipes, schedules, watch mode, and outbound integrations.
  </Card>

  <Card title="AI Chat Guide" icon="message" href="/docs/cli/chat">
    Slash commands, sessions, and natural language workflows.
  </Card>

  <Card title="Configuration" icon="sliders" href="/docs/cli/configuration">
    Database, model, and theme settings.
  </Card>

  <Card title="Credits & Pricing" icon="coins" href="/docs/v1/credits">
    Credit costs per service and plan options.
  </Card>
</CardGroup>
