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

# Installation

> Install FlagKit CLI and SDK

## Prerequisites

<Check>**Bun** (for CLI) - [Install Bun](https://bun.sh/install)</Check>

<Check>
  **Node.js** v19+ (for SDK) - [Install Node.js](https://nodejs.org/)
</Check>

<Check>**Git** - For version control</Check>

## Install the CLI

<Tabs>
  <Tab title="npm">
    ```bash theme={null}
    npm install -g @flagkit-io/cli
    ```
  </Tab>

  <Tab title="yarn">
    ```bash theme={null}
    yarn global add @flagkit-io/cli
    ```
  </Tab>

  <Tab title="pnpm">
    ```bash theme={null}
    pnpm add -g @flagkit-io/cli
    ```
  </Tab>

  <Tab title="Standalone Binary">
    ```bash theme={null}
    # macOS/Linux
    curl -fsSL https://flagkit.io/install | bash

    # No dependencies required
    ```
  </Tab>
</Tabs>

## Verify Installation

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

You should see output like:

```
@flagkit-io/cli v0.1.0
```

## Install the Core SDK

In your project directory:

<Tabs>
  <Tab title="npm">`bash npm install @flagkit-io/core `</Tab>
  <Tab title="yarn">`bash yarn add @flagkit-io/core `</Tab>
  <Tab title="pnpm">`bash pnpm add @flagkit-io/core `</Tab>
  <Tab title="bun">`bash bun add @flagkit-io/core `</Tab>
</Tabs>

## Framework-Specific Packages

### React

```bash theme={null}
npm install @flagkit-io/react
```

<Note>Coming soon - currently in development</Note>

### Vue

```bash theme={null}
npm install @flagkit-io/vue
```

<Note>Coming soon - currently in development</Note>

### Next.js

FlagKit works out-of-the-box with Next.js using the core SDK. No additional package required.

## Troubleshooting

<AccordionGroup>
  <Accordion title="Command not found: flagkit">
    If you get a "command not found" error, ensure your global npm bin directory is in your PATH:

    ```bash theme={null}
    # Check npm global bin path
    npm config get prefix

    # Add to PATH (add to ~/.bashrc or ~/.zshrc)
    export PATH="$PATH:$(npm config get prefix)/bin"
    ```
  </Accordion>

  <Accordion title="Permission errors during installation">
    If you encounter permission errors when installing globally:

    ```bash theme={null}
    # Option 1: Use npx (no global install needed)
    npx @flagkit-io/cli init

    # Option 2: Fix npm permissions
    mkdir ~/.npm-global
    npm config set prefix '~/.npm-global'
    export PATH=~/.npm-global/bin:$PATH
    ```
  </Accordion>

  <Accordion title="Bun not found">
    FlagKit CLI requires Bun. Install it with:

    ```bash theme={null}
    curl -fsSL https://bun.sh/install | bash
    ```

    Then restart your terminal or run:

    ```bash theme={null}
    source ~/.bashrc  # or ~/.zshrc
    ```
  </Accordion>
</AccordionGroup>

## Next Steps

<Card title="Quick Start Guide" icon="rocket" href="/quickstart">
  Initialize your first FlagKit project
</Card>
