Next.js Introspection Tool

Analyze Your Next.js
Routing Structure

A comprehensive Next.js project introspection tool that analyzes routing structures, detects framework configurations, and provides detailed metadata about your Next.js application.

$next-introspect introspect . --format typescript --output routes.ts
✅ Analysis complete!
Generated type-safe route helpers for your Next.js project
export const routes = {
blog: { $slug: (params) =>
`/blog/${params.slug}` },
api: { users: "/api/users" }
} as const;
routes.blog.$slug({ slug: 'my-post' })

Powerful Features

Everything you need to understand, document, and work with your Next.js routing structure with enterprise-grade reliability

A

App Router Support

Full support for Next.js 13+ App Router with special files, route groups, intercepting routes, and parallel routes. Analyzes layouts, loading states, error boundaries, and metadata exports.

app/(dashboard)/page.tsx
export default function Dashboard() {...
Next.js 13+
P

Pages Router Legacy

Complete analysis of traditional Pages Router with API routes, data fetching methods (getServerSideProps, getStaticProps), and special pages (_app, _document, _error).

pages/api/users.ts
export default function handler(req, res) {...
Legacy Support
T

Type-Safe Routes

Generate TypeScript route builders with full type safety. Enjoy IDE autocompletion, compile-time route validation, and zero runtime errors in your route usage.

routes.blog.$slug({ slug: 'my-post' })
TypeScript 5.0+
W

Watch Mode

Real-time monitoring with intelligent file watching. Automatically re-analyzes routes when you add pages, update configurations, or modify route structures during development.

$ next-introspect introspect . --watch
📝 File changed: app/blog/page.tsx
🔄 Re-running analysis...
Real-time
M

Multiple Outputs

Export in JSON, Markdown, TypeScript, or raw objects. Customize field filtering, path formatting, and nested structures for any workflow or integration.

--format typescript --output routes.ts
--format json --nested
--format markdown --metadata routes.json
4 Formats
C

CI/CD Ready

Integrate into your build pipeline for automated route validation, documentation generation, and migration tracking. Works with GitHub Actions, Jenkins, and any CI/CD platform.

# .github/workflows/routes.yml
- run: next-introspect introspect .
--format json --quiet
Enterprise
10-30ms
Analysis Speed
100%
Type Safe
0
Dependencies
Routes

Get Started in Seconds

Install next-introspect and start analyzing your Next.js projects immediately

💻CLI Tool

Install globally for command-line usage across all your projects.

# Install globally
npm install -g next-introspect
# or with bun
bun add -g next-introspect
# Quick analysis
next-introspect introspect . --format json

📦Programmatic API

Install locally for programmatic usage in your applications and build tools.

# Install locally
npm install next-introspect
# or with bun
bun add next-introspect
# Use in code
import { NextIntrospect } from 'next-introspect';
const introspect = new NextIntrospect('./');

One-time Usage

Try next-introspect without installing it globally. Use package runners to execute commands on-demand.

With bunx (Bun package runner)
# Run once with bunx
bunx next-introspect introspect . --format json

bunx downloads and runs packages without global installation

With npx (npm package runner)
# Run once with npx
npx next-introspect introspect . --format json

npx executes packages from npm registry without installation

Perfect for Every Use Case

From development workflows to production deployments, next-introspect fits seamlessly into your process

🚀Development

  • Type-safe routing: Generate TypeScript route helpers for full IDE autocompletion
  • Watch mode: Automatically update routes as you develop
  • Route validation: Catch routing issues before they reach production
  • Documentation: Auto-generate route documentation for your team

🏭Production

  • CI/CD integration: Validate routes in your deployment pipeline
  • Route inventory: Maintain comprehensive route documentation
  • Migration planning: Track Pages Router to App Router migrations
  • Performance monitoring: Monitor route complexity and optimization opportunities

Code Examples

See how next-introspect works in real scenarios

TypeScript Route Helpers

import { routes } from './routes';
const blogUrl = routes.blog.$slug({
slug: 'my-article'
});
const apiUrl = routes.api.users.$id({
id: '123'
});

Compile-time route validation prevents typos and ensures type safety.

Watch Mode Development

$ next-introspect introspect . --watch
🔍 Analyzing Next.js project...
✅ Analysis complete!
[File change detected]
📝 File changed: app/products/page.tsx
🔄 Re-running analysis...
✅ Routes updated!

Automatically regenerates routes when you add or modify pages during development.

Programmatic API

import { NextIntrospect } from 'next-introspect';
const introspect = new NextIntrospect('./');
await introspect.analyze();
const routes = introspect.getRoutes();
await introspect.exportToFile('routes.json');

Use the full API programmatically in build tools, scripts, and CI/CD pipelines.

CI/CD Integration

- name: Analyze Routes
run: |
npm install -g next-introspect
next-introspect introspect .
--format json --quiet
--output routes.json
# Validate route changes
- name: Check Routes
run: |
if [ -n "$(git diff routes.json)" ]; then
echo "Routes changed - review required"
fi

Automate route validation and documentation generation in your CI/CD pipeline.

Documentation for LLMs

Access our complete documentation in formats optimized for AI assistants

Full Documentation Text

Get the entire documentation site content in a single, LLM-optimized plain text format. Perfect for AI assistants that need comprehensive context about next-introspect.

Ready to Analyze Your Next.js Routes?

Join developers worldwide who use next-introspect to understand, document, and optimize their Next.js applications.

Our Sponsors

We're grateful to our sponsors who help make next-introspect possible

Webdesign29

Professional web agency based in Brest, France. Experts in creating modern websites and applications for startups and businesses.

Visit Website
+
Your Company

Support open source development and showcase your brand here.

Available for sponsorship
+
Your Company

Support open source development and showcase your brand here.

Available for sponsorship

Interested in Sponsoring?

Help support the development of next-introspect and get your company's logo displayed here with a link to your website.

Get in Touch