next-lens is a light CLI companion for the Next.js App Router. Scan any project and see API and page routes instantly in your terminal.
- Lists
app/**/page.*and shows whetherloading/erroris colocated or inherited. - Scans
app/api/**/route.*with colorized HTTP methods. - Highlights dynamic, optional, and catch-all params so route shapes are obvious.
- Reports Next.js / React / Node versions and the package manager.
- Works on any target directory—no Next.js runtime needed.
Run in a Next.js project root, or pass another directory:
npx next-lens@latest [command] [target-directory][dir] arguments are optional, they default to the current directory.
next-lens about— one-page tool overview.next-lens api:list [dir] [-m, --method]— list API routes and detected HTTP handlers.next-lens page:list [dir]— list page routes and showloading/errorcoverage.next-lens info [dir]— show Next.js / React / Node / package manager versions.next-lens web [dir]— launch the inspector UI.next-lens web:build [dir]— build a static readonly snapshot of the inspector.
Expose the same insights to IDEs or copilots via MCP:
{
"mcpServers": {
"next-lens": {
"command": "npx",
"args": ["next-lens@latest", "mcp"]
}
}
}MIT © Yiwei Ho