A powerful CLI tool to accelerate Next.js development by scaffolding features, components, and more with a single command.
Next.js App Toolkit is a command-line interface (CLI) designed to supercharge your Next.js development workflow. Eliminate repetitive boilerplate setup and generate feature-rich modules instantly, allowing you to focus on building core application logic.
- Rapid Scaffolding: Generate entire feature modules, including hooks, services, state management, types, and configs, with a single command.
- Best Practices Included: The generated code follows modern Next.js App Router conventions, including templates for Server Actions, revalidateTagfor caching, and React Query hooks.
- Type-Safe by Default: All generated files are TypeScript-based to ensure type safety from the ground up.
- Developer-Friendly: Provides a simple and intuitive command structure that's easy to remember and use.
- Extensible Architecture: Designed to be easily expanded with new generators for components, styles, contexts, and more.
- 
Clone the Repository: git clone https://github.com/isweerasingha/nextjs-app-toolkit.git cd nextjs-app-toolkit
- 
Install Dependencies: npm install 
- 
Build the Project: The build command compiles all TypeScript source files to JavaScript in the dist/folder and copies the necessary template files.npm run build 
- 
Link for Local Testing: This command makes your local version of the toolkit available as a global command on your system. npm link After linking, any changes you make to the source code will be active after you run npm run buildagain.
Navigate to the root directory of any Next.js project in your terminal and run the toolkit's commands.
next-toolkit gen:feature paymentThis command will instantly create a new, fully structured module inside your project.
The command above creates the following directory and files at app/features/payment/:
app/features/payment/
├── config/
│   └── tags.ts
├── hooks/
│   └── usePaymentList.ts
├── services/
│   └── paymentService.ts
├── state/
│   └── paymentSlice.ts
├── types/
│   └── paymentTypes.ts
└── index.ts
| Command | Alias | Description | 
|---|---|---|
| gen:feature <name> | gf | Generates a new, fully-featured module in app/features/. The<name>should be singular (e.g.,product,user). | 
| gen:component <name> | gc | (Coming Soon) Generates a React component file. | 
| init:redux | (Coming Soon) Sets up Redux Toolkit and a provider for the project. | 
Contributions are welcome! If you'd like to help improve the toolkit, please follow these steps to set up a local development environment.
This project is maintained by Isuru Weerasingha.
- GitHub: @isweerasingha
- LinkedIn: linkedin.com/in/isweerasingha
This project is licensed under the GNU General Public License v3.0. See the LICENSE file for the full license text.