Next-Level Express Application Generator: Quickly create Express.js apps with useful tools, a clean project structure, and ready-to-use features.
Created by Xeron07
- Interactive mode for guided project setup
- View engine & CSS engine support (like
express-generator) - TypeScript or JavaScript support
- Presets for API, fullstack, microservices, startup apps
- Production flags: Docker, Swagger, Redis, Auth, Testing
- Minimal or full-featured project scaffolding
- Built-in config and preset commands
git clone <https://github.com/Xeron07/exgen-cli.git>
cd exgen-cli
# Install dependencies
npm install
# Run in development mode
npm run dev
# Build the project
npm run build
# Link globally to use `exgen` as a command
npm link
exgen [project-name] [options]
exgen my-api --ts --mongo --swagger --docker --auth
or interactively:
exgen --init
| Flag | Description |
|---|---|
--init |
Start in interactive prompt |
-v, --version |
Show CLI version |
-h, --help |
Show help message |
| Flag | Description |
|---|---|
--view <engine> |
Add view engine (e.g. ejs, pug, hbs) |
--css <style> |
Add CSS engine (e.g. sass, less) |
--no-view |
Skip view engine |
--git |
Include .gitignore |
| Flag | Description |
|---|---|
--ts, --typescript |
Use TypeScript |
--js, --javascript |
Use JavaScript (default) |
| Flag | Adds... |
|---|---|
--swagger |
Swagger/OpenAPI |
--docker |
Docker + Compose |
--mongo, --mongodb |
MongoDB + Mongoose |
--pg, --postgres |
PostgreSQL + Sequelize |
--redis |
Redis support |
--test |
Jest + Supertest |
--elk |
Logging with Winston + Elasticsearch |
--auth |
JWT authentication |
--cors |
CORS middleware |
--helmet |
Helmet for security |
--rate-limit |
Rate limiter |
--validation |
Joi validation |
| Preset | Includes |
|---|---|
--api |
TypeScript, CORS, Helmet, Validation, Test |
--fullstack |
View, CSS, Auth, MongoDB, Test |
--microservice |
TypeScript, Docker, Redis, Test, ELK |
--startup |
TypeScript, MongoDB, Auth, Swagger, Docker, Test |
| Flag | Description |
|---|---|
--light |
Essentials only (no DB/Docker/Swagger) |
--all |
All core features except DB/Docker/Swagger |
--prod |
Full production setup (Docker, Swagger, ELK, Tests) |
--min |
Minimal production setup (no Docker/Swagger) |
| Flag | Description |
|---|---|
--skip-install |
Don’t run npm install |
--skip-git |
Don’t initialize git |
--verbose |
Verbose logs |
--dry-run |
Show what would be generated |
The project structure generated by exgen is modular, clean, and suited for real-world applications:
(root)/
├── src/
│ ├── api/
│ │ ├── routes/ # Route definitions (modular per resource)
│ │ └── middleware/ # Express middleware (auth, validation, logging)
│ ├── config/ # Environment and app configuration
│ ├── models/ # Mongoose/Sequelize schemas/models
│ ├── services/ # Business logic, service layers
│ └── utils/ # Reusable helpers and utilities
├── views/ # View templates (e.g. EJS, Pug) if `--view` used
├── public/ # Static assets served directly
│ ├── stylesheets/ # CSS or preprocessor files
│ ├── javascripts/ # Static frontend scripts
│ └── images/ # Public images
├── bin/
│ └── www # App entrypoint (like express-generator)
├── Dockerfile # If `--docker` is used
├── docker-compose.yml # For dockerized multi-service setups
├── swagger.yaml # Swagger/OpenAPI docs (if `--swagger`)
├── .env # Environment variables (auto created)
├── .gitignore # If `--git` or defaulted
├── package.json # Project metadata and scripts
└── README.md
Manage CLI-wide settings.
exgen config
List or manage available presets.
exgen presets
Show debugging information about your environment.
exgen info
npm run test
npm run test:watch
- 📘 Express.js: https://expressjs.com/
- 🐳 Docker: https://www.docker.com/
- 📚 Swagger/OpenAPI: https://swagger.io/specification/
- ⚙️ Joi Validation: https://joi.dev/
- 🧪 Jest Testing: https://jestjs.io/
MIT
© Xeron07
- Found a bug? Open an issue
- Want to contribute? PRs welcome!