The Nx CLI (Documentation Index
Fetch the complete documentation index at: https://mintlify.com/nrwl/nx/llms.txt
Use this file to discover all available pages before exploring further.
nx) is the primary interface for running tasks, generating code, managing migrations, and visualizing your workspace. Every command follows the pattern:
Getting help
Pass--help to any command to see its options and usage:
Commands
run
Run a single target for a project. Supports configuration overrides and cache control.
generate
Scaffold or update source code using a generator from any installed Nx plugin.
affected
Run a target only for projects that are affected by recent changes in your git history.
run-many
Run one or more targets across a specific set of projects in the workspace.
migrate
Update Nx and its plugins, and apply the resulting code migrations automatically.
release
Orchestrate versioning, changelog generation, and publishing of packages.
graph
Visualize the project dependency graph or task graph in an interactive browser UI.
Other commands
| Command | Description |
|---|---|
nx add <plugin> | Add an Nx plugin to the workspace |
nx init | Initialize Nx in an existing repository |
nx list | List installed plugins and available generators |
nx show project <name> | Show configuration and targets for a project |
nx sync | Run sync generators to keep the workspace consistent |
nx repair | Repair the workspace configuration |
nx reset | Clear the local Nx cache |
nx report | Report Nx version and environment information |
nx format:write | Format workspace files using Prettier |
nx format:check | Check that workspace files are formatted |
nx watch | Watch for file changes and re-run a target |
nx exec | Execute a shell command for each project |
nx connect | Connect to Nx Cloud |
Global flags
These flags are accepted by most Nx commands.Prints additional information about the commands (e.g., stack traces). Also enabled by setting
NX_VERBOSE_LOGGING=true.Print the current version of Nx and exit.
Show help for the command and exit.
Environment variables
| Variable | Description |
|---|---|
NX_VERBOSE_LOGGING | Set to true to enable verbose logging globally |
NX_PARALLEL | Default number of parallel tasks (overridden by --parallel) |
NX_DEFAULT_OUTPUT_STYLE | Default output style for task runs |
NX_INTERACTIVE | Set to false to disable interactive prompts in generators |
NX_DRY_RUN | Set to true to enable dry-run mode for generators |
NX_TUI | Set to true or false to force-enable or force-disable the Terminal UI |
NX_TUI_AUTO_EXIT | Controls automatic TUI exit behavior after tasks finish |
