Principle:Promptfoo Promptfoo CLI Utilities
| Knowledge Sources | |
|---|---|
| Domains | CLI, User_Interaction |
| Last Updated | 2026-02-14 07:45 GMT |
Overview
Principle governing the set of command-line utility functions that provide user-facing features: terminal table rendering, version update checking, user feedback collection, and prompt suggestion generation.
Description
CLI Utilities defines the supporting functions that enhance the command-line user experience beyond core evaluation functionality. This includes formatted table output for evaluation results (with color-coded PASS/FAIL), automatic version update notifications, interactive feedback collection, and LLM-powered prompt variant generation. These utilities share common patterns: they are non-critical (failures are silently handled), they respect environment-variable-based disabling (PROMPTFOO_DISABLE_UPDATE), and they integrate with the centralized logger.
Usage
Apply this principle when adding new CLI-facing utility features. Each utility should be independently importable, fail gracefully, and respect relevant disable flags.
Theoretical Basis
The CLI utilities follow the Facade Pattern: each utility presents a simple interface (checkForUpdates(), generateTable()) while internally handling multiple concerns (network requests, terminal formatting, LLM calls). The Graceful Degradation pattern ensures that failures in non-critical utilities (e.g., network timeout during update check) do not affect core functionality.