Take a look at Spring Shell
Spring Shell’s features include
- A simple, annotation driven, programming model to contribute custom commands
- Use of Spring Boot auto-configuration functionality as the basis for a command plugin strategy
- Tab completion, colorization, and script execution
- Customization of command prompt, shell history file name, handling of results and errors
- Dynamic enablement of commands based on domain specific criteria
- Integration with the bean validation API
- Already built-in commands, such as clear screen, gorgeous help, exit
- ASCII art Tables, with formatting, alignment, fancy borders, etc.