# Source: https://www.promptfoo.dev/docs/installation/

# Installation

## Requirements

- Node.js 20 or newer
- Supported operating systems: macOS, Linux, Windows

## For Command-Line Usage

Install promptfoo using [npx](https://nodejs.org/en/download), [npm](https://nodejs.org/en/download), or [brew](https://brew.sh/):

### npm

```bash
npm install -g promptfoo
```

### npx

```bash
npx promptfoo@latest
```

### brew

```bash
brew install promptfoo
```

## For Library Usage

Install `promptfoo` as a library in your project:

```bash
npm install promptfoo --save
```

## Verify Installation

To verify that promptfoo is installed correctly, run:

### npm

```bash
promptfoo --version
```

### npx

```bash
npx promptfoo@latest --version
```

### brew

```bash
promptfoo --version
```

This should display the version number of promptfoo:

```
0.114.7
```

## Run Promptfoo

After installation, you can start using promptfoo by running:

### npm

```bash
promptfoo init
```

### npx

```bash
npx promptfoo@latest init
```

### brew

```bash
promptfoo init
```

This will create a `promptfooconfig.yaml` placeholder in your current directory.

For more detailed usage instructions, please refer to our [Getting Started guide](/docs/getting-started/).

## See Also

- [Getting Started](/docs/getting-started/)
- [Troubleshooting](/docs/usage/troubleshooting/)
- [Contributing](/docs/contributing/)