@baggiiiie/pi-lazy-load
Lightweight Pi extension that registers stub slash commands and loads optional extensions on demand.
Package details
Install @baggiiiie/pi-lazy-load from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:@baggiiiie/pi-lazy-load- Package
@baggiiiie/pi-lazy-load- Version
0.0.1- Published
- May 19, 2026
- Downloads
- not available
- Author
- baggiiiie
- License
- unknown
- Types
- extension
- Size
- 5.7 KB
- Dependencies
- 0 dependencies · 1 peer
Pi manifest JSON
{
"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-lazy-load
Lightweight Pi extension that registers stub slash commands and loads optional extensions on demand.
How it works
On startup, the extension reads lazy-extensions.json and settings.json from ~/.pi/agent, normalizing entries into command/path pairs. It registers each command as a stub that, when invoked for the first time, dynamically imports the extension's module, calls its exported install(pi) (or default) function, and marks it loaded. Subsequent invocations are no-ops. Use /lazy:list to check which stubs are loaded.
Configuration
Add lazy extensions in ~/.pi/agent/settings.json:
{
"lazyExtensions": [
{
"command": "autoresearch",
"description": "Load autoresearch extension",
"path": "git/github.com/davebcn87/pi-autoresearch/extensions/pi-autoresearch/index.ts"
}
]
}
Paths are resolved relative to ~/.pi/agent unless absolute or ~/....
Use /lazy:list to see configured entries.