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

# Install the CLI

> Install the MergeGuide command-line interface from PyPI and verify it.

The MergeGuide CLI is the Python package `mergeguide`. It installs a single
`mergeguide` executable and is the foundation for local checks, git hooks, and
CI integration.

<Note>
  **Requires Python 3.11 or newer.** Check with `python --version`.
</Note>

## Install

<Tabs>
  <Tab title="pip">
    ```bash theme={null}
    pip install mergeguide
    ```
  </Tab>

  <Tab title="pipx (isolated)">
    ```bash theme={null}
    pipx install mergeguide
    ```

    `pipx` installs the CLI in its own isolated environment, which avoids
    dependency conflicts with your other Python tools.
  </Tab>
</Tabs>

## Verify

```bash theme={null}
mergeguide --version
```

Then run the built-in diagnostics to confirm your environment and connectivity:

```bash theme={null}
mergeguide doctor
```

## Set up everything at once

Rather than installing each piece by hand, `mergeguide init` wires up the whole
local toolchain — config, dashboard authentication, the MCP server (installed via
`npx`), and git hooks — in one idempotent command:

```bash theme={null}
mergeguide init --api-key mg_xxxxxxxxxxxxxxxx
```

See the [Quickstart](/get-started/quickstart) for the full first-run flow.

## Authenticate

If you set things up manually, authenticate against the dashboard:

```bash theme={null}
mergeguide login --api-key mg_xxxxxxxxxxxxxxxx
```

Run `mergeguide login` with no flags to authenticate interactively, then confirm:

```bash theme={null}
mergeguide auth whoami
```

## Troubleshooting

<AccordionGroup>
  <Accordion title="Permission errors during install">
    Install into an isolated environment with `pipx install mergeguide`, or use
    the per-user flag:

    ```bash theme={null}
    pip install --user mergeguide
    ```
  </Accordion>

  <Accordion title="SSL or certificate errors behind a proxy">
    Point Python at your corporate CA bundle:

    ```bash theme={null}
    export REQUESTS_CA_BUNDLE=/path/to/certificate.pem
    ```
  </Accordion>

  <Accordion title="Which mergeguide am I running?">
    ```bash theme={null}
    which mergeguide
    pip show mergeguide
    mergeguide --version
    ```
  </Accordion>
</AccordionGroup>

## Next steps

<CardGroup cols={2}>
  <Card title="Install the MCP server" icon="robot" href="/install/mcp-server">
    Bring governance into your AI coding assistant.
  </Card>

  <Card title="Install git hooks" icon="code-commit" href="/install/git-hooks">
    Check staged changes before they leave your machine.
  </Card>

  <Card title="CLI reference" icon="terminal" href="/reference/cli">
    Every command and flag.
  </Card>

  <Card title="Run your first check" icon="rocket" href="/get-started/quickstart">
    Go from install to first finding.
  </Card>
</CardGroup>
