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.

Implementation:Promptfoo Promptfoo Update Checker

From Leeroopedia
Knowledge Sources
Domains CLI, Version_Management
Last Updated 2026-02-14 07:45 GMT

Overview

Concrete tool for checking whether newer versions of promptfoo (npm) and modelaudit (PyPI) are available, and displaying update notifications.

Description

The Update_Checker module (updates.ts) provides functions to check for software updates. checkForUpdates() queries the promptfoo API for the latest npm version and compares it with the current VERSION using semver. checkModelAuditUpdates() checks PyPI for the latest modelaudit version and compares it with the locally installed version. Both functions display formatted terminal notifications when updates are available and can be disabled via PROMPTFOO_DISABLE_UPDATE.

Usage

Called during CLI startup to notify users of available updates. The check is non-blocking and failures are silently ignored.

Code Reference

Source Location

Signature

export async function getLatestVersion(): Promise<string>
export async function checkForUpdates(): Promise<boolean>
export async function getModelAuditLatestVersion(): Promise<string | null>
export async function getModelAuditCurrentVersion(): Promise<string | null>
export async function checkModelAuditUpdates(): Promise<boolean>

Import

import { checkForUpdates, checkModelAuditUpdates } from './updates';

I/O Contract

Inputs

Name Type Required Description
(none) Queries external APIs for version info

Outputs

Name Type Description
updated boolean true if a newer version was found and notification shown

Usage Examples

import { checkForUpdates, checkModelAuditUpdates } from './updates';

// Check for promptfoo updates at CLI startup
const hasUpdate = await checkForUpdates();
if (hasUpdate) {
  // Notification already printed to terminal
}

// Check for modelaudit updates
await checkModelAuditUpdates();

Related Pages

Page Connections

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