The source is available at http://code.google.com/p/java-cli-api/. It is not yet in the Maven Central Repository, but I did post the initial 0.0.1 release on the Downloads page if you do not want to check out the source.
If anyone has comments/critiques on it, I would love to hear them.
The Java CLI API provides a framework for starting, looping and executing a command line interface. It allows for annotations to determine which commands to load, and it handles the discovery and execution of the commands.
The goal of the CLI API is to make it as easy as possible for a developer to create and maintain a command line application that accepts user input and executes commands.
Some features of the API:
- Tab auto completion of commands (integrated with JLine).
- Automatic discovery of commands via annotations.
- Automatic initialization of application via annotations.
- Automatic injection of command line arguments into Command classes via annotations (integrated with JCommander).
- API handles looping across user input and executing the correct commands.
- Application and Commands persist state via the CLIContext.
- A sample command can be found at AddUserCommand.java.
I encourage anyone to look at the Sample CLI Client to see how this may be used.