CLI arguments of create-nx-workspace

Currently there is not option to define style within create-nx-workspace command. As you can see there is only prompt to inquire style after determination of appName promise:

determineWorkspaceName(parsedArgs).then(name => {
    determinePreset(parsedArgs).then(preset => {
        return determineAppName(preset, parsedArgs).then(appName => {
            return determineStyle(preset).then(style => {
                return determineCli(preset, parsedArgs).then(cli => {
                    const tmpDir = createSandbox(packageManager, cli);
                    createApp(tmpDir, cli, parsedArgs, name, preset, appName, style);
                    showCliWarning(preset, parsedArgs);
                    showNxWarning(name);
                    pointToTutorial(preset);
                });
            });
        });
    });
});

Code of the determineStyle is here.

I have already prepared PR to add this feature into create-nx-workspace command here.


You may select the tools used for styling the application

npx create-nx-workspace@latest myworkspace ... --style=css

You may use on of the following options

  • css, scss, less for Angular projects
  • styl for all non-Angular, and
  • styled-components, @emotion/styled, styled-jsx for React, Next.js and Gatsby.

Command line options for NX

You can check the command line options that you can use to create the NX workspace by running

npx create-nx-workspace@latest --help

The following are the command line options for the v13.4.5 version:

Option Description
preset Tools to be used in the workspace (options: "apps", "empty", "core", "npm", "ts", "web-components", "angular", "angular-nest", "react", "react-express", "react-native", "next", "gatsby", "nest", "express")
appName Name of the application
cli CLI to be used (options: "nx", "angular")
style style option (options: "css", "scss", "less" for Angular, "styl" for all non-Angular and "styled-components", "@emotion/styled", "styled-jsx" for React, Next.js and Gatsby)
interactive enable interactive mode when using presets (boolean)
packageManager package manager to use (npm, yarn, pnpm)
nx-cloud yse Nx Cloud (boolean)