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

# Installing the InfraAudit CLI on macOS, Linux, Windows

> Install the infraudit CLI from source or with go install on macOS, Linux, or Windows, then verify the binary and run first-time setup.

The `infraudit` CLI is a single static Go binary with no runtime dependencies. You can build it from source or pull it directly with `go install` if you already have a Go toolchain.

## Prerequisites

* Go 1.24 or newer — [download at go.dev](https://go.dev/dl/)
* Git (required for the from-source method)

## Installation

<Tabs>
  <Tab title="go install">
    Pull and build the latest CLI in one step:

    ```bash theme={null}
    go install github.com/pratik-mahalle/infraudit/cmd/cli@latest
    ```

    The binary lands in `$GOPATH/bin/` (typically `$HOME/go/bin/`). Make sure that directory is in your `PATH`:

    <CodeGroup>
      ```bash bash / zsh theme={null}
      echo 'export PATH="$HOME/go/bin:$PATH"' >> ~/.bashrc
      source ~/.bashrc
      ```

      ```bash zsh theme={null}
      echo 'export PATH="$HOME/go/bin:$PATH"' >> ~/.zshrc
      source ~/.zshrc
      ```
    </CodeGroup>
  </Tab>

  <Tab title="Build from source">
    Clone the repository and build the binary:

    ```bash theme={null}
    git clone https://github.com/pratik-mahalle/infraudit-go.git
    cd infraudit-go
    make build-cli
    ```

    The binary lands at `./bin/infraudit`. Move it somewhere on your `PATH`:

    ```bash theme={null}
    sudo mv ./bin/infraudit /usr/local/bin/
    ```
  </Tab>
</Tabs>

## Verify the installation

Run the following command to confirm the binary is available:

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

You should see the top-level command list. If you get `command not found`, the install directory is not in your `PATH`. Fix it using the instructions in the tab above that matches your installation method.

<Note>
  The `version` subcommand is available as `infraudit version` to print the exact build version once a server connection is configured.
</Note>

## First-time setup

<Steps>
  <Step title="Initialize the config file">
    Run the interactive setup wizard to set your server URL and default output format:

    ```bash theme={null}
    infraudit config init
    # > Enter server URL: https://api.infraudit.dev
    # > Default output format: table
    ```
  </Step>

  <Step title="Log in">
    Authenticate with your InfraAudit account:

    ```bash theme={null}
    infraudit auth login
    # > Email: you@example.com
    # > Password: ********
    # > Logged in as you@example.com
    ```
  </Step>

  <Step title="Verify connectivity">
    Check that the CLI can reach the server:

    ```bash theme={null}
    infraudit status
    ```
  </Step>
</Steps>

## Shell completion

Tab completion is available for bash, zsh, fish, and PowerShell. See [Shell completion](/cli/shell-completion) for setup instructions.

## Uninstall

Remove the binary and config directory:

```bash theme={null}
rm $(which infraudit)
rm -rf ~/.infraudit
```
