Loading...
Loading...
Configure, explore, and optimize Nx monorepo workspaces. Use when setting up Nx, exploring workspace structure, configuring project boundaries, running tasks, analyzing affected projects, optimizing build caching, or implementing CI/CD with affected commands. Keywords - nx, monorepo, workspace, projects, targets, affected, build, lint, test.
npx skill4agent add tech-leads-club/agent-skills nx-workspacenx show projectsnx show project <name> --jsonnx <target> <project>nx build my-appnx show projects --affectednx affected -t <target>Note: Prefix commands with/npx/pnpxif nx isn't installed globally.yarn
# List all projects
nx show projects
# Filter by type, pattern, or target
nx show projects --type app
nx show projects --projects "apps/*"
nx show projects --withTarget build
# Find affected projects
nx show projects --affected --base=mainnx show project <name> --jsonproject.json# Get full configuration
nx show project my-app --json
# Extract targets
nx show project my-app --json | jq '.targets | keys'node_modules/nx/schemas/nx-schema.jsonnode_modules/nx/schemas/project-schema.json# Run specific project
nx build web --configuration=production
# Run affected
nx affected -t test --base=main
# View dependency graph
nx graphworkspace/
├── apps/ # Deployable applications
├── libs/ # Shared libraries
│ ├── shared/ # Shared across scopes
│ └── feature/ # Feature-specific
├── nx.json # Workspace configuration
└── tools/ # Custom executors/generators| Type | Purpose | Example |
|---|---|---|
| feature | Business logic, smart components | |
| ui | Presentational components | |
| data-access | API calls, state management | |
| util | Pure functions, helpers | |
nx show projects --type app # List applications
nx show projects --type lib # List librariesnx show project X --json | jq '.targets | keys'nx show projects --affected --base=mainnx show project <name> --jsonfetch-depth: 0nx reset