MCPcopy
hub / github.com/remkop/picocli

github.com/remkop/picocli @v4.7.7 sqlite

repository ↗ · DeepWiki ↗ · release v4.7.7 ↗
8,280 symbols 42,903 edges 438 files 1,181 documented · 14%
README

picocli

GitHub Release Maven Central GitHub Actions Build Status Tests codecov Follow @remkopopma Follow @picocli Follow picocli on StackShare

picocli - a mighty tiny command line interface

Picocli aims to be the easiest-to-use way to create rich command line applications that can run on and off the JVM. Considering picocli? Check what happy users say about picocli.

Picocli is a modern library and framework, written in Java, that contains both an annotations API and a programmatic API. It features usage help with ANSI colors and styles, TAB autocompletion 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 a GraalVM native image, with extremely fast startup time and lower memory requirements, which can be distributed as a single executable file. Picocli comes with an annotation processor that automatically Graal-enables your jar during compilation.

Picocli applications can be very compact with no boilerplate code: your command (or subcommand) can be executed with a single line of code. Simply implement Runnable or Callable, or put the business logic of your command in a @Command-annotated method.

Picocli Demo help message with ANSI colors

Picocli makes it easy to follow Command Line Interface Guidelines.

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.

Picocli 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. Parser tracing facilitates troubleshooting. Command-line argument files (@-files) allow applications to handle very long command lines.

Generates polished and easily tailored usage help and version help, using ANSI colors where possible. Requires at minimum Java 5, but is designed to facilitate the use of Java 8 lambdas. Tested on all Java versions between 5 and 18-ea (inclusive).

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.

Unique features in picocli include support for negatable options, advanced quoted values, and argument groups. Argument groups can be used to create mutually exclusive options, mutually dependent options, option sections in the usage help message and repeating composite arguments like ([-a=<a> -b=<b> -c=<c>] (-x | -y | -z)).... For advanced use cases, applications can access the picocli command object model with the @Spec annotation, and implement custom parameter processing for option parameters if the built-in logic is insufficient.

Picocli-based applications can easily integrate with Dependency Injection containers. The Micronaut microservices framework has built-in support for picocli. Quarkus has a Command Mode with Picocli extension for facilitating the creation of picocli-based CLI applications with Quarkus. Picocli ships with a picocli-spring-boot-starter module that includes a PicocliSpringFactory and Spring Boot auto-configuration to use Spring dependency injection in your picocli command line application. The user manual has examples of integrating with Guice, Spring Boot, Micronaut, Quarkus and with containers that comply to CDI 2.0 specification (JSR 365).

Releases

Documentation

Older

Articles & Presentations

English

Extension points exported contracts — how you extend this code

ITypeMetaData (Interface)
Abstraction over annotation attributes that take a class (or array of classes) as their value. For example: {@code @Comm [10 …
picocli-codegen/src/main/java/picocli/codegen/annotation/processing/ITypeMetaData.java
IExitCodeGenerator (Interface)
@Command-annotated classes can implement this interface to specify an exit code that will be returned from the { [19 implementers]
src/main/java/picocli/CommandLine.java
Supplier (Interface)
(no doc) [19 implementers]
src/test/java/picocli/test/Supplier.java
IOwner (Interface)
The top-level command must implement this interface. If the --verbose option is specified on any subcommand, [1 implementers]
picocli-codegen-tests-java9plus/src/test/resources/picocli/examples/logging/LoggingMixin.java
ExampleInterface (Interface)
(no doc)
picocli-codegen/src/test/java/picocli/codegen/aot/graalvm/ExampleInterface.java
IExitCodeExceptionMapper (Interface)
Interface that provides the appropriate exit code that will be returned from the #execute(String...) execute met [13 implementers]
src/main/java/picocli/CommandLine.java
ExampleInterface (Interface)
(no doc)
picocli-codegen-tests-java9plus/src/test/resources/picocli/codegen/graalvm/example/ExampleInterface.java
IParseResultHandler (Interface)
Represents a function that can process a List of CommandLine objects resulting from successfully {@linkplain #pa [8 implementers]
src/main/java/picocli/CommandLine.java

Core symbols most depended-on inside this repo

assertEquals
called by 4671
picocli-examples/src/main/java/picocli/examples/sharedoptions/Top.java
get
called by 1108
src/test/java/picocli/test/Supplier.java
assertTrue
called by 995
src/main/java/picocli/CommandLine.java
parseArgs
called by 724
src/main/java/picocli/CommandLine.java
build
called by 620
src/main/java/picocli/CommandLine.java
getCommandSpec
called by 503
src/main/java/picocli/CommandLine.java
populateCommand
called by 502
src/main/java/picocli/CommandLine.java
get
called by 478
src/main/java/picocli/CommandLine.java

Shape

Method 6,018
Class 1,580
Function 583
Interface 63
Enum 36

Languages

Java93%
TypeScript7%

Modules by API surface

src/main/java/picocli/CommandLine.java1,618 symbols
src/test/java/picocli/ArgGroupTest.java358 symbols
src/test/java/picocli/HelpTest.java334 symbols
src/test/java/picocli/CommandLineTest.java310 symbols
src/test/java/picocli/SubcommandTests.java204 symbols
src/test/java/picocli/ArityTest.java172 symbols
src/test/java/picocli/ExecuteTest.java137 symbols
src/test/java/picocli/CommandMethodTest.java134 symbols
src/test/java/picocli/TypeConversionTest.java119 symbols
docs/apidocs/script-dir/jquery-3.4.1.js112 symbols
docs/apidocs/script-dir/external/jquery/jquery.js112 symbols
docs/apidocs-all/jquery/external/jquery/jquery.js112 symbols

Dependencies from manifests, versioned

info.picocli:picocli-codegen4.7.7 · 1×
junit:junit3.8.1 · 1×

For agents

$ claude mcp add picocli \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact