{"id":25655024,"url":"https://github.com/xRiot45/express-js-cli","last_synced_at":"2026-07-01T12:30:18.938Z","repository":{"id":277480409,"uuid":"932554419","full_name":"xRiot45/express-cli","owner":"xRiot45","description":"Express API CLI is a Command Line Interface (CLI) tool designed to make it easier and faster to create RESTful API projects using Express JS.","archived":false,"fork":false,"pushed_at":"2025-02-21T14:24:28.000Z","size":7937,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-21T14:35:12.149Z","etag":null,"topics":["cli","expressjs","javascript","node-js","rest-api","typescript"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xRiot45.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-14T05:15:44.000Z","updated_at":"2025-02-21T14:24:31.000Z","dependencies_parsed_at":"2025-02-21T14:29:39.866Z","dependency_job_id":null,"html_url":"https://github.com/xRiot45/express-cli","commit_stats":null,"previous_names":["xriot45/express-cli"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xRiot45%2Fexpress-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xRiot45%2Fexpress-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xRiot45%2Fexpress-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xRiot45%2Fexpress-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xRiot45","download_url":"https://codeload.github.com/xRiot45/express-cli/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240379438,"owners_count":19792133,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","expressjs","javascript","node-js","rest-api","typescript"],"created_at":"2025-02-23T21:19:02.246Z","updated_at":"2026-07-01T12:30:16.875Z","avatar_url":"https://github.com/xRiot45.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Image](https://github.com/user-attachments/assets/8a41d03d-1d59-4720-bd1e-ec5643ac960d)\n\n\u003cbr /\u003e\n\n\u003cdiv align=\"center\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/node.js-339933?style=for-the-badge\u0026logo=Node.js\u0026logoColor=white\" alt=\"node.js\" /\u003e\n    \u003cimg src=\"https://img.shields.io/badge/express.js-000000?style=for-the-badge\u0026logo=express\u0026logoColor=white\" alt=\"express.js\" /\u003e\n    \u003cimg src=\"https://img.shields.io/badge/JavaScript-F7DF1E?style=for-the-badge\u0026logo=javascript\u0026logoColor=black\" alt=\"javascript\" /\u003e\n  \u003c/div\u003e\n\n\u003ch2 align=\"center\"\u003eExpress JS CLI\u003c/h2\u003e\n\n\u003cdiv align=\"center\"\u003e\nExpress API CLI is a Command Line Interface (CLI) tool designed to make it easier and faster to create RESTful API projects using Express JS.\n\u003c/div\u003e\n\n\u003cbr /\u003e\n\n- **Version :** v1.0.0\n- **Developer :** Thomas Alberto\n- **Released On :** February 2025\n- **Status :** Stable Release\n\n\u003cbr /\u003e\n\n## 📋 Table of Contents\n\n1. 🤖 [Introduction](#-introduction)\n2. ⚙️ [Tech Stack](#-tech-stack)\n3. 🔋 [Features](#-features)\n4. 🤸 [Quick Start](#-quick-start)\n5. 📜 [CLI Usage](#-cli-usage)\n6. 🕸️ [Snippets](#-snippets)\n7. 🔗 [Links](#-links)\n\n\u003cbr /\u003e\n\n## 🤖 Introduction\n\n**Express API CLI** is a Command Line Interface (CLI) tool designed to make it easier and faster to create **RESTful API** projects using **Express JS**. With this CLI, developers can immediately create a neat project structure, install the necessary dependencies, and configure various key features according to user preferences without having to do time-consuming manual setup.\n\nExpress API CLI comes as a solution for developers who want to save time in the initialization stage of backend projects using Express.js. With support for programming language selection (JavaScript or TypeScript), database configuration (MySQL or PostgreSQL), as well as tools such as Prettier for code formatting and Husky \u0026 Commitlint for commit standardization, this CLI is designed so that developers can focus directly on developing business features without worrying about the initial technical setup.\n\nThis tool is perfect for beginners who want to start projects quickly as well as for development teams who want to maintain standards and consistency in their projects. With just a few simple commands, Express.js projects are ready to go with a structure that conforms to best practices.\n\n\u003cbr /\u003e\n\n## ⚙️ Tech Stack\n\n- **Node JS** : JavaScript runtime for the server.\n- **Express JS** : Minimalist framework for the backend.\n- **JavaScript** : Programming Language.\n\n\u003cbr /\u003e\n\n## 🔋 Features\n\n✅ **Multi-Language Support** : Choose between JavaScript or TypeScript.\n\n✅ **Database Support** : Choose between MySQL or PostgreSQL.\n\n✅ **ORM (Object Relational Mapping) Support** : For now using Sequelize ORM\n\n✅ **Prettier Integration** : Automatically organize code with Prettier.\n\n✅ **ESLint Integration** : Maintain code quality with static analysis.\n\n✅ **Commit Linter** : Comes with Husky \u0026 Commitlint.\n\n✅ **Automated Project Structure** : Generates ready-to-use project structure.\n\n✅ **Initialize Git Repository** : Automatically initializes the Git repository.\n\n✅ **Quick Installation** : All major and development dependencies are instantly installed.\n\n\u003cbr /\u003e\n\n## 🤸 Quick Start\n\nFollow these steps to set up the project locally on your machine\n\n**1. Prerequisites**\n\nMake sure you have the following installed on your machine:\n\n- [Git](https://git-scm.com/)\n- [Node.js](https://nodejs.org/en)\n- [npm](https://www.npmjs.com/) (Node Package Manager)\n\n**2. Instalation**\n\n```bash\n$ npm i express-api-cli-tool\n```\n\n**3. Create new project**\n\n```bash\n$ express new \u003cproject-name\u003e\n```\n\n**4. Follow the instructions**\n\n- **Choose Language** : JavaScript / TypeScript\n- **Choose Database** : MySQL / PostgreSQL\n- **Use Eslint for code linting?** : Y / n\n- **Use Husky and Commit lint for commit linting?** : Y / n\n- **Initialize Git repository?** : Y / n\n\n**5. Running your project**\n\n```bash\n# Change directory to your project\n$ cd \u003cyour-project\u003e\n\n# Format the code before running the project (optional)\n$ npm run format\n\n# Running your project\n$ npm run dev\n```\n\n\u003cbr /\u003e\n\n## 📜 CLI Usage\n\n**To view the list of available commands, use the following command**\n\n```bash\n$ express -h\n```\n\n**Output:**\n\n```\nUsage: express [options] [command]\n\nOptions:\n  -v, --version                     Display the current version of express-cli\n  -i, --info                        Display information about express-cli\n  -h, --help                        display help for command\n\nCommands:\n  new \u003cproject-name\u003e                Create a new Express.js API project\n  generate \u003cschematic\u003e \u003cfile-name\u003e  Generate a new file based on a schematic\n  update                            Update express-cli to the latest version\n\nSchematics:\n  controller   Generate a new controller file\n  service      Generate a new service file\n  route        Generate a new route file\n  repository   Generate a new repository file\n  validation   Generate a new validation file\n  model        Generate a new model file\n  interface    Generate a new interface file (if using TypeScript)\n  types        Generate a new types file (if using TypeScript)\n  resources    Generate a new resources file (CRUD)\n  config       Generate a new config file\n  middleware   Generate a new middleware file\n  util         Generate a new util file\n```\n\n\u003cbr /\u003e\n\n## 🕸️ Snippets\n\n**Code Service**\n\n- JavaScript\n\n```javascript\nconst get = async () =\u003e {\n  // Implement your logic get data here\n  return [];\n};\n\nconst getById = async (id) =\u003e {\n  // Implement your logic get data by id here\n  return null;\n};\n\nconst create = async (data) =\u003e {\n  // Implement your logic create data here\n  return null;\n};\n\nconst update = async (id, data) =\u003e {\n  // Implement your logic update data here\n  return null;\n};\n\nconst remove = async (id) =\u003e {\n  // Implement your logic remove data here\n  return false;\n};\n\nexport default { get, getById, create, update, remove };\n```\n\n- TypeScript\n\n```typescript\nimport testInterface from '../interfaces/test.interface.ts';\n\nconst get = async (): Promise\u003ctestInterface[]\u003e =\u003e {\n  // Implement your logic to get data here\n  return [];\n};\n\nconst getById = async (id: string): Promise\u003ctestInterface | null\u003e =\u003e {\n  // Implement your logic to get data by id here\n  return null;\n};\n\nconst create = async (data: testInterface): Promise\u003ctestInterface\u003e =\u003e {\n  // Implement your logic to create data here\n  return data;\n};\n\nconst update = async (\n  id: string,\n  data: Partial\u003ctestInterface\u003e,\n): Promise\u003ctestInterface | null\u003e =\u003e {\n  // Implement your logic to update data here\n  return null;\n};\n\nconst remove = async (id: string): Promise\u003cboolean\u003e =\u003e {\n  // Implement your logic to remove data here\n  return false;\n};\n\nexport default { get, getById, create, update, remove };\n```\n\n**Code Controller**\n\n- JavaScript\n\n```javascript\nconst get = async (req, res, next) =\u003e {\n  try {\n    // Implement your logic get data here\n  } catch (error) {\n    next(error);\n  }\n};\n\nconst getById = async (req, res, next) =\u003e {\n  try {\n    // Implement your logic get data by id here\n  } catch (error) {\n    next(error);\n  }\n};\n\nconst create = async (req, res, next) =\u003e {\n  try {\n    // Implement your logic create data here\n  } catch (error) {\n    next(error);\n  }\n};\n\nconst update = async (req, res, next) =\u003e {\n  try {\n    // Implement your logic update data here\n  } catch (error) {\n    next(error);\n  }\n};\n\nconst remove = async (req, res, next) =\u003e {\n  try {\n    // Implement your logic remove data here\n  } catch (error) {\n    next(error);\n  }\n};\n\nexport default { get, getById, create, update, remove };\n```\n\n- TypeScript\n\n```typescript\nimport { Request, Response, NextFunction } from 'express';\n\nconst get = async (\n  req: Request,\n  res: Response,\n  next: NextFunction,\n): Promise\u003cvoid\u003e =\u003e {\n  try {\n    // Implement your logic to get data here\n  } catch (error) {\n    next(error);\n  }\n};\n\nconst getById = async (\n  req: Request,\n  res: Response,\n  next: NextFunction,\n): Promise\u003cvoid\u003e =\u003e {\n  try {\n    // Implement your logic to get data by id here\n  } catch (error) {\n    next(error);\n  }\n};\n\nconst create = async (\n  req: Request,\n  res: Response,\n  next: NextFunction,\n): Promise\u003cvoid\u003e =\u003e {\n  try {\n    // Implement your logic to create data here\n  } catch (error) {\n    next(error);\n  }\n};\n\nconst update = async (\n  req: Request,\n  res: Response,\n  next: NextFunction,\n): Promise\u003cvoid\u003e =\u003e {\n  try {\n    // Implement your logic to update data here\n  } catch (error) {\n    next(error);\n  }\n};\n\nconst remove = async (\n  req: Request,\n  res: Response,\n  next: NextFunction,\n): Promise\u003cvoid\u003e =\u003e {\n  try {\n    // Implement your logic to remove data here\n  } catch (error) {\n    next(error);\n  }\n};\n\nexport default { get, getById, create, update, remove };\n```\n\n**Code Router**\n\n- JavaScript\n\n```javascript\nimport { Router } from 'express';\nimport testController from '../controllers/test.controller.js';\n\nconst testRouter = Router();\n\ntestRouter.get('/', testController.get);\ntestRouter.get('/:id', testController.getById);\ntestRouter.post('/', testController.create);\ntestRouter.put('/:id', testController.update);\ntestRouter.delete('/:id', testController.remove);\n\nexport default testRouter;\n```\n\n- TypeScript\n\n```typescript\nimport { Router } from 'express';\nimport testController from '../controllers/test.controller.ts';\n\nconst testRouter: Router = Router();\n\ntestRouter.get('/', testController.get);\ntestRouter.get('/:id', testController.getById);\ntestRouter.post('/', testController.create);\ntestRouter.put('/:id', testController.update);\ntestRouter.delete('/:id', testController.remove);\n\nexport default testRouter;\n```\n\n**Code Model**\n\n- JavaScript \u0026 TypeScript\n\n```javascript\nimport sequelize from '../configs/sequelize.config.js';\n\nconst testModel = sequelize.define('test', {\n  // Define your model attributes here\n});\n\nexport default testModel;\n```\n\n**Code Repository**\n\n- JavaScript\n\n```javascript\nimport testModel from '../models/test.model.js';\n\nconst getAllData = async () =\u003e await testModel.findAll();\n\nconst getDataById = async (id) =\u003e await testModel.findByPk(id);\n\nconst createData = async (data) =\u003e await testModel.create(data);\n\nconst updateData = async (id, data) =\u003e {\n  await testModel.update(data, { where: { id } });\n  return await testModel.findByPk(id);\n};\n\nconst deleteData = async (id) =\u003e {\n  const data = await testModel.findByPk(id);\n  await testModel.destroy({ where: { id } });\n  return data;\n};\n\nexport default { getAllData, getDataById, createData, updateData, deleteData };\n```\n\n- TypeScript\n\n```typescript\nimport { Model, FindOptions } from 'sequelize';\nimport testModel from '../models/test.model.ts';\nimport testInterface from '../interfaces/test.interface.ts';\n\nconst getAllData = async (): Promise\u003cModel\u003ctestInterface\u003e[]\u003e =\u003e {\n  return await testModel.findAll();\n};\n\nconst getDataById = async (\n  id: number,\n): Promise\u003cModel\u003ctestInterface\u003e | null\u003e =\u003e {\n  return await testModel.findByPk(id);\n};\n\nconst createData = async (\n  data: Partial\u003ctestInterface\u003e,\n): Promise\u003cModel\u003ctestInterface\u003e\u003e =\u003e {\n  return await testModel.create(data);\n};\n\nconst updateData = async (\n  id: number,\n  data: Partial\u003ctestInterface\u003e,\n): Promise\u003cModel\u003ctestInterface\u003e | null\u003e =\u003e {\n  await testModel.update(data, { where: { id } });\n  return await testModel.findByPk(id);\n};\n\nconst deleteData = async (id: number): Promise\u003cModel\u003ctestInterface\u003e | null\u003e =\u003e {\n  const data = await testModel.findByPk(id);\n  if (data) {\n    await testModel.destroy({ where: { id } });\n  }\n  return data;\n};\n\nexport default { getAllData, getDataById, createData, updateData, deleteData };\n```\n\n**Code Validation**\n\n- JavaScript\n\n```javascript\nimport { z } from 'zod';\n\nconst testValidation = z.object({\n  // Implement your validation schema here\n});\n\nexport default testValidation;\n```\n\n- TypeScript\n\n```typescript\nimport { z } from 'zod';\n\nconst testValidation = z.object({\n  // Implement your validation schema here\n});\n\ntype testType = z.infer\u003ctypeof testValidation\u003e;\n\nexport { testValidation, testType };\n```\n\n**Code Middleware**\n\n- JavaScript\n\n```javascript\nconst testMiddleware = (req, res, next) =\u003e {\n  try {\n    // Implement your middleware logic here\n    next();\n  } catch (error) {\n    next(error);\n  }\n};\n\nexport default testMiddleware;\n```\n\n- TypeScript\n\n```typescript\nimport { Request, Response, NextFunction } from 'express';\n\nconst testMiddleware = (\n  req: Request,\n  res: Response,\n  next: NextFunction,\n): void =\u003e {\n  try {\n    // Implement your middleware logic here\n    next();\n  } catch (error) {\n    next(error);\n  }\n};\n\nexport default testMiddleware;\n```\n\n**Code Util**\n\n- JavaScript\n\n```javascript\nconst testUtil = () =\u003e {\n  // Implement your util logic here\n};\n\nexport default testUtil;\n```\n\n- TypeScript\n\n```typescript\nconst testUtil = (): void =\u003e {\n  // Implement your util logic here\n};\n\nexport default testUtil;\n```\n\n**Code Interface (Only using TypeScript)**\n\n```typescript\nexport default interface testInterface {\n  // Implement your interface here\n}\n```\n\n\u003cbr /\u003e\n\n## 🔗 Links\n\n- [ExpressJS](https://expressjs.com/)\n- [Git](https://git-scm.com/)\n- [Node.js](https://nodejs.org/en)\n- [npm](https://www.npmjs.com/) (Node Package Manager)\n- [Sequelize](https://sequelize.org/)\n- [TypeScript](https://www.typescriptlang.org/)\n- [Prettier](https://prettier.io/)\n- [ESLint](https://eslint.org/)\n- [Husky](https://typicode.github.io/husky/)\n- [Commitlint](https://commitlint.js.org/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FxRiot45%2Fexpress-js-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FxRiot45%2Fexpress-js-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FxRiot45%2Fexpress-js-cli/lists"}