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

# Installation

> Install the Superflag CLI for command-line flag management

# CLI Installation

The `@superflag-sh/cli` package provides a command-line interface for managing Superflag feature flags, apps, and environments.

## Requirements

* Node.js 18+ or Bun
* Internet connection for authentication

## Installation

<CodeGroup>
  ```bash npm theme={null}
  npm install -g @superflag-sh/cli
  ```

  ```bash yarn theme={null}
  yarn global add @superflag-sh/cli
  ```

  ```bash pnpm theme={null}
  pnpm add -g @superflag-sh/cli
  ```

  ```bash bun theme={null}
  bun install -g @superflag-sh/cli
  ```

  ```bash npx theme={null}
  # No installation needed - use npx
  npx @superflag-sh/cli <command>
  ```
</CodeGroup>

## Verify Installation

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

## First Time Setup

After installing, authenticate with your Superflag account:

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

This will open your browser for authentication. See [Authentication](/cli/authentication) for details.

## Updating

To update to the latest version:

<CodeGroup>
  ```bash npm theme={null}
  npm update -g @superflag-sh/cli
  ```

  ```bash yarn theme={null}
  yarn global upgrade @superflag-sh/cli
  ```

  ```bash pnpm theme={null}
  pnpm update -g @superflag-sh/cli
  ```

  ```bash bun theme={null}
  bun update -g @superflag-sh/cli
  ```
</CodeGroup>

## Uninstalling

<CodeGroup>
  ```bash npm theme={null}
  npm uninstall -g @superflag-sh/cli
  ```

  ```bash yarn theme={null}
  yarn global remove @superflag-sh/cli
  ```

  ```bash pnpm theme={null}
  pnpm remove -g @superflag-sh/cli
  ```

  ```bash bun theme={null}
  bun remove -g @superflag-sh/cli
  ```
</CodeGroup>

## Configuration Files

The CLI stores configuration in your home directory:

| File                            | Purpose                     |
| ------------------------------- | --------------------------- |
| `~/.superflag/credentials.json` | Authentication token        |
| `~/.superflag/context.json`     | Default app and environment |

## Next Steps

<CardGroup cols={2}>
  <Card title="Authentication" icon="key" href="/cli/authentication">
    Log in to your Superflag account
  </Card>

  <Card title="Commands" icon="terminal" href="/cli/commands">
    Learn all available commands
  </Card>
</CardGroup>
