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

# Quickstart: install the infraudit CLI and scan

> Install the infraudit CLI, authenticate against your InfraAudit account, connect a cloud provider, and run your first drift scan from the terminal.

You can do everything InfraAudit offers — connecting providers, triggering scans, reviewing findings, approving remediations — without leaving your terminal. This guide gets you from a fresh install to a completed drift scan in under five minutes. You'll need your AWS credentials handy.

## Install the CLI

<Tabs>
  <Tab title="macOS (Homebrew)">
    ```bash theme={null}
    brew install pratik-mahalle/tap/infraudit
    ```
  </Tab>

  <Tab title="Linux">
    ```bash theme={null}
    curl -sSL https://infraaudit.dev/install.sh | bash
    ```

    The script installs the binary to `/usr/local/bin/infraudit`.
  </Tab>

  <Tab title="Build from source">
    ```bash theme={null}
    git clone https://github.com/pratik-mahalle/infraudit-go.git
    cd infraudit-go
    go build -o infraudit ./cmd/cli
    sudo mv infraudit /usr/local/bin/
    ```
  </Tab>
</Tabs>

Verify the install:

```bash theme={null}
infraudit version
```

## Point the CLI at your server

<Tabs>
  <Tab title="SaaS">
    ```bash theme={null}
    infraudit config init
    # Server URL: https://api.infraaudit.dev
    ```
  </Tab>

  <Tab title="Self-hosted">
    ```bash theme={null}
    infraudit config init
    # Server URL: http://localhost:8080
    ```
  </Tab>
</Tabs>

## Log in

```bash theme={null}
infraudit auth login
# Email: user@example.com
# Password: ••••••••
```

The CLI stores your session token in `~/.infraudit/config.yaml`. Subsequent commands use it automatically — you won't need to log in again until the token expires.

To confirm who you're logged in as:

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

## Connect a cloud account

```bash theme={null}
infraudit provider connect aws
# AWS Access Key ID: AKIA...
# AWS Secret Access Key: ••••••••
# Default region [us-east-1]: us-east-1
# Display name [AWS]: Production
```

Wait for the initial sync to complete before running scans. Check the status with:

```bash theme={null}
infraudit provider list
# ID  NAME        TYPE  STATUS  RESOURCES
# 1   Production  aws   synced  247
```

The provider is ready when **STATUS** shows `synced`.

## Run a drift scan

```bash theme={null}
infraudit drift detect
# Drift detection triggered. Job ID: 42
# Waiting for results...
# Found 3 drifts (1 high, 2 medium)
```

View all findings:

```bash theme={null}
infraudit drift list
```

Filter by severity to focus on the most important items first:

```bash theme={null}
infraudit drift list --severity high
```

Inspect a specific finding:

```bash theme={null}
infraudit drift get 1
```

## What to do next

```bash theme={null}
# Run a vulnerability scan
infraudit vuln scan

# Enable the CIS AWS Benchmark and run an assessment
infraudit compliance enable cis-aws
infraudit compliance assess

# Check your cost overview
infraudit cost overview

# Sync billing data immediately
infraudit cost sync

# View AI-powered recommendations
infraudit recommendation list
```

For the full list of commands and flags, see the [CLI command reference](/cli/commands/overview) or run:

```bash theme={null}
infraudit --help
```
