r/java • • 4d ago

Clique 4.1.0: Zero deps CLI styling library for Java

So what's Clique?

If you missed my older posts, Clique is a zero-dependency CLI styling library for Java that is no-color.org compliant.

What's new in 4.1.0:

This is mostly a stability/correctness release. Since 4.0.3 I spent my time going through the library looking for issues and edge cases and fixed a good amount of em. So, these are the ones you'd might likely notice:

  • Emoji and CJK text now render at the right width in Divider, tables and frames. Gradients also no longer corrupts emoji.

  • NO_COLOR / disableCliqueColors() is now respected everywhere. Reset codes were leaking in some components.

  • OSC 8 hyperlinks no longer count their URL toward width, so tables and frames with links line up.

  • Frame no longer re-renders nested components repeatedly

  • Tree and ItemList detect cycles properly (previously a.add(b); b.add(a) could cause a StackOverflowError).

  • Tables were rewritten internally. The public API is unchanged, but column widths are now computed at render time, so replacing a long cell with a short one shrinks the column correctly.

If you discover any bugs/issues while using the library, just lmk by opening an issue or a pull request.

Links:

19 Upvotes

14 comments sorted by

2

u/elmuerte 4d ago

<version>v0.0.6</version>

Drop the v prefix.

1

u/Polixa12 3d ago

Oh, If I'm remembering right, this is from clique-demos. Yeah I'll definitely drop it soon, maybe when next I update the demos

2

u/agentoutlier 3d ago

NO_COLOR / disableCliqueColors() is now respected everywhere. Reset codes were leaking in some components.

I added the same feature awhile back to my logging framework Rainbow Gum.

Interestingly it is the only environment variable I allowed the core module to sniff otherwise I would have to do all sorts of nastiness with either JLine or Jansi.

Neither Log4J2 or Logback support that env variable for their pattern colored syntax. I was surprised how few libraries do.

Recently I have been pseudo vibe coding (somewhere between heavy code assist and vibe) a family todo app and I used https://github.com/oyvindberg/jatatui instead of your library and for the life of me I can't remember why. I'll have to look back in my chat transcripts with the agent. The agent basically pumped out a TUI version of Asana in 30 minutes.

On a related note I don't even know how much longer boring software can make money. Like DHH's Hey. I feel its Ok to make this comparison since he is off vibing Omarchy but I was able to basically make an Asana / Hey / Skylight app for my family in a couple of weeks and it would have been way less time had I not code reviewed it of which it basically wrote mostly good code.

It kind of makes me so depressed how much time I spent on Rainbow Gum. Either people will vibe a replacement or just never switch. Oh well.

2

u/Polixa12 3d ago

Thanks for the support, and nice that rainbow gum got there first. I agree it’s surprising how few libraries actually support `no_color`, since it’s such a small thing to add.

Also, if you find the reason why you used jatatui in your chats, I’d be curious to hear it since that kind of feedback is pretty useful to me.

2

u/agentoutlier 3d ago

I will and I know the pain of making a library discoverable or pick yours over others. My guess is because originally the agent wanted to use Rust and I told it fuck no I want to use Java so that I can review the code.

jatatui is a port of the Rust library ratatui and I think that is mostly why because I absolutely had your library starred and I told the agent to look at my starrred repos but I also had jatatui starred.

1

u/Polixa12 3d ago

That makes sense tbh. Also thanks for starring it, 'preciate it. If you ever use clique in a side project, I’d love to hear how it felt for you.

1

u/agentoutlier 2d ago

Likewise! Hey your project has more stars than mine so you must be doing something right or better!

1

u/jonenst 1d ago

Hi, do you know about the relation and history of all these libraries ? I only knew https://tamboui.dev/ . Do they all have the same goals ?

1

u/jonenst 1d ago

To me it feels like java is missing a push from the openjdk leaders to more often use environnement variables. Like for the curl http_proxy familly vs the networking system properties (often very annoying). The only java software I know that actually uses it is the aws http client (and junie-cli since only a few months). Not sure exactly why and where, but it feels like historically java system properties were strongly favored over env variables.

Env variables are not perfect, for example they break down in cases where multiple independant apps share the same jvm, they are unstructured text, they are limited to smallish strings, etc. But it feels like all these limitations are shared with java system properties. So not sure how we ended up in this situation (hopefully not intentional vendor lock-in or branding visibility)

2

u/perryplatt 4d ago

What would be a good argument parser for Java?

2

u/stefanos-ak 4d ago

picocli

1

u/Polixa12 3d ago

I second this

1

u/agentoutlier 3d ago

Yeah CLI might be confusing in the name because your library is more TUI it appears than CLI. CLI would be picocli. I would atleast tag it TUI in github.

1

u/stuhlmann 2d ago

jbock is also solid