AI-first build platform designed for monorepo development that provides task orchestration, project graph generation, and CLI tools for managing complex software projects
—
Quality
Pending
Does it follow best practices?
Impact
Pending
No eval scenarios have been run
Nx provides a comprehensive CLI toolkit with 41 commands for monorepo management, project generation, task execution, workspace maintenance, and cloud integration.
Commands for creating, initializing, and maintaining Nx workspaces.
# Create new workspace
nx new <workspace-name> [options]
# Initialize Nx in existing workspace
nx init [options]
# Connect workspace to Nx Cloud
nx connect-to-nx-cloud
# Repair workspace configuration
nx repair
# Reset workspace cache and state
nx resetCommands for managing projects within the workspace.
# Add packages and capabilities to workspace
nx add <package> [options]
# Generate code using generators
nx generate <schematic> [options]
nx g <schematic> [options]
# Import external projects into workspace
nx import <github-url> [options]
# List installed plugins and generators
nx list [plugin]
# Show project information and configuration
nx show project <project-name> [options]Commands for running tasks and managing task execution.
# Run target on specific project
nx run <project:target[:configuration]> [options]
nx <target> <project> [options]
# Run targets on multiple projects
nx run-many --target=<target> [options]
# Run tasks on affected projects only
nx affected --target=<target> [options]
# Execute command in workspace context
nx exec -- <command>
# Watch files and run commands on changes
nx watch --all -- <command>Commands for analyzing workspace structure and generating reports.
# View interactive project dependency graph
nx graph [options]
# Generate workspace report
nx report
# Sync workspace dependencies
nx sync
# Check if workspace needs syncing
nx sync:check
# Format files in workspace
nx format [options]
# Check formatting without modifying files
nx format:check
# Write formatting changes to files
nx format:write
# View execution logs
nx view-logsCommands for upgrading workspace and migrating code.
# Migrate workspace to newer versions
nx migrate <package> [options]
# Register plugin with Nx
nx register <plugin>Commands for versioning and publishing packages.
# Release and versioning commands
nx release [options]Commands for managing the Nx daemon process.
# Nx daemon operations (start/stop/status)
nx daemon [options]Commands for continuous integration and task analysis.
# Fix CI configuration issues
nx fix-ci
# Record task execution for analysis
nx record
# Start CI run processes
nx start-ci-runCommands for Nx Cloud authentication and integration.
# Login to Nx Cloud
nx login
# Logout from Nx Cloud
nx logout
# Connect workspace to Nx Cloud (deprecated, use nx connect)
nx connect-to-nx-cloudCommands for development workflow and compliance.
# Model Context Protocol server operations
nx mcp [options]
# Check workspace conformance rules
nx conformance [options]
# Run conformance checks
nx conformance:checkDeprecated commands maintained for backward compatibility.
# Print affected projects (deprecated, use nx affected)
nx print-affected [options]
# Show affected dependency graph (deprecated, use nx graph)
nx affected:graph [options]
# Build affected projects (deprecated, use nx affected --target=build)
nx affected:build [options]
# Test affected projects (deprecated, use nx affected --target=test)
nx affected:test [options]
# Lint affected projects (deprecated, use nx affected --target=lint)
nx affected:lint [options]
# E2E test affected projects (deprecated, use nx affected --target=e2e)
nx affected:e2e [options]Creates a new Nx workspace from scratch.
nx new <workspace-name> [options]
Options:
--preset The preset to use for generating the workspace
--packageManager Package manager to use (npm, yarn, pnpm)
--nxCloud Enable Nx Cloud integration
--interactive Enable interactive mode for promptsInitializes Nx in an existing workspace with workspace-specific configuration.
nx init [options]
Options:
--nxCloud Enable Nx Cloud integration
--interactive Enable interactive mode for prompts
--cacheable Specify which targets should be cacheableGenerates code using available generators/schematics.
nx generate <schematic> [options]
nx generate <plugin>:<schematic> [options]
Examples:
nx generate @nx/react:app my-app
nx generate @nx/react:component my-component --project=my-app
nx generate workspace-generator my-generator
Options:
--dry-run Preview changes without writing files
--interactive Enable interactive mode for promptsRuns a target on a specific project.
nx run <project:target[:configuration]> [options]
nx <target> <project> [options]
Examples:
nx run my-app:build
nx run my-app:build:production
nx build my-app
nx test my-lib
Options:
--configuration Configuration to use
--skip-nx-cache Skip Nx cache
--verbose Print additional error stack traceRuns a target on multiple projects.
nx run-many --target=<target> [options]
Options:
--target Target to run
--projects Projects to run target on
--all Run target on all projects
--parallel Max number of parallel processes
--exclude Exclude specific projects
--skip-nx-cache Skip Nx cache
--configuration Configuration to useRuns tasks only on projects affected by code changes.
nx affected --target=<target> [options]
Options:
--target Target to run on affected projects
--base Base of the current branch (SHA or branch name)
--head Latest commit of the current branch (SHA or branch name)
--files Change the way Nx is calculating the affected
--parallel Max number of parallel processes
--exclude Exclude specific projects
--skip-nx-cache Skip Nx cacheDisplays an interactive project dependency graph.
nx graph [options]
Options:
--file Output file (default: nx-graph.html)
--focus Focus on specific project
--exclude Exclude projects from graph
--groupByFolder Group projects by folder structure
--watch Watch for changes and update graph
--open Open graph in browser (default: true)Shows configuration and information about projects.
nx show project <project-name> [options]
nx show projects [options]
Options:
--json Output in JSON format
--web Show project details in browserLists installed plugins and available generators/executors.
nx list [plugin]
Examples:
nx list # List all installed plugins
nx list @nx/react # Show generators/executors for @nx/reactFormats files in the workspace using configured formatters.
nx format [options]
Options:
--files Format specific files
--all Format all files
--uncommitted Format uncommitted files only
--untracked Format untracked files only
--base Base branch for comparison
--head Head branch for comparisonGenerates a report about the workspace configuration and environment.
nx report
# Outputs information about:
# - Nx version
# - Operating system
# - Package manager
# - Installed plugins
# - Project structureSynchronizes workspace dependencies and configurations.
nx sync
# Analyzes package.json files and updates workspace configuration
# to ensure all projects have consistent dependenciesAuthenticates with Nx Cloud for remote caching and distributed execution.
nx login
# Opens browser for authentication with Nx Cloud
# Stores authentication token for future operationsRemoves Nx Cloud authentication.
nx logout
# Removes stored authentication token
# Disables remote caching until login againMigrates workspace to newer versions and applies code transformations.
nx migrate <package> [options]
nx migrate --run-migrations
Options:
--from Starting version for migration
--to Target version for migration
--run-migrations Apply pending migrations
--interactive Enable interactive modeManages the Nx daemon for improved performance.
nx daemon [options]
Options:
--start Start the daemon
--stop Stop the daemon
--restart Restart the daemon
--status Check daemon statusAll Nx CLI commands return appropriate exit codes:
0: Success1: General error3: Task execution failure (some tasks failed)Key environment variables that affect CLI behavior:
NX_DAEMON: Enable/disable daemon (true/false)NX_CACHE_DIRECTORY: Override cache directory locationNX_DEFAULT_BASE: Default base branch for affected calculationsNX_PARALLEL: Default number of parallel processesNX_VERBOSE_LOGGING: Enable verbose loggingNX_DRY_RUN: Enable dry-run mode for all operationsInstall with Tessl CLI
npx tessl i tessl/npm-nx