@saumya-sarma/procli
v1.0.8
Published
CLI took for creating easy routes for Next.js
Maintainers
Readme
ProCLI — Next.js Page Generator
A fast, simple, and minimal CLI tool to generate Next.js route pages with .tsx, .jsx and .css files in one command — just like NestJS generators!
Features
- ✅ Instantly create route folders like
user/[id] - ✅ Generates
page.tsx,page.jsxandpage.cssfiles - ✅ Comes with boilerplate code
- ✅ Perfect for Next.js 13+ with App Router projects
⚙️ Usage
step 01: install the package as dev depedency
npm install -D @saumya-sarma/proclistep 02: In their package.json, add:
"scripts": {
"procli": "procli"
}step 03: Now you can run:
npm run procli home/[id]This will generate page.tsx and page.css at:
/src/app/home/[id]/page.tsx
/src/app/home/[id]/page.cssThe generated page.tsx will look like this:
"use client";
import "./page.css"
const Page = () => {
return (
<>
this is home/[id]
</>
);
};
export default Page;Available commands: | Command | Output | | ------------------------------------ | -------------------------------------------------------------- | | procli your/route | Generates page.tsx and page.css | | procli your/route-no-css | Generates page.tsx only | | procli your/route-interface | Generates page.tsx with interface boilerplate and page.css | | procli your/route-interface-no-css | Generates page.tsx with interface only | | procli your/route-jsx | Generates page.jsx and page.css | | procli your/route-jsx-no-css | Generates page.jsx only |
Additionally you can download it globally:
npm install -g @saumya-sarma/procliand you can use procli in any directory. Just use the command:
procli your/route👨💻 Author
Built with 💙 by Saumya Sarma
MIT License — Free for personal and commercial use.
