@davehardy20/pi-context7
Pi package for fetching current library/framework/API docs via Context7.
Package details
Install @davehardy20/pi-context7 from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:@davehardy20/pi-context7- Package
@davehardy20/pi-context7- Version
0.1.0- Published
- May 17, 2026
- Downloads
- not available
- Author
- davehardy20
- License
- MIT
- Types
- extension
- Size
- 23.4 KB
- Dependencies
- 0 dependencies · 2 peers
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
@davehardy20/pi-context7
Pi package for fetching current library/framework/API docs via Context7.
What it adds
context7_librarytool — search Context7 for library documentation sources; returns ranked matches with metadata (id, scores, versions)context7_docstool — fetch documentation snippets from Context7 for a specific library ID; supports deep research mode and auto-truncation with temp-file spillover for large output/context7-status— show package name, version, source path, and runtime status
Install
From npm:
pi install npm:@davehardy20/pi-context7
From git:
pi install git:github.com/davehardy20/pi-context7
From a local checkout during development:
pi install /Users/dave/tools/pi-context7
For one run only:
pi -e /Users/dave/tools/pi-context7
How it works
The extension uses npx --yes ctx7@latest so the Context7 CLI is fetched on demand. It falls back to a locally-installed ctx7 binary when npx is unavailable.
Large docs output is automatically truncated at ~8,000 characters and spilled to a temp file, with a pointer for the model to read the full output if needed.
Settings
No special settings required. If Context7 authentication is needed:
ctx7 login
# or
export CONTEXT7_API_KEY="your-api-key"
Notes
- If tools appear twice, Pi is probably loading both this package and the old local
agent/extensions/context7.tsfile. - Disable or remove the old local auto-discovered extension before reload verification.
Update flow
- update the package repo
- push to GitHub
- run
pi update --extensionsor reinstall the package - run
/reload
/reload alone does not fetch newer package commits.
Troubleshooting
Run /context7-status to confirm:
- package name
- package version
- loaded source path
If Context7 tools fail:
- Ensure Node.js and npm are in your PATH so npx can fetch the CLI.
- Run
ctx7 loginor setCONTEXT7_API_KEYfor authentication errors. - Wait and retry for quota or rate limit errors.
- Check your internet connection for network errors.
Build and test
npm run typecheck
npm run test
npm run build