@pi-lab/env
Global environment loader extension for pi coding agent
Package details
Install @pi-lab/env from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:@pi-lab/env- Package
@pi-lab/env- Version
1.0.4- Published
- Aug 5, 2026
- Downloads
- 196/mo · 22/wk
- Author
- cheny341
- License
- MIT
- Types
- extension
- Size
- 6.5 KB
- Dependencies
- 1 dependency · 1 peer
Pi manifest JSON
{
"extensions": [
"./dist/index.mjs"
]
}Security note
Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.
README
@pi-lab/env 
Load env vars for pi from settings.json and ~/.pi/agent/.env.
Install
pi install npm:@pi-lab/env
Usage
Configure env vars in global settings:
// ~/.pi/agent/settings.json
{
"env": {
"HTTP_PROXY": "http://127.0.0.1:7890",
"HTTPS_PROXY": "http://127.0.0.1:7890",
"OPENAI_API_KEY": "...",
"INTERNAL_TOKEN": "..."
}
}
Trusted projects can also override/add env vars in .pi/settings.json with the same env shape.
You can still use a dotenv file:
~/.pi/agent/.env
HTTP_PROXY=http://127.0.0.1:7890
HTTPS_PROXY=http://127.0.0.1:7890
OPENAI_API_KEY=...
INTERNAL_TOKEN=...
Restart pi after editing settings or dotenv files.
Note
- Does not override env vars already set before launching
pi settings.jsonenv values take precedence over dotenv values