jbandi
jbandi

Reputation: 18169

Java Frameworks/Libraries to support creating "wizard-like" Commandline Applications

I need to create an interactive commandline application in Java and/or Groovy to orchestrate a very customized build and deployment process.

My current vision would be that the result should somehow feel like using a maven archetype: There will be a "wizard-like" workflow that prompts the user for input at several stages. Typically not all user-inputs are provided when starting the application (i.e: The user provides a subversion-url, then the applications queries subversion for all available tags and displays them to the user and prompts the user to choose a tag for building...)

Are there any Java/Groovy libraries to support building such a commandline application?

So far I have found JCommander and Groovy CliBuilder. But they seem not to be a help when it comes to "wizard-like" commandline applications, that query for user input at several points during runtime.

Any pointers would be appreciated...

Upvotes: 4

Views: 1508

Answers (3)

Sherezad
Sherezad

Reputation: 91

I know this is an old question, but maybe this will help someone else. Spring Shell is a tool that allows you to create interactive command line user interfaces.

Upvotes: 2

Logan
Logan

Reputation: 2364

I would give the Apache Commons Command Line Interface API a try. It's the same setup you see when you use something like Ant. I'm not sure about the wizard aspect you are looking for, but that could come from a loop you create, but then add in the code from the API to handle the inputs.

Here's a link to the Apache Commons Command Line

Upvotes: 1

tim_yates
tim_yates

Reputation: 171144

There is a java package jLine which is used behind the scenes by groovysh. It supports custom tab-completion, saveable command history, and command line editing.

The best example of using it's features that I can find is here, but there might be better examples elsewhere.

Hope this is what you were after?

Upvotes: 3

Related Questions