{"_id":"@aaronmaturen/pi-context7","_rev":"2-ea72f20bfc1ed5cf610acf6d7198d9e2","name":"@aaronmaturen/pi-context7","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"@aaronmaturen/pi-context7","version":"1.0.0","keywords":["pi-package","context7","documentation","pi-coding-agent"],"_id":"@aaronmaturen/pi-context7@1.0.0","maintainers":[{"name":"aaronmaturen","email":"aaron.maturen@gmail.com"}],"pi":{"extensions":["./src/index.ts"]},"dist":{"shasum":"e843f524f3a473a401d970ba3d4e36c17daf6b3a","tarball":"https://registry.npmjs.org/@aaronmaturen/pi-context7/-/pi-context7-1.0.0.tgz","fileCount":3,"integrity":"sha512-zEMIxWhoioxhqnVk2iHDXVyv+SXNLYUq30qLpHbz4xaLfXoQH6PRyca8Rw9LLBcbwlA7ngFj7tF/uzmAjLpgQw==","signatures":[{"sig":"MEUCIQCczqXPQ8swpqpMGB4YQEkqsTKZDhmMwvkxJPLduKPXlgIgAUC+M8N7MHpyAwGYnQJ8nKJmQFPFGLfrhoo/0ch5b2o=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":17447},"type":"module","scripts":{"lint":"eslint src","build":"echo 'nothing to build'","check":"echo 'nothing to check'","clean":"echo 'nothing to clean'","format":"prettier --write .","prepare":"husky","format:check":"prettier --check ."},"_npmUser":{"name":"aaronmaturen","email":"aaron.maturen@gmail.com"},"_npmVersion":"11.4.1","description":"Context7 extension for pi - fetches up-to-date library documentation via context7.com","directories":{},"lint-staged":{"*.ts":["prettier --write","eslint --fix"]},"_nodeVersion":"22.14.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"husky":"^9.1.7","eslint":"^10.0.0","prettier":"^3.8.1","lint-staged":"^16.2.7","typescript-eslint":"^8.56.0","eslint-config-prettier":"^10.1.8"},"peerDependencies":{"@sinclair/typebox":"*","@mariozechner/pi-coding-agent":"*"},"_npmOperationalInternal":{"tmp":"tmp/pi-context7_1.0.0_1771593086475_0.5608489920663773","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@aaronmaturen/pi-context7","version":"1.0.1","description":"Context7 extension for pi - fetches up-to-date library documentation via context7.com","type":"module","keywords":["pi-package","context7","documentation","pi-coding-agent"],"publishConfig":{"access":"public"},"scripts":{"clean":"echo 'nothing to clean'","build":"echo 'nothing to build'","check":"echo 'nothing to check'","format":"prettier --write .","format:check":"prettier --check .","lint":"eslint src","prepare":"husky"},"pi":{"extensions":["./src/index.ts"]},"lint-staged":{"*.ts":["prettier --write","eslint --fix"]},"peerDependencies":{"@mariozechner/pi-coding-agent":"*","@sinclair/typebox":"*"},"devDependencies":{"eslint":"^10.0.0","eslint-config-prettier":"^10.1.8","husky":"^9.1.7","lint-staged":"^16.2.7","prettier":"^3.8.1","typescript-eslint":"^8.56.0"},"_id":"@aaronmaturen/pi-context7@1.0.1","gitHead":"6b20a5cc9d5d0b54affec4e362a00a5649afe449","_nodeVersion":"22.14.0","_npmVersion":"11.4.1","dist":{"integrity":"sha512-y0jj0EoA06ORtnU4noL1IX+9CiH0HW24FnC2HAYt/pMC28zSf2LhKQlJu8fKd0ri7+73Os6QBIThTtZY3Vx2ng==","shasum":"3d7649716a67ce9d341f290f51485382329f08c6","tarball":"https://registry.npmjs.org/@aaronmaturen/pi-context7/-/pi-context7-1.0.1.tgz","fileCount":3,"unpackedSize":17447,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCkzSTgVr1DxH197HhVkx0fd4zY/z7Zc3DJyIavDTFVxAIgWCgQVCze2/OQn89a5Z9gpXZqX2DX9aTTdtGgWi/4mEw="}]},"_npmUser":{"name":"aaronmaturen","email":"aaron.maturen@gmail.com"},"directories":{},"maintainers":[{"name":"aaronmaturen","email":"aaron.maturen@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/pi-context7_1.0.1_1771851784594_0.153293715331706"},"_hasShrinkwrap":false}},"time":{"created":"2026-02-20T13:11:26.330Z","modified":"2026-02-23T13:03:04.886Z","1.0.0":"2026-02-20T13:11:26.690Z","1.0.1":"2026-02-23T13:03:04.752Z"},"keywords":["pi-package","context7","documentation","pi-coding-agent"],"description":"Context7 extension for pi - fetches up-to-date library documentation via context7.com","maintainers":[{"name":"aaronmaturen","email":"aaron.maturen@gmail.com"}],"readme":"# pi-context7\n\nA [pi](https://github.com/badlogic/pi-mono/tree/main/packages/coding-agent) extension that brings [Context7](https://context7.com) library documentation into your coding sessions.\n\nInstead of relying on potentially stale training data, the LLM can pull real, up-to-date documentation snippets directly from a library's official docs at query time.\n\n## How it works\n\nThe extension registers two tools that the LLM can call:\n\n| Tool                 | Purpose                                                                                                    |\n| -------------------- | ---------------------------------------------------------------------------------------------------------- |\n| `resolve_library_id` | Search context7.com for a library by name; returns ranked matches with IDs, trust scores, and token counts |\n| `get_library_docs`   | Fetch documentation snippets for a resolved library ID, optionally focused on a topic                      |\n\n**Typical flow:**\n\n1. You ask about a library (e.g. \"how do I use Drizzle ORM with Postgres?\")\n2. LLM calls `resolve_library_id(\"drizzle-orm\")` → picks the best match\n3. LLM calls `get_library_docs(\"/drizzle-team/drizzle-orm\", { topic: \"postgres\" })` → gets real docs\n4. LLM answers using current, accurate documentation\n\n## Installation\n\n### Via npm (recommended)\n\n```bash\n# Global — available in all projects\npi install npm:@aaronmaturen/pi-context7\n\n# Project-local — saved to .pi/settings.json, shared with your team\npi install -l npm:@aaronmaturen/pi-context7\n```\n\nThen restart pi or run `/reload`.\n\n### From source\n\n```bash\n# Clone and symlink globally\ngit clone https://github.com/aaronmaturen/pi-context7\nln -s $(pwd)/pi-context7 ~/.pi/agent/extensions/pi-context7\n\n# Or for a quick one-off test without installing\npi -e ./src/index.ts\n```\n\n## Usage\n\nJust ask pi about any library — the LLM will use the tools automatically when it needs current docs:\n\n```\nyou: how do I do server-side rendering with Next.js 15 App Router?\nyou: show me the zustand persist middleware API\nyou: what's the correct way to use Drizzle transactions?\n```\n\nOr be explicit:\n\n```\nyou: use context7 to look up the latest Hono docs on routing\n```\n\n## Configuration\n\nNo API key required — Context7 has a generous free tier (200 requests/day for anonymous use). The extension sets a `X-User-Agent: pi-context7/1.0` header so usage is identifiable.\n\nIf you have a Context7 account and want to use a higher quota, the API currently uses session cookies (browser-based auth). Anonymous access is sufficient for typical development use.\n\n### Tuning token budgets\n\nThe default `tokens` value is `10,000`. For complex topics or large APIs you can ask for more:\n\n```\nyou: fetch 25000 tokens of the React Server Components docs from context7\n```\n\nThe LLM will pass the appropriate `tokens` value to `get_library_docs`.\n\n## No npm dependencies\n\nThe extension uses only Node.js built-ins (`fetch`) and pi's own utilities. No `npm install` required.\n\n## Files\n\n```\npi-context7/\n├── README.md\n├── package.json        # pi extension entry point declaration\n└── src/\n    └── index.ts        # Extension — two tools + session status indicator\n```\n\n## Context7 API\n\n- `GET https://context7.com/api/v1/search?query=<name>` — search libraries\n- `GET https://context7.com/api/v1/<library-id>?tokens=<n>&topic=<t>` — fetch docs\n\nSee [context7.com](https://context7.com) and the [Context7 MCP server](https://github.com/upstash/context7) for more details.\n","readmeFilename":"README.md"}