View on GitHub

mintshell

Multi-Interface Shell for Java applications

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

Note: mintshell requires Java 8

Roadmap

0.1.0 (first release, planned yet in 2017)

0.2.0

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

Further reading

  1. Getting started
  2. Command Interfaces
  3. Command Dispatchers