> ## Documentation Index
> Fetch the complete documentation index at: https://jonathansantilli-codegate-92.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Install CodeGate and run your first scan in under two minutes.

CodeGate is distributed as an npm package (`codegate-ai`). You can run it without a global install or install it globally for regular use.

<Steps>
  <Step title="Install CodeGate">
    <Tip>
      You can run CodeGate without installing it globally using `npx`. If you plan to use it regularly, a global install is more convenient.
    </Tip>

    <CodeGroup>
      ```bash npx (no install required) theme={null}
      npx codegate-ai scan .
      ```

      ```bash Global install theme={null}
      npm install -g codegate-ai
      ```
    </CodeGroup>

    After a global install, the `codegate` command is available everywhere.
  </Step>

  <Step title="Initialize your config">
    ```bash theme={null}
    codegate init
    ```

    This creates `~/.codegate/config.json` with default settings, giving you an explicit starting point to tune behavior — severity thresholds, output format, user-scope scanning, and tool discovery preferences.

    <Tip>
      `codegate init` is optional. If you skip it, CodeGate works with built-in defaults and nothing breaks. Running it is recommended so your configuration is explicit and easy to adjust later.
    </Tip>
  </Step>

  <Step title="Run your first scan">
    From inside any project directory:

    ```bash theme={null}
    codegate scan .
    ```

    CodeGate walks the directory, discovers AI tool configuration files, and evaluates them with the static rule engine. Findings are printed to the terminal with severity levels and remediation guidance.

    To export results as JSON or SARIF instead:

    ```bash theme={null}
    codegate scan . --format json
    codegate scan . --format sarif --output codegate.sarif
    ```
  </Step>

  <Step title="Use wrapper mode">
    Instead of scanning and launching separately, use `codegate run` to scan first and only launch your AI tool if the policy allows it:

    ```bash theme={null}
    codegate run claude
    ```

    Valid targets are `claude`, `codex`, `opencode`, `cursor`, `windsurf`, and `kiro`.

    If CodeGate finds dangerous findings at or above your configured severity threshold, tool launch is blocked. If files change between the scan and the launch check, launch is also blocked and a rescan is required.

    ```bash theme={null}
    # Launch Codex after a clean scan
    codegate run codex

    # Skip the warning-level confirmation prompt
    codegate run claude --force
    ```
  </Step>
</Steps>

## Next steps

<CardGroup cols={2}>
  <Card title="Introduction" icon="book" href="/introduction">
    Learn what CodeGate is, what it scans, and what it does not guarantee.
  </Card>

  <Card title="scan command reference" icon="magnifying-glass" href="/commands/scan">
    Full list of scan flags, collection modes, and persona options.
  </Card>

  <Card title="Configuration" icon="gear" href="/configuration/overview">
    Tune severity thresholds, suppression rules, and trusted directories.
  </Card>

  <Card title="CI integration" icon="circle-check" href="/integrations/ci-github-actions">
    Upload SARIF results to GitHub Code Scanning.
  </Card>
</CardGroup>
