Search code examples
apache-commons-cli

Apache Commons CLI Color Support


I'm building a new CLI tool with java / gradle, and from looking around it seemed like Apache Commons CLI was the way to go (please correct me if that's wrong).

I have a command which outputs some text and eventually progress bars etc.

Does Apache Commons CLI have support to add color? Or is there a framework which I can add which does?


Solution

  • Since your requirements are Java and ANSI color, picocli is the actively maintained choice. https://github.com/remkop/picocli

    There are other options from the answer here: https://softwarerecs.stackexchange.com/questions/16450/what-library-should-i-use-for-handling-cli-arguments-for-my-java-program