create-nxpage-app
v0.1.20
Published
A CLI to scaffold a production-ready Next.js app with NxPage bot-optimized server setup and Turbopack-safe build pipeline.
Maintainers
Keywords
Readme
create-nxpage-app
CLI to scaffold a Next.js TypeScript app and wire in NxPage.
Why use this CLI
This package gives you a fast way to start a Next.js app that can serve optimized JSON responses to AI agents (ChatGPT/OpenAI, Claude, Perplexity, and others) using nxpage.
It helps you quickly adopt a dual-delivery model:
- normal users -> regular Next.js HTML
- AI agents -> lightweight NxPage JSON (when route filters allow)
Usage
npx create-nxpage-app my-appWhat the CLI does
- Creates a Next.js app with TypeScript and App Router.
- Installs
nxpage. - Adds
server.tsfrom template. - Updates scripts in generated
package.json:dev:next devbuild:next build && nxpage buildstart:NODE_ENV=production node server.js
After scaffold (recommended)
- Open generated
server.ts. - Configure:
includeRoutePatternsblockRoutePatterns
- Build app and run production server.
This setup can reduce agent-response transfer volume dramatically (often large savings, up to ~99% in favorable cases).
Template Files
templates/server.tstemplates/next.config.ts
These are copied into generated app output (via build pipeline).
Local Development (Monorepo)
cd newupdate/packages/create-nxpage-app
npm install
npm run buildPublish Notes
This package ships:
dist/index.cjsdist/templates/*
