Because I didn't found anything comparable to this in the Java eco system, I decided to write
as a library with the same easy 'look and feel'. Some parts of the API are also comparable, but Console UI is not
a Java clone of Inquirer.js.
Console UI currently supports:
A screen recording of the basic elements demo can be fund on Youtube console UI demo.
Console UI uses jansi and jline for the dirty console things.
You can get an idea how the project works by looking at
de.codeshelf.consoleui.Basic. You can run this by executing the following from the project root:
gradlew fatJar java -jar build/libs/consoleui-all-0.0.10.jar # <- replace with the latest version
Before you can use Console UI the AnsiConsole library has to be initialized.
Entry point to the builder classes is to create a new object of type
ConsolePrompt prompt = new ConsolePrompt();
From the prompt object, use the
getPromptBuilder() method to create the builder for all subsequent UI elements
you want to use.
PromptBuilder promptBuilder = prompt.getPromptBuilder();
From with this
PromptBuilder you can access UI builder with the following methods: