17.3 Commands

You can view a full list of available commands using the help flag, like this:

  1. $ mn -h
  2. Usage: mn [-hvVx] [COMMAND]
  3. Micronaut CLI command line interface for generating projects and services.
  4. Application generation commands are: (1)
  5. * create-app NAME
  6. * create-cli-app NAME
  7. * create-function-app NAME
  8. * create-grpc-app NAME
  9. * create-messaging-app NAME
  10. Options:
  11. -h, --help Show this help message and exit.
  12. -v, --verbose Create verbose output.
  13. -V, --version Print version information and exit.
  14. -x, --stacktrace Show full stack trace when exceptions occur.
  15. Commands: (2)
  16. create-app Creates an application
  17. create-cli-app Creates a CLI application
  18. create-function-app Creates a Cloud Function
  19. create-grpc-app Creates a gRPC application
  20. create-messaging-app Creates a messaging application
  21. create-test Creates a simple test for the projects testing framework (3)
  22. create-websocket-server Creates a Websocket server
  23. create-client Creates a client interface
  24. create-controller Creates a controller and associated test
  25. create-bean Creates a singleton bean
1Here you can see the project generation commands lists
2All commands available in the current directory are listed here
3Note: the things listed after the project creation commands (always available) will depend on the current directory context

All of the code-generation commands will honor the values written in micronaut-cli.yml. For example, assume the following micronaut-cli.yml file.

micronaut-cli.yml

  1. defaultPackage: example
  2. ---
  3. testFramework: spock
  4. sourceLanguage: java

With the above settings, the create-bean command will (by default) generate a Java class with an associated Spock test, under the example package. Commands accept arguments and these defaults can be overridden on a per-command basis.