Installation
Requirements
- Node.js 20.20+ or 22.22+
- Supported operating systems: Windows, Mac, Linux
For Command-Line Usage
Install promptfoo using npm, npx, or Homebrew (Mac, Linux):
- npm
- npx
- brew (Mac, Linux)
npm install -g promptfoo
npx promptfoo@latest
brew install promptfoo
For Library Usage
Install promptfoo as a library in your project:
npm install promptfoo --save
Verify Installation
To verify that promptfoo is installed correctly, run:
- npm
- npx
- brew (Mac, Linux)
promptfoo --version
npx promptfoo@latest --version
promptfoo --version
This should display the version number of promptfoo:
0.120.20
Run Promptfoo
After installation, you can start using promptfoo by running:
- npm
- npx
- brew (Mac, Linux)
promptfoo init
npx promptfoo@latest init
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.