@realvendex/pi-config

Configuration management and schema validation for pi.dev extensions

Packages

Package details

package

Install @realvendex/pi-config from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:@realvendex/pi-config
Package
@realvendex/pi-config
Version
1.0.0
Published
Jun 26, 2026
Downloads
94/mo · 15/wk
Author
realvendex
License
MIT
Types
package
Size
33.5 KB
Dependencies
3 dependencies · 5 peers

Security note

Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.

README

@realvendex/pi-config

Configuration management and schema validation for pi.dev extensions.

Installation

pi install npm:@realvendex/pi-config

What It Does

Provides three tools for managing extension configurations:

  • Schema validation — validate config objects against TypeBox-compatible schemas
  • Multi-format loading — load configs from JSON, YAML, and TOML files with auto-detection
  • Precedence merging — merge config layers with clear priority: defaults < file < env < CLI args

Tools

validate-config

Validate a configuration object against a TypeBox-compatible schema.

Parameters:

  • config (object, required) — Configuration object to validate
  • schema (object, required) — TypeBox-compatible schema definition
  • strict (boolean, optional) — Reject unknown properties (default: false)

Example:

Use validate-config with config={"port": 3000} and schema={"type":"object","properties":{"port":{"type":"number"}}}

load-config

Load configuration from a file with auto-detect or explicit format.

Parameters:

  • path (string, required) — Path to config file (.json, .yaml, .yml, .toml)
  • format (string, optional) — Override auto-detection: "json", "yaml", or "toml"

Example:

Use load-config with path="./config.yaml"

merge-config

Merge multiple config layers with precedence: defaults < file < env < CLI args.

Parameters:

  • defaults (object, optional) — Default values (lowest priority)
  • file (object, optional) — File-based configuration
  • env (object, optional) — Environment variable overrides
  • args (object, optional) — CLI argument overrides (highest priority)

Example:

Use merge-config with defaults={"port":3000} and args={"port":8080}

Resources

License

MIT