A few days ago I came across a module I didn't know about from Spring. This Spring module is designed for creating shell-type applications. More information about the framework can be found at the following link: https://spring.io/projects/spring-shell
First Impressions
The truth is that it looks interesting, especially thinking about small utilities we might want to make for personal use, which we can run locally. For example, a utility to delete a specific record from a database repeatedly—that is, when we usually delete the same record. In that case, the possibility of having a script implemented with this type of tool could be very interesting.
The truth is that it's quite easy to tinker with, and in a simple way, using Spring Initializr and a few methods and annotations, we have our first shell-type tool.
You can find the different tests I've been doing in this repository: https://github.com/chintoz/hello-spring-shell
Interesting Points
After playing around with this module, I've seen the following interesting points:
- It offers a set of default commands. Among these commands, it offers the possibility to show help for these commands, and the command is able to identify the commands we've added to show the help.
- It is able to link commands so that we can execute them in a linked manner. For example, a command to connect and another to download. The download one is only available when the connect one has been successfully executed.
- It allows customizing input parameters with different ways of receiving them (parameter by parameter, or an array of parameters).
- It allows customizing the shell so that we can make changes to the shell text based on the commands executed.
The truth is that it is a very interesting module if you like tinkering with scripts. Honestly, when I have the chance, I will try to use it.