@vercel/nextdocfs
v0.5.1
Published
Filesystem CLI for Next.js documentation — ls, cat, grep, stat, wc over nextjs.org/docs
Downloads
508
Maintainers
Keywords
Readme
nextdocfs
A simulated filesystem CLI for Next.js documentation. Run familiar commands — ls, cat, grep, tree, find — against nextjs.org/docs as if the docs were local files.
Why
AI coding agents are better at navigating filesystems than fetching URLs. In evals, pointing agents at a local docs directory consistently outperformed giving them a remote docs URL (100% vs 90% on Opus 4.6). But bundling docs in node_modules couples the docs version to the package version, and maintaining a hand-curated docs index in agents.md is fragile — someone updates Next.js and forgets to update the index.
nextdocfs gives agents the filesystem interface they're good at, backed by docs cloned from the Next.js repo at the project's detected version:
- No maintenance burden — no index file to keep in sync, just a stable prompt telling agents to use the CLI
- Version-accurate docs — docs are cloned from the matching Next.js Git tag for your local project version
- Better agent performance — when agents see explicit
grepandfindcommands alongsidelsandcat, they use them. With raw filesystem access, they default to browse-and-read. Evals showed a 10 ppt improvement for Sonnet 4.5 and 5 ppt for Composer 1.5 over the local docs directory approach
Usage
npx @vercel/nextdocfs ls
npx @vercel/nextdocfs cat app/getting-started/installation
npx @vercel/nextdocfs grep "cache" app
npx @vercel/nextdocfs tree app/getting-started
npx @vercel/nextdocfs find "middleware"
npx @vercel/nextdocfs head app/building-your-application/routing
npx @vercel/nextdocfs stat app/getting-started/installation
npx @vercel/nextdocfs wc app/getting-startedCommands
| Command | Description |
| ------- | ------------------------------------------- |
| ls | List doc pages at a path |
| cat | Print a doc page as markdown |
| head | Show the first N lines of a page |
| tree | Show the doc tree structure |
| grep | Search across doc pages by regex |
| find | Find pages by name or path |
| stat | Show metadata for a page |
| wc | Show line, word, and byte counts |
| purge | Delete cached docs for all versions |
