Java command line parser with both an annotations API and a programmatic API, featuring usage help with ANSI colors, autocomplete and nested subcommands. In a single file, so you can include it in source form. This lets users run picocli-based applications without requiring picocli as an external dependency. Picocli-based applications can be ahead-of-time compiled to GraalVM native images, with extremely fast startup time and lower memory requirements, which can be distributed as a single executable file.
How it works: annotate your class and picocli initializes it from the command line arguments, converting the input to strongly typed data. Supports git-like subcommands (and nested sub-subcommands), any option prefix style, POSIX-style grouped short options, custom type converters, password options and more. Parser tracing facilitates troubleshooting. Command-line argument files (@-files) allow applications to handle very long command lines.
Distinguishes between named options and positional parameters and allows both to be strongly typed. Multi-valued fields can specify an exact number of parameters or a range (e.g., 0..*, 1..2). Supports Map options like -Dkey1=val1 -Dkey2=val2, where both key and value can be strongly typed.
Generates polished and easily tailored usage help and version help, using ANSI colors where possible. Works with Java 5 or higher (but is designed to facilitate the use of Java 8 lambdas).
Picocli-based command line applications can have TAB autocompletion, interactively showing users what options and subcommands are available. When an option has completionCandidates or has an enum type, autocompletion can also suggest option values. Picocli can generate completion scripts for bash and zsh, and offers picocli-shell-jline2 and picocli-shell-jline3 modules with JLine Completer implementations for building interactive shell applications.
Picocli-based applications can easily integrate with Dependency Injection containers.
picocli alternatives and related libraries
Based on the "Command-line Argument Parsers" category
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest. Visit our partner's website for more details.
Do you think we are missing an alternative of picocli or a related project?
picocli RecommendationsThere are no recommendations yet. Be the first to promote picocli!
Have you used picocli? Share your experience. Write a short recommendation and picocli, you and your project will be promoted on Awesome Java.
Recently added picocli resources
2. Options and Parameters
3. Strongly Typed Everything
4. Multiple Values
5. Required ArgumentsTutorial Added by remkop // picocli.info // about 2 years ago