Skip to content
Remko Popma edited this page Apr 12, 2022 · 36 revisions

3 Reasons to Use picocli

designed to be included as source

...because your users don't want the extra jar file just to parse command line options.

easily tailored usage help with Ansi colors and styles

...because the usage help is the face of your command line interface.

autocomplete for your command line application

...so users of your application can just press <TAB> to see the available options and subcommands.

40+ more reasons to use picocli

  • runs on Java 5 or higher (tested on Java 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15-ea)
  • annotation API - almost no code
  • programmatic API - for dynamic configuration
  • runs on GraalVM - for extremely fast startup
  • git-style subcommands
  • nested sub-subcommands (to any level of depth)
  • easily execute @Command-annotated classes that implement Runnable or Callable, or @Command-annotated methods
  • exit code support
  • mutually exclusive options
  • mutually dependent options
  • repeating nested composite option groups (no other CLI parser offers this)
  • negatable (no-*) options (no other Java CLI parser offers this)
  • strongly typed option parameters
  • strongly typed positional parameters
  • many, many built-in types
  • easily add custom type converters
  • interactive password options
  • supports multi-value options
  • supports Maps for options and positional parameters (like -Dkey=value Java system properties)
  • intuitive min-max "range" model for how many arguments an option consumes
  • various defaulting mechanisms that cover common and uncommon scenarios
  • split parameters while respecting quoted values, optionally unquote quoted values
  • variable expansion in annotation attributes
  • fluent API
  • supports both mixins and subclassing for reuse
  • built-in support for standard --help and --version options (zero code)
  • built-in help subcommand
  • uses STDERR for error messages, STDOUT for requested help by default
  • allows any option prefix
  • POSIX-style clustered short options
  • highly configurable parser
  • ability to plug in custom parameter processors
  • parser tracing to facilitate troubleshooting
  • annotation processor generates compile-time errors for invalid annotations and attributes
  • annotation processor enables your JAR for GraalVM native images
  • built-in Groovy script support
  • easily integrates with Dependency Injection containers
  • built-in Spring Boot and Micronaut integration
  • built-in integration with JLine 2 and JLine 3 to create interactive shell applications
  • usage help message width auto-adjusts for wide (Chinese, Japanese and Korean) characters
  • explicit JPMS module
  • OSGi bundle
  • quality documentation