Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Libraries for constructing an interactive shell for Java application [closed]

Tags:

java

libraries

I am looking for libraries for Java that will allow me to create an interactive shell. I have done some search around and have not turned up a whole lot. Most of what I have found is libraries for adding command argument parsing to my application which does not help me a lot.

The best lead I have found is a library called Cliche which does exactly what I need. The problem is its too simple. I am looking for something that has more customization.

Has anyone come across something a little more advanced?

like image 291
ianc1215 Avatar asked Dec 29 '12 10:12

ianc1215


2 Answers

Options to consider:

  • javacurses / JCurses - a console-based windowing toolkit, similar to the UNIX curses design
  • swing-console might be appropriate if you want a console-style view / output in a Swing GUI window. you could use this to build an interactive shell.
  • JLine - library for console input similar to GNU readline
  • Several JVM languages offer an interactive REPL environment which can be used as an interactive shell, e.g. Clojure
like image 53
mikera Avatar answered Sep 26 '22 18:09

mikera


We are using Spring shell, and it worked really well for us. Some of its features:

  • A simple, annotation driven, programming model to contribute custom commands

  • Use of Spring's classpath scanning functionality asthe basis for a
    command plugin strategy and command develoment

  • Inheritance of the Roo Shell features, most notably tab completion, colorization, and script execution.

  • Customization of command prompt, banner, shell history file name.

like image 26
Gonzalo Avatar answered Sep 23 '22 18:09

Gonzalo