@edenxgt/forge-api
v1.0.10
Published
CLI for generating API project skeletons with multiple architecture options.
Downloads
32
Maintainers
Readme
⚡ Forge-API CLI
Forge-API CLI is a fast and easy tool to scaffold Node.js API projects.
Supports multiple architectures and both JavaScript and TypeScript.
📦 Features
- Scaffold API projects in TypeScript or JavaScript.
- Supports multiple architectures:
- Repository Pattern (
repo) - Clean Architecture (
clean) - MVC Pattern (
mvc) - Modular Pattern (
modular)
- Repository Pattern (
- Creates folder structure and demo files automatically.
- Initializes an npm project with scripts.
- Installs TypeScript dev dependencies automatically (
typescript,ts-node,@types/node). - Colorful CLI prompts using Inquirer and Chalk.
📁 Folder Structure
forge-api/
├── index.js
├── package.json
├── README.md
├── LICENSE
└── src/
├── architectures.js
├── cli.js
├── generator.js
├── templates.js
└── utils/
├── prompt.handler.js
└── cli-ui.js🚀 Installation
Install it globally:
npm i -g @edenxgt/forge-apior clone the repo and link it locally:
git clone https://github.com/eDenxGT/Forge-API-CLI.git ./forge-api
cd forge-api
npm link💻 CLI Commands & Flags
Commands
forge-api create— Create a new API project interactivelyforge-api new— Alias forcreate
Options / Flags
-h,--help— Show help message-v,--version— Show CLI version--info— Show full CLI info
Usage Examples
forge-api create
forge-api new
forge-api --help
forge-api -h
forge-api --version
forge-api -v
forge-api --info💻 Usage
Run the CLI:
forge-api createFollow the prompts:
- Enter your project name.
- Select the architecture.
- Choose the language (TypeScript recommended).
The CLI will:
- Generate folders and demo files.
- Initialize npm.
- Install TypeScript dependencies (if selected).
📂 Example Project Structure
For a Repository Pattern (repo) TypeScript project:
my-app/
├─ src/
│ ├─ index.ts
│ ├─ controllers/
│ │ └─ user.controller.ts
│ └─ services/
│ └─ user.service.ts
├─ package.json
├─ tsconfig.json
└─ node_modules/🛠 Scripts
Development (TypeScript/Javascript):
npm run dev⚡ Example Console Output
🚀 Your Project in (TS/JS) initialized!
📂 Architecture: Repository Pattern
✨ Enjoy building your API!👤 Author
eDenGt – 2025 Designed to make API scaffolding fast, fun, and simple.
