pi-direnv

Auto-load direnv environment at session start — ensures bash commands have project-specific env vars from .envrc

Package details

extension

Install pi-direnv from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:pi-direnv
Package
pi-direnv
Version
0.1.0
Published
Feb 24, 2026
Downloads
23/mo · 7/wk
Author
emiller88
License
MIT
Types
extension
Size
4.2 KB
Dependencies
0 dependencies · 1 peer
Pi manifest JSON
{
  "extensions": [
    "./index.ts"
  ]
}

Security note

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

README

pi-direnv

Auto-load direnv environment at session start. Ensures bash commands have project-specific env vars from .envrc files.

Install

pi install npm:pi-direnv

What it does

On session_start:

  1. Checks if direnv is installed (skips silently if not)
  2. Searches for .envrc from cwd up to the git root
  3. Runs direnv export json and applies variables to process.env
  4. Shows a notification with the count of loaded vars
  5. Warns if .envrc is blocked (needs direnv allow)

Why

Nix flakes + direnv is a common pattern. Without this extension, pi exec commands miss project-specific PATH entries, env vars, and tool versions defined in your flake's devShell.

Inspired by simonwjackson/opencode-direnv.