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

# Installation

> Install the AUI Agent Builder CLI and authenticate with your account.

## System Requirements

* **Node.js** 18 or later
* **npm** (included with Node.js)
* **Git** (used for change detection in `aui push` and `aui diff`)

## Install

```bash theme={null}
npm install -g aui-agent-builder
```

Verify the installation:

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

## Authentication

AUI supports three authentication methods:

<Tabs>
  <Tab title="Browser (Default)">
    Opens the AUI playground login page. Your token is received automatically via a local callback.

    ```bash theme={null}
    aui login
    ```

    The CLI will open your browser. Sign in, and you'll be redirected back automatically.
  </Tab>

  <Tab title="Email + OTP">
    Enter your email, then paste the verification code sent to your inbox.

    ```bash theme={null}
    aui login --email user@example.com
    ```
  </Tab>

  <Tab title="Access Token">
    Paste a JWT directly — useful for CI/CD or when copying from browser DevTools.

    ```bash theme={null}
    aui login --token <jwt>
    ```
  </Tab>

  <Tab title="API Key">
    Authenticate with an API key and account ID.

    ```bash theme={null}
    aui login --api-key <key> --account-id <id>
    ```
  </Tab>
</Tabs>

After authenticating, the CLI walks you through selecting your **Organization**, **Account**, and **Agent**.

<Info>
  Session credentials are stored in `~/.aui/session.json`. They persist across terminal sessions.
</Info>

## Post-Login Setup

<Steps>
  <Step title="Verify your session">
    ```bash theme={null}
    aui status
    ```

    You should see your account info, active agent, and current environment.
  </Step>

  <Step title="Set your environment">
    ```bash theme={null}
    aui env staging      # Development and testing
    aui env production   # Live environment
    aui env custom       # Custom environment
    ```

    The active environment is stored in `~/.aui/environment`.
  </Step>

  <Step title="Import or create an agent">
    ```bash theme={null}
    # Import an existing agent
    aui import-agent

    # Or scaffold a new one
    aui create-agent ./my-agent
    ```
  </Step>
</Steps>

## Uninstall

```bash theme={null}
npm uninstall -g aui-agent-builder
```

To remove stored credentials and session data:

```bash theme={null}
rm -rf ~/.aui
```

<Warning>
  This removes all stored sessions, API keys, and cached schemas. You'll need to run `aui login` again.
</Warning>

## Next Steps

<CardGroup cols={2}>
  <Card title="Command Reference" icon="terminal" href="/cli/commands">
    Full reference for all CLI commands.
  </Card>

  <Card title="Configuration" icon="gear" href="/cli/configuration">
    Project structure, config files, and environment variables.
  </Card>
</CardGroup>
