CLI Profile Commands

The cli profile lets you generate CLI commands to control your application.

Create-Command

Table 7. Create-Command Flags
FlagDescriptionExample

-l, —lang

The language used for the command

—lang groovy

-f, —force

Whether to overwrite existing files

—force

The create-command command generates a standalone application that can be executed as a picocli Command. It follows a *Command convention for generating the class name. It creates an associated test that will run the application and verify that a command line option was set.

  1. $ mn create-command print
  2. | Rendered template Command.java to destination src/main/java/example/PrintCommand.java
  3. | Rendered template CommandTest.java to destination src/test/java/example/PrintCommandTest.java