Directory Compare FCRS-1.0 /llms.txt
← Back to Directory

Promptfoo CLI

$ promptfoo Official Med Risk
Promptfoo · Agent Bridges & Meta · MIT · macos / linux / windows

promptfoo runs deterministic test suites, model comparisons, and security red-teaming against prompts, RAG pipelines, and agents. Outputs machine-readable .json/.csv/.yaml reports via promptfoo eval --output, making it ideal for Agent regression testing in CI.

FCRS-1.0 Score
88 /100
Good
Medium Confidence
Zero-Friction Install
brew install promptfoo
CLI vs MCP Decision CLI Preferred vs MCP

promptfoo eval --output results.json executes full LLM assertion matrices non-interactively in CI and returns structured pass/fail metrics.

Agent-Readiness Checklist

✓ JSON Output
— Field Filtering
✓ Non-Interactive
— Dry-Run
— Read-Only Mode
✓ NO_COLOR Clean
✓ Self-Describing
— Official SKILL.md

Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.

FCRS-1.0 6-Dimension Breakdown

Agent-Readiness 22 / 25

Supports --output results.json, -j concurrency caps, --no-write, --filter-pattern, and CI exit codes (--no-progress-bar).

  • Supports --output results.json, -j, --no-write, and --filter-pattern
Trust & Safety 21 / 25

Runs evaluations cleanly with --no-write and local caching; main risk is unbounded LLM token spend on large eval matrices.

  • Local execution with --no-write and -j rate capping
Setup & Portability 14 / 15

Cross-platform Node.js CLI via npx promptfoo, npm, and Homebrew.

  • Distributed via Homebrew, npm, and npx promptfoo
Utility & Efficiency 14 / 15

Industry-leading CLI for prompt regression testing, model benchmarking, and LLM red-teaming.

  • Declarative YAML eval matrices + red-team assertions
Maintenance & Lineage 9 / 10

Official promptfoo/promptfoo repository under MIT license with rapid cadence.

  • Official promptfoo/promptfoo repository
Docs & Verifiability 8 / 10

Comprehensive CLI and assertion documentation at promptfoo.dev.

  • Official docs at promptfoo.dev/docs/usage/command-line/

Security, Auth & Guardrails

Auth Modes
Env API Key Config File
Credential Storage

Reads provider keys (OPENAI_API_KEY, ANTHROPIC_API_KEY, GEMINI_API_KEY) from env vars or .env; caches eval results locally in ~/.promptfoo.

Side Effects
Read-Only Local Write Remote Write Billing Impact
Cost & Quotas

CLI is MIT open-source; eval calls external LLM APIs and incurs token billing on configured providers.

Copyable Guardrail for CLAUDE.md / AGENTS.md
# Promptfoo CLI Agent Rules
- Always pass `--output <file>.json` and `-j <concurrency>` so evaluations stay bounded and machine-parseable.
- Never invoke `promptfoo view` inside an agent turn (it launches a blocking local web server).
- Use `--filter-pattern` or small test subsets first to avoid unexpected LLM token spend.

Agent-Ready Command Recipes

Safe Read-Only Queries

Validate promptfooconfig.yaml and run cached assertions
npx promptfoo eval --no-write --output results.json

Evaluates configured prompts/assertions and writes structured JSON without persisting to the global SQLite store.

Controlled Writes & Previews

Run bounded concurrency LLM eval suite
npx promptfoo eval -c promptfooconfig.yaml -j 4 --output eval-report.json

Executes prompt regression tests with max 4 concurrent provider calls and exports JSON.

Strengths for Agents

  • + --output results.json gives coding agents crisp assertion pass/fail diffs after prompt edits.
  • + Supports local caching to avoid re-billing identical prompt calls.
  • + Covers both functional evals and automated security red-teaming.

Caveats & Pitfalls

  • ! promptfoo view starts a blocking local web server.
  • ! Large test matrices can incur significant LLM API costs if run unfiltered.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI