Skip to content

Preset generator

Preset used by create-nx-workspace to scaffold a new Nx workspace with gonx pre-configured. Delegates to the application, library, or go-blueprint generator based on the selected type.

npx create-nx-workspace <workspace> --preset=@naxodev/gonx
OptionTypeDefaultDescription
typebinary | library | go-blueprintbinaryTemplate type to generate. Required.
directorystringrequiredDirectory of the new project. Taken from the first positional argument.
namestring-Name of the project. Must match ^[a-zA-Z][^:]*$.
tagsstring-Tags to add to the project (used for linting).
skipFormatbooleanfalseSkip formatting files.
addGoDotWorkbooleanfalseAdd a go.work file to the project.

When type is go-blueprint, the following options are also required:

OptionTypeDefaultDescription
frameworkchi | gin | fiber | gorilla/mux | httprouter | standard-library | echorequiredWeb framework.
drivermysql | postgres | sqlite | mongo | redis | scylla | nonerequiredDatabase driver.
gitcommit | stage | skiprequiredGit handling.
featurearray-Advanced features: react, htmx, githubaction, websocket, tailwind, docker.
  • type=binary delegates to the application generator; type=library delegates to the library generator; type=go-blueprint delegates to the go-blueprint generator.
  • When invoked programmatically without go-blueprint values, the preset applies framework=gin, driver=none, git=skip, feature=[].