spring-feature-cli
v0.2.2
Published
CLI para generar features de Spring Boot
Maintainers
Readme
spring-feature-cli
spring-feature-cli is a Node.js CLI tool that generates Spring Boot feature-based boilerplate using templates.
It helps automate the creation of common backend layers such as entities, services, repositories, and controllers following a clean and consistent structure.
Purpose
This project was built to:
- Practice building real-world CLI tools with Node.js
- Learn
commander,inquirer, andhandlebars - Automate repetitive Spring Boot boilerplate generation
- Apply feature-based architecture patterns
⚙️ Installation
Global installation (recommended)
npm install -g spring-feature-cliLocal usage (development)
npm install
npm run devUsage
Generate a Spring Boot feature:
spfc generate Useror
spfc g User This will generate a full structure for the feature (Entity, Repository, Service, Controller).
🧱 Generated Structure
The CLI generates:
- Entity
- Repository
- Service
- Controller
All based on Handlebars templates and a consistent naming convention.
📁 Project Structure
bin/index.js→ CLI entry pointsrc/index.js→ Main CLI logicsrc/commands/→ Command definitionssrc/actions/→ Generation logicsrc/validations/→ Input validation layersrc/utils/→ Helpers (logging, scanning, template compilation, etc.)src/templates/→ Handlebars templates for generated code
🧰 Key Dependencies
commander→ CLI command handlinginquirer→ Interactive promptshandlebars→ Template enginechalk→ Terminal styling
⚠️ Requirements
- Node.js >= 16
💡 Notes
This tool assumes a Spring Boot project structure and is intended to be used inside a backend project where Java packages are detected automatically.
📄 License
MIT
