exp-cli-gen
v1.0.5
Published
[](https://www.npmjs.com/package/exp-cli-gen) [](https://www.npmjs.com/package/exp-cli-gen) [:
npx exp-cli-gen <module-name>Usage
🏗️ Generate your first module
Run:
npx exp-cli-gen testFirst run example:
Need to install the following packages:
[email protected]
Ok to proceed? (y)
⠋ No Express project found. Cloning starter pack...
✔ Starter project cloned!
✔ Git logs removed!
📦 Installing dependencies...
🚀 Project setup complete.
🧩 Generating module: test...
✔ test.interface.ts created
✔ test.schema.ts created
✔ test.validation.ts created
✔ test.route.ts created
✔ test.controller.ts created
✔ test.service.ts created
✔ test.swagger.ts created
🔗 Route added to src/app/routes.ts
📘 Swagger doc added to src/swaggerOptions.ts
✨ Module 'test' created successfully!
📁 Generated Module Structure
Each generated module will contain the following files:
src/app/modules/<module-name>/
├── <module-name>.interface.ts
├── <module-name>.schema.ts
├── <module-name>.validation.ts
├── <module-name>.route.ts
├── <module-name>.controller.ts
├── <module-name>.service.ts
└── <module-name>.swagger.ts🔄 Add More Modules
Need another module? Just run:
npx exp-cli-gen productsIf the starter project already exists, it will skip cloning and directly add the new module.
Example output:
ℹ 📦 Starter folder already exists. Skipping clone.
📦 Dependencies already installed. Skipping npm install.
🧩 Generating module: products...
✔ products files created
✨ Module 'products' created successfully!
src/app/modules/products/
├── products.interface.ts
├── products.schema.ts
├── products.validation.ts
├── products.route.ts
├── products.controller.ts
├── products.service.ts
└── products.swagger.tsThen, refresh your Swagger docs at:
http://localhost:5000/docsYou’ll see your new routes automatically added.
⚙️ Configuration
After setup, update your .env file following the .env.example file in the starter project.
To start the server:
npm run devOpen Swagger documentation at:
http://localhost:5000/docs🧠 Tech Stack
- Express.js — Backend framework
- TypeScript — Strongly typed JavaScript
- Mongoose — MongoDB ORM
- Zod — Runtime schema validation
- Swagger — API documentation
- CLI (Node.js) — Command-line automation
🧩 Starter Pack Repository
This CLI uses the following base project as a starter:
💬 Author
Abu Mahid
⭐ Star this project
If you like this CLI, please give it a ⭐ on GitHub — it helps others discover it too! Thank you!
