17.3 Commands
You can view a full list of available commands using the help flag, for example:
$ mn -h
Usage: mn [-hvVx] [COMMAND]
Micronaut CLI command line interface for generating projects and services.
Application generation commands are: (1)
* create-app NAME
* create-cli-app NAME
* create-function-app NAME
* create-grpc-app NAME
* create-messaging-app NAME
Options:
-h, --help Show this help message and exit.
-v, --verbose Create verbose output.
-V, --version Print version information and exit.
-x, --stacktrace Show full stack trace when exceptions occur.
Commands: (2)
create-app Creates an application
create-cli-app Creates a CLI application
create-function-app Creates a Cloud Function
create-grpc-app Creates a gRPC application
create-messaging-app Creates a messaging application
create-job Creates a job with scheduled method
create-bean Creates a singleton bean
create-websocket-client Creates a Websocket client
create-client Creates a client interface
create-controller Creates a controller and associated test
feature-diff Produces the diff of an original project with an original project with
additional features.
create-websocket-server Creates a Websocket server
create-test Creates a simple test for the project's testing framework
1 | Here you can see the project generation commands lists |
2 | All commands available in the current directory are listed here |
3 | Note: the things listed after the project creation commands (always available) depend on the current directory context |
All the code-generation commands honor the values written in micronaut-cli.yml
. For example, assume the following micronaut-cli.yml
file.
micronaut-cli.yml
defaultPackage: example
---
testFramework: spock
sourceLanguage: java
With the above settings, the create-bean
command (by default) generates a Java class with an associated Spock test, in the example
package. Commands accept arguments and these defaults can be overridden on a per-command basis.