# terminal-ui
Java library for terminal UI: tables, rules, colors, prompts, menus, SelectList, pager, and more. Fluent API, ANSI support, testable.
[](https://github.com/jakubbbdev/terminal-ui/actions/workflows/ci.yml)
[](https://openjdk.org/)
[](LICENSE)
[](https://github.com/jakubbbdev/terminal-ui/releases)
[](https://codespaces.new/jakubbbdev/terminal-ui)
## Install
**Gradle (Kotlin DSL):**
```kotlin
repositories {
mavenCentral()
maven { url = uri("https://maven.pkg.github.com/jakubbbdev/terminal-ui") }
}
dependencies {
implementation("dev.jakub.terminal:terminal-ui:VERSION")
}
```
**Gradle (Groovy):**
```groovy
repositories {
mavenCentral()
maven { url "https://maven.pkg.github.com/jakubbbdev/terminal-ui" }
}
dependencies {
implementation "dev.jakub.terminal:terminal-ui:VERSION"
}
```
**Maven:**
```xml
github
https://maven.pkg.github.com/jakubbbdev/terminal-ui
dev.jakub.terminal
terminal-ui
VERSION
```
## Requirements
- **Java 21**
- **Gradle 9.x** (wrapper included)
## Build & Test
```bash
./gradlew build
```
Run tests:
```bash
./gradlew test
```
## Usage (excerpt)
```java
import dev.jakub.terminal.Terminal;
import dev.jakub.terminal.core.Color;
// Colored text
Terminal.print("Hello").color(Color.CYAN).bold().println();
// Table
Terminal.table()
.header("A", "B")
.row("1", "2")
.row("3", "4")
.print(System.out);
// Prompt
String name = Terminal.prompt("Name: ").ask();
// Menu
String choice = Terminal.menu()
.title("Environment")
.option("Dev").option("Prod")
.select();
```
## License
See [LICENSE](LICENSE).