Generate components
Run component commands from a generated project. springboot-cli locates the project config from the current directory or one of its parents.
Add one component
springboot-cli add controller --name Product
springboot-cli add service --name ProductSupported component kinds are controller, service, repository, entity, dto, config, listener, and exception. If --name is omitted, the CLI prompts for a name.
| Option | Description |
|---|---|
-n, --name <name> | Logical component name. |
-f, --force | Overwrite the generated file if it already exists. |
Names are converted to Java class names and component-specific suffixes are appended. For example, product generates ProductController, ProductService, or ProductRepository. Controllers also receive a kebab-case @RequestMapping, such as /product.
The templates provide a class and relevant Spring annotation where applicable. They do not implement business logic, repository persistence, or CRUD behavior for you.
Scaffold a CRUD set
springboot-cli scaffold productscaffold creates five files for the resource: entity, DTO, repository, service, and controller. Use --name to choose a different logical name, and --force to overwrite existing generated files:
springboot-cli scaffold product --name CatalogItem --forcescaffold creates starter classes; it does not generate CRUD methods or connect the classes together.
Make JPA entities from a schema
For table mappings, fields, and relationships, use schema apply instead of the plain entity skeleton from add or scaffold.