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 Global Config Type

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

Overview

TypeScript interface definition for the GlobalConfig structure that represents the user's persistent global configuration stored on disk.

Description

The Global_Config_Type module (configTypes.ts) defines the GlobalConfig interface used to type the user's persistent configuration file (~/.promptfoo/promptfoo.yaml). It includes the unique user id, harmful red team consent flag, account information (email, validation status), and cloud settings (API host, API key, organization/team IDs, and team cache).

Usage

Import this interface when typing global configuration objects, particularly in the globalConfig module and any code that reads/writes the persistent config file.

Code Reference

Source Location

Signature

export interface GlobalConfig {
  id?: string;
  hasHarmfulRedteamConsent?: boolean;
  account?: {
    email?: string;
    emailNeedsValidation?: boolean;
    emailValidated?: boolean;
  };
  cloud?: {
    appUrl?: string;
    apiHost?: string;
    apiKey?: string;
    currentOrganizationId?: string;
    currentTeamId?: string;
    teams?: {
      [organizationId: string]: {
        currentTeamId?: string;
        cache?: Array<{ id: string; name: string; slug: string; lastFetched: string }>;
      };
    };
  };
}

Import

import type { GlobalConfig } from './configTypes';

I/O Contract

Inputs

Name Type Required Description
(none) Type-only export, no runtime inputs

Outputs

Name Type Description
GlobalConfig TypeScript interface Type definition for persistent global config

Usage Examples

import type { GlobalConfig } from './configTypes';

function readGlobalConfig(): GlobalConfig {
  // Read from ~/.promptfoo/promptfoo.yaml
  return { id: 'user-123', account: { email: 'user@example.com' } };
}

Related Pages

Page Connections

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