gen-manpage [-fhVv] [--[no-]exit] [-c=<factoryClass>] [-d=<outdir>] [-t=<template-dir>] [@<filename>…​] <classes>…​


Generates one or more AsciiDoc files with doctype 'manpage' in the specified directory.


-d, --outdir=<outdir>

Output directory to write the generated AsciiDoc files to. If not specified, files are written to the current directory.

-t, --template-dir=<template-dir>

Optional directory to write customizable man page template files. If specified, an additional "template" file is created here for each generated manpage AsciiDoc file.

Each template file contains include directives that import content from the corresponding generated manpage AsciiDoc file in the --outdir directory. Text can be added after each include to customize the resulting man page. The resulting man page will be a mixture of generated and manually edited text.

These customizable templates are intended to be generated once, and afterwards be manually updated and maintained.

-v, --verbose

Specify multiple -v options to increase verbosity.

For example, -v -v -v or -vvv

-f, --[no-]force

Overwrite existing man page templates. The default is --no-force, meaning processing is aborted and the process exits with status code 4 if a man page template file already exists.

-c, --factory=<factoryClass>

Optionally specify the fully qualified class name of the custom factory to use to instantiate the command class. If omitted, the default picocli factory is used.


Specify --exit if you want the application to call System.exit when finished. By default, System.exit is not called.

-h, --help

Show this help message and exit.

-V, --version

Print version information and exit.



One or more argument files containing options.


One or more command classes to generate man pages for.

Exit Codes (if enabled with --exit)


Successful program execution.


A runtime exception occurred while generating man pages.


Usage error: user input for the command was incorrect, e.g., the wrong number of arguments, a bad flag, a bad syntax in a parameter, etc.


A template file exists in the template directory. (Remove the --template-dir option or use --force to overwrite.)

Converting to Man Page Format

Use the asciidoctor tool to convert the generated AsciiDoc files to man pages in roff format:

asciidoctor --backend=manpage --source-dir=SOURCE_DIR --destination-dir=DESTINATION *.adoc

Point the SOURCE_DIR to either the --outdir directory or the --template-dir directory. Use some other directory as the DESTINATION.

In order to generate localized man pages, set the target locale by specifying the user.language,, and user.variant system properties.
The generated usage help will then contain information retrieved from the resource bundle based on the user locale.


java -Duser.language=de -cp "myapp.jar;picocli-4.5.0.jar;picocli-codegen-4.5.0.jar" picocli.codegen.docgen.manpage.ManPageGenerator my.pkg.MyClass