ProductPromotion
Logo

Kotlin

made by https://0x3d.site

GitHub - kotlin-inquirer/kotlin-inquirer: A collection of common interactive command line user interfaces written in Kotlin
A collection of common interactive command line user interfaces written in Kotlin - kotlin-inquirer/kotlin-inquirer
Visit Site

GitHub - kotlin-inquirer/kotlin-inquirer: A collection of common interactive command line user interfaces written in Kotlin

GitHub - kotlin-inquirer/kotlin-inquirer: A collection of common interactive command line user interfaces written in Kotlin

example workflow Apache License V.2 codecov Awesome Kotlin Badge

A collection of common interactive command line user interfaces written in Pure Kotlin inspired by Inquirer.js

:rocket: Run Demo Using kscript

Remote scriplet raw-URL

kscript https://bit.ly/kotlin-inquirer-pizza

Or clone it

git clone https://github.com/kotlin-inquirer/kotlin-inquirer.git
cd kotlin-inquirer
kscript ./scripts/pizza.kts

Or without kscript

./gradlew shadowJar
java -jar example/build/libs/kotlin-pizza.jar

:cloud: Download

Gradle

allprojects {
  repositories {
    maven { url 'https://jitpack.io' }
  }
}
dependencies {
  implementation 'com.github.kotlin-inquirer:kotlin-inquirer:0.1.0'
}

:clipboard: Usages

Confirm

val isDelivery: Boolean = KInquirer.promptConfirm(message = "Is this for delivery?", default = false)
println("Is Delivery: $isDelivery")

Input

val comments: String = KInquirer.promptInput(message = "Any comments on your purchase experience?")
println("Comments: $comments")

Input Numbers

val quantity: BigDecimal = KInquirer.promptInputNumber(message = "How many do you need?")
println("Quantity: $quantity")

Input Password

val password: String = KInquirer.promptInputPassword(message = "Enter Your Password:", hint = "password")
println("Password: $password")

Input Password custom mask

val passwordMasked: String = KInquirer.promptInputPassword(
    message = "Enter Your Password:",
    hint = "password",
    mask = "🤫"
)
println("Password: $passwordMasked")

List

val size: String = KInquirer.promptList(message = "What size do you need?", choices = listOf("Large", "Medium", "Small"))
println("Size: $size")

List with more options

val continent: String = KInquirer.promptList(
    message = "Select a continent:",
    choices = listOf(
        "Asia",
        "Africa",
        "Europe",
        "North America",
        "South America",
        "Australia",
        "Antarctica",
    ),
    hint = "press Enter to pick",
    pageSize = 3,
    viewOptions = ListViewOptions(
        questionMarkPrefix = "🌍",
        cursor = " 😎 ",
        nonCursor = "    ",
    )
)
println("Continent: $continent")

Checkbox

val toppings: List<String> = KInquirer.promptCheckbox(
    message = "What about the toppings?",
    choices = listOf(
        "Pepperoni and cheese",
        "All dressed",
        "Hawaiian",
    ),
)
println("Toppings: $toppings")

Checkbox with more options

val colors: List<String> = KInquirer.promptCheckbox(
    message = "Which colors do you prefer?",
    choices = listOf(
        "Red",
        "Green",
        "Blue",
        "Yellow",
        "Black",
        "White",
    ),
    hint = "pick a color using spacebar",
    maxNumOfSelection = 3,
    minNumOfSelection = 2,
    pageSize = 3,
    viewOptions = CheckboxViewOptions(
        questionMarkPrefix = "❓",
        cursor = " 👉 ",
        nonCursor = "    ",
        checked = "✅ ",
        unchecked = "○ ",
    )
)
println("Colors: $colors")

:crystal_ball: Roadmap

Components

  • Confirm
  • Input
  • Input Numbers
  • Input Password
  • List
  • Checkbox
  • Input validation error message
  • Support Hint
  • Better package name
  • Add examples for ViewOption
  • Support List/Checkbox Fuzzy search
  • Support List/Checkbox autocomplete
  • Add DSL support
  • Consider non static function for prompts

Operation

  • Examples
  • Logo
  • GIFs
  • codecov
  • Maven Central

More Resources
to explore the angular.

mail [email protected] to add your project or resources here 🔥.

Related Articles
to learn about angular.

FAQ's
to learn more about Angular JS.

mail [email protected] to add more queries here 🔍.

More Sites
to check out once you're finished browsing here.

0x3d
https://www.0x3d.site/
0x3d is designed for aggregating information.
NodeJS
https://nodejs.0x3d.site/
NodeJS Online Directory
Cross Platform
https://cross-platform.0x3d.site/
Cross Platform Online Directory
Open Source
https://open-source.0x3d.site/
Open Source Online Directory
Analytics
https://analytics.0x3d.site/
Analytics Online Directory
JavaScript
https://javascript.0x3d.site/
JavaScript Online Directory
GoLang
https://golang.0x3d.site/
GoLang Online Directory
Python
https://python.0x3d.site/
Python Online Directory
Swift
https://swift.0x3d.site/
Swift Online Directory
Rust
https://rust.0x3d.site/
Rust Online Directory
Scala
https://scala.0x3d.site/
Scala Online Directory
Ruby
https://ruby.0x3d.site/
Ruby Online Directory
Clojure
https://clojure.0x3d.site/
Clojure Online Directory
Elixir
https://elixir.0x3d.site/
Elixir Online Directory
Elm
https://elm.0x3d.site/
Elm Online Directory
Lua
https://lua.0x3d.site/
Lua Online Directory
C Programming
https://c-programming.0x3d.site/
C Programming Online Directory
C++ Programming
https://cpp-programming.0x3d.site/
C++ Programming Online Directory
R Programming
https://r-programming.0x3d.site/
R Programming Online Directory
Perl
https://perl.0x3d.site/
Perl Online Directory
Java
https://java.0x3d.site/
Java Online Directory
Kotlin
https://kotlin.0x3d.site/
Kotlin Online Directory
PHP
https://php.0x3d.site/
PHP Online Directory
React JS
https://react.0x3d.site/
React JS Online Directory
Angular
https://angular.0x3d.site/
Angular JS Online Directory