Installation
Install promptfoo using npm, npx, or Homebrew (Mac, Linux):
- npm
- npx
- brew
npm install -g promptfoo
npx promptfoo@latest
brew install promptfoo
npm and npx require Node.js 20.20+ or 22.22+.
To use promptfoo as a library in your project, run npm install promptfoo --save.
Verify Installation
To verify that promptfoo is installed correctly, run:
- npm
- npx
- brew
promptfoo --version
npx promptfoo@latest --version
promptfoo --version
This should display the current version number of promptfoo.
Run Promptfoo
After installation, you can start using promptfoo by running:
- npm
- npx
- brew
promptfoo init
npx promptfoo@latest init
promptfoo init
This will guide you through the process of creating a promptfooconfig.yaml file.
For a guide on running your first evaluation, please refer to our Getting Started guide.
Uninstall Promptfoo
Remove the package
If you installed promptfoo with more than one method (for example, both npm and Homebrew), repeat the relevant steps for each.
- npm
- npx
- brew (Mac, Linux)
npm uninstall -g promptfoo
npx does not install promptfoo permanently — no uninstall step is needed. If you also have a global install (via npm or Homebrew), remove it using the corresponding tab.
brew uninstall promptfoo
If you installed promptfoo as a project dependency, remove it from your project:
- npm
- yarn
- pnpm
npm uninstall promptfoo
yarn remove promptfoo
pnpm remove promptfoo
Verify removal
After uninstalling, confirm that promptfoo is no longer available globally:
- Mac / Linux
- Windows
which -a promptfoo
where promptfoo
If this still returns a path, you have another global installation that needs to be removed. Note that project-local installs (node_modules/.bin/promptfoo) are not detected by these commands — remove those with the project dependency step above.
Remove configuration and data (optional)
Promptfoo stores configuration, eval history, and cached results in ~/.promptfoo (%USERPROFILE%\.promptfoo on Windows). Uninstalling the package does not remove this directory.
This permanently deletes your eval history, database, and cached results.
- Mac / Linux
- Windows (PowerShell)
- Windows (CMD)
rm -rf ~/.promptfoo
Remove-Item -Recurse -Force "$env:USERPROFILE\.promptfoo"
rmdir /s /q "%USERPROFILE%\.promptfoo"
If you set custom paths via environment variables, remove those directories as well:
PROMPTFOO_CONFIG_DIR— configuration and databasePROMPTFOO_CACHE_PATH— cached resultsPROMPTFOO_LOG_DIR— log files