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

# Installation

> Install the LeadMagic CLI on macOS, Linux, or Windows

Install the LeadMagic CLI in one command. The installer downloads a self-contained binary with a bundled runtime — no additional dependencies required.

## Install

<Tabs>
  <Tab title="macOS / Linux" icon="apple">
    ```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
    curl -fsSL https://releases.leadmagic.io/install.sh | bash
    ```

    The installer:

    * Downloads the correct binary for your platform and architecture
    * Installs to `~/.leadmagic/bin/lm`
    * Adds `~/.leadmagic/bin` to your `PATH` (updates your shell profile)
    * Runs `lm welcome` to confirm the install

    <Tip>
      Open a new terminal or run `source ~/.zshrc` (or `~/.bashrc`) after install for the `PATH` update to take effect.
    </Tip>
  </Tab>

  <Tab title="Windows" icon="windows">
    ```powershell theme={"theme":{"light":"github-light","dark":"github-dark"}}
    irm https://releases.leadmagic.io/install.ps1 | iex
    ```

    The installer downloads the binary and adds it to your `PATH`.

    <Warning>
      Windows support is experimental. The installer downloads the Linux binary and rebuilds native modules locally, which requires additional tooling.
    </Warning>
  </Tab>

  <Tab title="Direct Download" icon="file-arrow-down">
    Download a tarball directly from the releases server:

    ```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
    # Latest version
    curl -O https://releases.leadmagic.io/latest/lm-darwin-arm64.tar.gz

    # Specific version
    curl -O https://releases.leadmagic.io/v2.1.16/lm-v2.1.16-darwin-arm64.tar.gz
    ```

    Extract and move to your `PATH`:

    ```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
    tar -xzf lm-darwin-arm64.tar.gz
    mv lm ~/.leadmagic/bin/lm
    chmod +x ~/.leadmagic/bin/lm
    ```

    **Checksums** are available for verification:

    ```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
    curl -O https://releases.leadmagic.io/latest/checksums.txt
    sha256sum -c checksums.txt
    ```
  </Tab>
</Tabs>

## Platform Support

| Platform | Architecture          | Status       |
| -------- | --------------------- | ------------ |
| macOS    | Apple Silicon (arm64) | Supported    |
| macOS    | Intel (x64)           | Supported    |
| Linux    | x64                   | Supported    |
| Linux    | arm64                 | Supported    |
| Windows  | x64                   | Experimental |

## Version Pinning

Install a specific version by setting the `VERSION` environment variable:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
VERSION=2.1.16 curl -fsSL https://releases.leadmagic.io/install.sh | bash
```

Change the install directory with `LEADMAGIC_INSTALL_DIR`:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
LEADMAGIC_INSTALL_DIR=/opt/leadmagic curl -fsSL https://releases.leadmagic.io/install.sh | bash
```

## Verify Installation

Run the health check to confirm everything is working:

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

If issues are found, auto-repair with:

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

Use `--verbose` for detailed diagnostic output:

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

## Shell Completions

Enable tab completions for your shell:

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

Supports bash, zsh, and fish. The shell is auto-detected, or specify it explicitly:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
lm completions install --shell zsh
```

Remove completions with:

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

## Update

The CLI checks for updates automatically and shows a one-line notice when a newer version is available.

To update manually:

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

To check for updates without installing:

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

## Uninstall

Remove the CLI and all associated files:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl -fsSL https://releases.leadmagic.io/install.sh | bash -s -- --uninstall
```

This removes the binary and the `~/.leadmagic/bin` directory. Your data (config, database, exports) in `~/.leadmagic/` is preserved. Delete that directory manually if you want a complete removal.

## Next Steps

<CardGroup cols={2}>
  <Card title="Authentication" icon="key" href="/docs/cli/authentication">
    Sign in with browser OAuth.
  </Card>

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