@saifymatteo/pi-load-pi-dotenv

Loads environment variables from the Pi agent directory without replacing existing environment values.

Packages

Package details

extension

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

$ pi install npm:@saifymatteo/pi-load-pi-dotenv
Package
@saifymatteo/pi-load-pi-dotenv
Version
0.1.4
Published
Nov 7, 2026
Downloads
794/mo · 794/wk
Author
saifymatteo
License
AGPL-3.0-only
Types
extension
Size
38.5 KB
Dependencies
0 dependencies · 0 peers
Pi manifest JSON
{
  "image": "https://raw.githubusercontent.com/saifymatteo/pi-extensions/main/packages/pi-load-pi-dotenv/screenshot.png",
  "extensions": [
    "./src/index.ts"
  ]
}

Security note

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

README

Pi dotenv loader

Environment variables from ~/.pi/agent/.env reaching a bash tool call

With this extension, variables from ~/.pi/agent/.env, including ${VAR} expansion, reach the tools the agent runs. Stock pi passes nothing through.

Loads environment variables from the Pi agent directory without replacing existing environment values.

Try locally

From the repository root:

pi -e ./packages/pi-load-pi-dotenv

This uses your normal personal resources unless you isolate the agent home. Follow the root README to avoid loading an existing copy of the extension. Nothing is installed globally.

Configuration and requirements

Reads /.env, where is PI_CODING_AGENT_DIR or ~/.pi/agent. Supports $NAME and ${NAME} expansion. Missing and circular references remain literal. Missing files are ignored.

Compatibility and safety

Loaded values are inherited by subprocesses. Keep .env out of Git. This loader runs during extension initialization; do not assume it loads credentials early enough for every provider's discovery.

Imported host APIs are declared as peer dependencies and supplied by the Pi host. A * peer range describes host resolution, not a guarantee of compatibility with every release. See root verification notes for what was actually exercised.

Status

Part of the pi-extensions collection. No personal settings or credentials are included; see NOTICE.md for licensing and provenance.