/acolyte

Acolyte is a command-line tool designed to boost your productivity in Spring Boot projects by automating the creation of common boilerplate code.

Primary LanguageJava

Acolyte โ€” Spring Boot Code Generator CLI

Acolyte is a command-line tool designed to boost your productivity in Spring Boot projects by automating the creation of common boilerplate code. It helps maintain a clean and standardized package structure, making your development process faster, more consistent, and less error-prone.

It supports generating entities, services, repositories, controllers, views, configuration files, and more โ€” all with a single command.

screenshots

๐Ÿš€ Available Commands

๐Ÿ“ฆ Make Entity

Generates a JPA entity class with a basic structure.

java acolyte make:entity <Entity-Name>
# Example:
java acolyte make:entity User

๐Ÿ‘๏ธ Make View

Creates a Thymeleaf view file with the specified name.

java acolyte make:view <view-name>
# Example:
java acolyte make:view user-list

๐ŸŽฎ Make Controller

Generates a Spring controller class. You can optionally scaffold common REST methods using --resource.

java acolyte make:controller <Controller-Name> [--resource <methods>]

# Examples:
java acolyte make:controller UserController
java acolyte make:controller UserController --resource
java acolyte make:controller UserController --resource index save destroy

๐Ÿ“„ Make DTO or POJO

Creates a Data Transfer Object or plain Java class.

java acolyte make:dto <Dto-Name>
# Example:
java acolyte make:dto UserDto

๐Ÿ› ๏ธ Make Service

Generates a service class and optionally an interface following the service pattern.

java acolyte make:service <Service-Name>
# Example:
java acolyte make:service UserService

๐Ÿ—ƒ๏ธ Make Repository

Creates a JPA repository interface for a given entity.

java acolyte make:repository <Entity-Name>
# OR
java acolyte make:repo <Entity-Name>

# Example:
java acolyte make:repo User

โš™๏ธ Make Configuration

Creates a configuration class annotated with @Configuration.

java acolyte make:configuration <Config-Class-Name>
# OR
java acolyte make:config <Config-Class-Name>

# Example:
java acolyte make:config WebConfig

โœ… Make Validator

Creates a custom validator class and links it to a DTO for form validation.

java acolyte make:validator <Validator-Class-Name> --dto=<Dto-Class-Name>
# Example:
java acolyte make:validator UserValidator --dto=UserDto

๐ŸŽง Make Listener

Generates an entity listener for lifecycle callbacks.

java acolyte make:listener <Listener-Class-Name>
# Example:
java acolyte make:listener UserListener

Usage in Entity:

@EntityListeners(UserListener.class)
public class User {
    // fields
}

๐Ÿงฉ Make Fragment / Component

Generates a reusable Thymeleaf HTML fragment/component.

java acolyte make:fragment <fragment-path>
# OR
java acolyte make:component <component-path>

# Example:
java acolyte make:fragment admin/layout/header
java acolyte make:component admin/layout/header

Usage in Thymeleaf:

<th:block th:replace="~{/admin/layout/header :: header}"></th:block>

๐Ÿ“š Benefits of Using Acolyte

  • โœ… Eliminate repetitive code writing
  • โœ… Maintain consistent folder structure
  • โœ… Focus on business logic, not scaffolding
  • โœ… Easy integration with any Spring Boot project
  • โœ… Supports modular architecture and reusability

๐Ÿงช Coming Soon

Here are the upcoming features planned for Acolyte CLI to make it even more powerful and developer-friendly:

  • make:model โ€“ Generate Entity, DTO, Repository, Service, and Controller in one shot.
  • make:test โ€“ Create test classes for services, controllers, or repositories using JUnit.
  • make:request โ€“ Generate form request classes with built-in validation annotations.
  • make:enum โ€“ Create a type-safe Enum with custom values.
  • make:interceptor โ€“ Scaffold Spring's HTTP interceptor for custom middleware.
  • make:resource โ€“ Generate a standardized API response wrapper class.
  • make:scheduler โ€“ Create a class with a @Scheduled job using cron expression.
  • make:runner โ€“ Create a class that runs logic on app startup via CommandLineRunner.
  • make:exceptionhandler โ€“ Scaffold a global exception handler with @ControllerAdvice.
  • make:configprops โ€“ Generate @ConfigurationProperties class for binding custom configs.
  • wizard โ€“ Interactive CLI flow to build modules step-by-step.
  • custom templates โ€“ Allow users to plug in their own code templates.
  • i18n support โ€“ Generate language properties files for multi-language apps.
  • thymeleaf-page โ€“ Scaffold Thymeleaf pages like forms or lists with mock data bindings.

Feel free to contribute or suggest features to make Acolyte even more powerful!