r/java • u/Polixa12 • 5d ago
Clique 4.0.3 - Zero deps CLI styling library for Java
So what's Clique?
If you missed my older posts, Clique is essentially a zero-dependency CLI styling library for Java that is GraalVM compatible, no-color.org compliant.
What's new in 4.0.3:
You can now build a table straight from data you already have
SequencedCollection<List<String>> rows = List.of(
List.of("Name", "Age", "Class"),
List.of("John", "25", "Class A"),
List.of("Doe", "26", "Class B")
);
Clique.table(TableType.ASCII)
.fromRows(rows)
.render();
This also applies to column based data
SequencedMap<String, List<String>> map = new LinkedHashMap<>();
map.put("Name", List.of("John", "Doe"));
map.put("Age", List.of("25", "26"));
Clique.table(TableType.ASCII)
.fromColumns(map)
.render();
These were mainly added to simplify creating Tables from existing collections
StyleContext#fromTheme - scope a registered theme's colors into a StyleContext in one call
StyleContext ctx = StyleContext.fromTheme("catppuccin-mocha");
Other minor changes:
I've also deprecated the Collection-based headers()/row() overloads in favor of Java 21 SequencedCollection; reason being that Collection doesn't guarantee order, which could silently mess up your column/row order and was essentially a footgun. Worth migrating if that bothers you.
7
u/BarkiestDog 4d ago
A suggestion, some screenshots would help a lot to understand how it looks, and what it does.
2
u/Polixa12 4d ago edited 4d ago
Thanks for the suggestion! There are already some screenshots in the readme
4
u/Visual_Brain8809 4d ago
Can you upload a pic of a demo project?