17 Micronaut CLI
The Micronaut CLI is the recommended way to create new Micronaut projects. The CLI includes commands for generating specific categories of projects, allowing you to choose between build tools, test frameworks, and even pick the language to use in your application. The CLI also provides commands for generating artifacts such as controllers, client interfaces, and serverless functions.
We have a website that can be used to generate projects instead of the CLI. Check out Micronaut Launch to get started! |
When Micronaut is installed on your computer, you can call the CLI with the mn
command.
$ mn create-app my-app
A Micronaut CLI project can be identified by the micronaut-cli.yml
file, which is included at the project root if it was generated via the CLI. This file will include the project’s profile, default package, and other variables. The project’s default package is evaluated based on the project name.
$ mn create-app my-demo-app
results in the default package being my.demo.app
.
You can supply your own default package when creating the application by prefixing the application name with the package:
$ mn create-app example.my-demo-app
results in the default package being example
.