CLI Reference
next-modular init
Initialize next-modular in an existing Next.js App Router project.
npx next-modular initCreates catch-all routes, middleware proxy, modules config, runtime file, and a modules/ directory. Detects your package manager and installs next-modular automatically.
Options:
--yes/-yNon-interactive mode, installs all features--directory/-dTarget directory (defaults to current)
next-modular add
Add a module from the registry to your project.
npx next-modular addShows an interactive list of available modules from the registry. Installs the npm package and provides instructions for registering it in modules.config.ts.
next-modular create
Scaffold a new local module with boilerplate.
npx next-modular create my-moduleCreates modules/my-module/ with:
src/index.tsModule definition withdefineModule()src/routes/Example page componentssrc/server/api/Example API handlerssrc/server/middleware.tsExample middlewarepackage.jsonandREADME.md
Last updated on