Skip to main content

Useful Nx commands

November 17, 2025Less than 1 minute

Useful Nx commands

commanddescription
npx create-nx-workspace@latest monorepo-nameCreates a new Nx workspace
npx nx run swe-demo:serveServe/run this specific application in the Nx workspace
npx nx run swe-demo:buildBuild 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-featureCreates 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.componentCreates a new Angular component in a library
nx g @nx/angular:service catalog/catalog.service --project=bricks-for-kids-featureCreates a new Angular service in a library
nx g @nx/angular:pipe libs/shared/ui/src/lib/pipes/initialsCreates a new Angular pipe in a library
nx g @nx/angular:guard --project=swe-demoCreates a new Angular guard in an Angular application
nx graphShows the dependency graph of your Nx workspace
npx nx run-many --all --target=test --parallelRuns all tests in Nx workspace in parallel
nx run shared-domain:testRun tests for a specific project in Nx workspace