Русская версия / Russian version
bogo create app — Express + TypeScript project in 10 seconds.
bogo g users — controller, service, dto, routes, validator in one command.
bogo r users — remove a module and clean up the index file.
CLI generator for Express API. Works in any repository — configured via .bogorc.json.
npx @bogomolcompany/bogo create app
cp .env.example .env
npm install
npm run dev
npx bogo g users -m getList -m createUser| NestJS CLI | express-generator | bogo | |
|---|---|---|---|
| Express without a framework | — | ✓ | ✓ |
| TypeScript out of the box | ✓ | — | ✓ |
| DTO + Zod validator | ✓ | — | ✓ |
| Starter project (server, logger, middleware) | partial | — | ✓ |
| Minimal dependencies | — | ✓ | ✓ |
| Generate into an existing project | ✓ | — | ✓ |
bogo is for teams using plain Express + TypeScript who are tired of copying the same file structure every time.
npm install -g @bogomolcompany/bogo
# or locally
npm install --save-dev @bogomolcompany/bogo
npx bogo --helpFrom source:
git clone https://github.com/bogomolcomp/bogo.git
cd bogo
npm install
npm run build
npm linkbogo create app my-api --with-docker --with-eslintOr into a subdirectory:
bogo create app my-api
cd my-apiCreates:
package.json
tsconfig.json
.env.example
.bogorc.json
src/
index.ts
types/express.d.ts
middlewares/
logger.ts
formatResponse.ts
validate.ts
utils/
getAllowedIps.ts
api/
Includes: dotenv, body-parser, logger, formatResponse, IP whitelist (ALLOWED_IPS), /health, global error handler.
cp .env.example .env
npm install
npm run devcd /path/to/your-express-app
bogo initCreates .bogorc.json:
{
"apiDir": "src/api",
"indexFile": "src/index.ts",
"routePrefix": "/api",
"templatesDir": "./bogo-templates"
}templatesDir is optional. Place controller.template, service.template, etc. to override built-in templates.
bogo g analytics -m getStats -m getReport
bogo g orders -m createOrder:POST:/create -m getOrder:GET:/:id
bogo g posts -m getList:GET:/list -w authCreates:
src/api/analytics/
analytics.controller.ts
analytics.service.ts
analytics.dto.ts
analytics.validator.ts
analytics.routes.ts
Automatically appends import and app.use to src/index.ts when the file exists.
bogo g controller users -m getList
bogo g service users -m getList
bogo g dto users -m getList -m createUser
bogo g validator users -m getList
bogo g routes users -m getList:/listParts: controller, service, dto, validator, routes.
The module folder is created if it does not exist. Generating routes updates the index file the same way as a full module.
bogo r controller users
bogo r routes usersbogo g method users -m getList
bogo g method users -m createUser -m updateUser:/:idAdds the method to all existing module files: controller, service, dto, validator, routes.
Specific parts only:
bogo g method users -m getList -p controller
bogo g method users -m getList -p controller -p service -p dto-m is required. -p is optional — without it, all found files are updated.
bogo r method users -m getList
bogo r method users -m createUser -p controller -p servicebogo listbogo doctorChecks .bogorc.json, index file, api directory, and required middleware.
bogo g --interactivebogo r analytics
bogo r orders --skip-indexRemoves the module folder and cleans up import + app.use in the index file.
| Example | Result |
|---|---|
getList |
POST /get-list |
getList:GET |
GET /get-list |
getOrder:GET:/:id |
GET /:id |
createOrder:POST:/create |
POST /create |
| Flag | Description |
|---|---|
-m, --method |
Method spec (repeatable). See table above |
-p, --part |
Target a specific part |
-w, --middleware |
Route middleware name (repeatable) |
-i, --interactive |
Interactive generate |
--dry-run |
Preview changes without writing |
--force |
Overwrite existing files |
--skip-index |
Do not patch the index file |
--with-docker |
Add Docker files to create app |
--with-eslint |
Add ESLint to create app |
- Express + TypeScript
- Zod for validation
validatemiddleware atsrc/middlewares/validateres.success/res.errorvia response middleware
bogo create app scaffolds all of the above.
npm run build
npm test
npm run dev -- create app ./tmp-app --with-eslint
npm run dev -- g test -m getList:GET
npm run dev -- g method test -m createUser
npm run dev -- r method test -m createUser
npm run dev -- list
npm run dev -- doctor- npm: https://www.npmjs.com/package/@bogomolcompany/bogo
- GitHub: https://github.com/bogomolcomp/bogo
- Issues / feedback: https://github.com/bogomolcomp/bogo/issues
npm publish --otp=YOUR_CODEMIT
