Useful Nx commands
November 17, 2025Less than 1 minute
Useful Nx commands
| command | description |
|---|---|
npx create-nx-workspace@latest monorepo-name | Creates a new Nx workspace |
npx nx run swe-demo:serve | Serve/run this specific application in the Nx workspace |
npx nx run swe-demo:build | Build this specific application in the Nx workspace |
npx nx g @nx/angular:app apps/[app-name] | Creates a new Angular application in the Nx workspace |
npx nx g @nx/angular:library libs/bricks-for-kids/feature --name=bricks-for-kids-feature | Creates a new Angular library in the Nx workspace |
nx generate @nx/workspace:remove <projectName> | Removes a project from the Nx workspace |
nx g @nx/angular:component libs/bricks-for-kids/ui/src/lib/lego-set-card/lego-set-card.component | Creates a new Angular component in a library |
nx g @nx/angular:service catalog/catalog.service --project=bricks-for-kids-feature | Creates a new Angular service in a library |
nx g @nx/angular:pipe libs/shared/ui/src/lib/pipes/initials | Creates a new Angular pipe in a library |
nx g @nx/angular:guard --project=swe-demo | Creates a new Angular guard in an Angular application |
nx graph | Shows the dependency graph of your Nx workspace |
npx nx run-many --all --target=test --parallel | Runs all tests in Nx workspace in parallel |
nx run shared-domain:test | Run tests for a specific project in Nx workspace |