A full-featured Rust library for building command-line argument parsers, defined declaratively or procedurally.
remkop/picocli
A Java framework for building command line apps with annotations or a programmatic API, supporting subcommands, ANSI colors and shell autocompletion.
- Stars
- 5,453
- Forks
- 498
- Open issues
- 186
- Last commit
- 3 months ago
What is it?
Picocli is a Java library for building command line applications. Developers annotate fields or methods with options and parameters, and picocli converts the input arguments into strongly typed values. It supports git-style subcommands and nested sub-subcommands, POSIX grouped short options, custom type converters, and password prompts. Usage help is generated automatically and can be styled with ANSI colors.
The library covers more advanced parsing needs as well, including mutually exclusive and dependent options, argument groups, negatable options, map options such as -Dkey=value, and @-files for very long command lines. Picocli can generate bash and zsh completion scripts, and it provides JLine integration for interactive shells.
The project is distributed as a single source file that can be copied into an application, so end users do not need picocli as a dependency. Applications can also be compiled to GraalVM native images, and the project includes an annotation processor for that purpose. It works from Java 5 onward and can be used from Groovy, Kotlin and Scala.
Key features
- 01Annotation-based and programmatic APIs for defining commands, options and parameters.
- 02Git-style subcommands and nested sub-subcommands.
- 03Colorized usage help generated automatically.
- 04TAB autocompletion scripts for bash and zsh.
- 05Single-file distribution that can be included in source form.
- 06GraalVM native image support with an annotation processor.
Use cases
- Building a Java or Kotlin command line tool with subcommands and help text.
- Shipping a CLI as a native executable with fast startup via GraalVM.
- Adding shell autocompletion to an existing Java command line application.
- Migrating an existing Java CLI parser to a more modern annotation-based API.
In collections
Topics
FAQ
- What is picocli?
- A Java framework for building command line apps with annotations or a programmatic API, supporting subcommands, ANSI colors and shell autocompletion. Picocli is a Java library for building command line applications. Developers annotate fields or methods with options and parameters, and picocli converts the input arguments into strongly typed values. It supports git-style subcommands and nested sub-subcommands, POSIX grouped short options, custom type converters, and password prompts. Usage help is generated automatically and can be styled with ANSI colors.
- Is picocli free to use? What license does it have?
- picocli is open source under the Apache-2.0 license. Check the license terms before using it in commercial products.
- Is picocli still maintained?
- Updated within 6 months. The last commit to picocli was on Aug 16, 2026.
- What can I use picocli for?
- Building a Java or Kotlin command line tool with subcommands and help text. Shipping a CLI as a native executable with fast startup via GraalVM. Adding shell autocompletion to an existing Java command line application. Migrating an existing Java CLI parser to a more modern annotation-based API.
- Where can I get picocli?
- The source code and installation instructions are on GitHub: https://github.com/remkop/picocli
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
A declarative Go package for building command line tools, with subcommands, flags, shell completion and help generation.
A Python toolkit for building composable command line interfaces with nested commands, automatic help pages, and lazy-loaded subcommands.
A type-safe Swift library for declaring and parsing command-line arguments, options, and flags with auto-generated help.
A command template and snippet manager for Bash, Zsh, Fish, Nushell and PowerShell that works like IntelliSense for your terminal.
A user-friendly interactive command line shell for macOS, Linux and other Unix-like systems, with syntax highlighting and autosuggestions out of the box.