Skip to content

Application generator

Generates a Go application under the given directory and registers it as an Nx project through the gonx inference plugin. Aliased as app.

nx g @naxodev/gonx:application <directory>
Option Type Default Description
directory string (required) The directory of the new application. Accepted as the first positional argument.
name string - The name of the application.
template standard | cli | tui standard The template of application.
tags string - Add tags to the application (used for linting).
skipFormat boolean false Skip formatting files.
  • Runs the init generator first to register the inference plugin in nx.json.
  • Creates a go.mod for the project unless the template already includes one. Adds the project to go.work when a Go workspace is present.
  • Inferred targets for applications: build, serve, test, lint, tidy, generate, nx-release-publish. Application detection requires a main.go containing package main and func main(, or a cmd/ directory.