mintshell
Mintshell is a Java library which allows to provide Java applications with a comfortable, interactive command line shell in a very easy way. MINT stands for Multiple INTerface. This means, that commands can be provided by many different interfaces to control the (same) application. By default there are several kinds of interfaces available, including terminal-based interfaces (Console, SSH) and network-based interfaces (REST/HTTP). Because of mintshell's open architecture it's easily possible to extend or replace components - especially interfaces - with custom implementations.
Features
- Easy to use builder pattern (one-liner)
- Console interface (supporting single keys through native lib)
- SSH interface (currently without security mechanisms)
- Reflection dispatcher (for foreign classes)
- Annotation support (for comfortable command configuration)
Note: mintshell requires Java 8
Roadmap
0.1.0 (first release, planned yet in 2017)
- Grammar-based command interpreter
- Command history in terminal-based command interfaces
- Command help support
- Native libs for OSX/Linux
0.2.0
- Native libs for further Linux distributions
- Native libs for Windows
- Command pipe support
- Subshells
- Autocompletion
Overview
The basic concept consists of four main components which are arranged as kind of a pipeline:
CommandInterface -> CommandInterpreter -> CommandDispatcher -> CommandTarget
TODO: picture
Command Interface
The CommandInterface is a somehow natured technical interface, that is able to accept command lines. Usually command lines are strings consisting of a command and optionally one or more parameters. However, this is not a hard requirement, because the only important thing is that the used CommandInterpreter is able to understand the accepted kind of command line.
Command Interpreter
The CommandInterpreter is responsible to transform an accepted command line into a Command object, that is provided to the CommandDispatcher in order to be executed.
Command Dispatcher
The CommandDispatcher manages one ore more CommandTargets and is responsible to dispatch incoming Commands to the corresponding CommandTarget or in other words to execute a Command "upon" the CommandTarget.
Command Target
_CommandTarget_s are components that finally execute a Command. All preceeding components are only responsible to accept, transform and prepare a command line in such a way, that it becomes executable at the CommandTarget. Usually a CommandTarget is an arbitrary Java class or Java object, which methods are mapped to Commands and thereby are accessible for a user through the CommandInterface. However, this concept is also replacable by custom implementations.
About Commands
TODO