Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Principle:Promptfoo Promptfoo CLI Utilities

From Leeroopedia
Revision as of 17:21, 16 February 2026 by Admin (talk | contribs) (Auto-imported from principles/Promptfoo_Promptfoo_CLI_Utilities.md)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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.

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment