---
title: Installation
description: Install the CUA CLI on your system
---

import { Tabs, Tab } from 'fumadocs-ui/components/tabs';
import { Callout } from 'fumadocs-ui/components/callout';

## Quick Install

The fastest way to install the CUA CLI is using our installation scripts:

<Tabs items={['macOS / Linux', 'Windows']}>
  <Tab value="macOS / Linux">
    ```bash
    curl -LsSf https://cua.ai/cli/install.sh | sh
    ```
  </Tab>
  <Tab value="Windows">
    ```powershell
    powershell -ExecutionPolicy ByPass -c "irm https://cua.ai/cli/install.ps1 | iex"
    ```
  </Tab>
</Tabs>

These scripts will automatically:
1. Install [Bun](https://bun.sh) (a fast JavaScript runtime)
2. Install the CUA CLI via `bun add -g @trycua/cli`

<Callout type="info">
  The installation scripts will automatically detect your system and install the appropriate binary to your PATH.
</Callout>

## Alternative: Install with Bun

You can also install the CLI directly using Bun:

```bash
# Install Bun if you don't have it
curl -fsSL https://bun.sh/install | bash

# Install CUA CLI
bun add -g @trycua/cli
```

<Callout type="info">
  Using Bun provides faster installation and better performance compared to npm.
  If you don't have Bun installed, the first command will install it for you.
</Callout>

## Verify Installation

After installation, verify the CLI is working:

```bash
cua --help
```

You should see the CLI help output with available commands.

## First Time Setup

After installation, you'll need to authenticate with your CUA account:

```bash
# Login with browser-based OAuth flow
cua auth login

# Or provide your API key directly
cua auth login --api-key sk-your-api-key-here
```

## Updating

To update to the latest version:

<Tabs items={['Script Install', 'npm Install']}>
  <Tab value="Script Install">
    Re-run the installation script:
    ```bash
    # macOS/Linux
    curl -LsSf https://cua.ai/cli/install.sh | sh
    
    # Windows
    powershell -ExecutionPolicy ByPass -c "irm https://cua.ai/cli/install.ps1 | iex"
    ```
  </Tab>
  <Tab value="npm Install">
    ```bash
    npm update -g @trycua/cli
    ```
  </Tab>
</Tabs>

## Uninstalling

<Tabs items={['Script Install', 'npm Install']}>
  <Tab value="Script Install">
    Remove the binary from your PATH:
    ```bash
    # macOS/Linux
    rm $(which cua)
    
    # Windows
    # Remove from your PATH or delete the executable
    ```
  </Tab>
  <Tab value="npm Install">
    ```bash
    npm uninstall -g @trycua/cli
    ```
  </Tab>
</Tabs>

## Troubleshooting

### Command Not Found

If you get a "command not found" error after installation:

1. **Check your PATH**: Make sure the installation directory is in your PATH
2. **Restart your terminal**: Close and reopen your terminal/command prompt
3. **Manual PATH setup**: Add the installation directory to your PATH manually

### Permission Issues

If you encounter permission issues during installation:

<Tabs items={['macOS / Linux', 'Windows']}>
  <Tab value="macOS / Linux">
    Try running with sudo (not recommended for the curl method):
    ```bash
    # If using npm
    sudo npm install -g @trycua/cli
    ```
  </Tab>
  <Tab value="Windows">
    Run PowerShell as Administrator:
    ```powershell
    # Right-click PowerShell and "Run as Administrator"
    powershell -ExecutionPolicy ByPass -c "irm https://cua.ai/cli/install.ps1 | iex"
    ```
  </Tab>
</Tabs>

### Network Issues

If the installation script fails due to network issues:

1. **Check your internet connection**
2. **Try the npm installation method instead**
3. **Check if your firewall is blocking the download**

## Next Steps

- [Learn about CLI commands](/libraries/cua-cli/commands)
- [Follow the quickstart guide](/get-started/quickstart#cli-quickstart)
