Nx CLI
$ nx Official Low RiskExtensible build system and task runner for polyglot and TypeScript monorepos with computation caching and affected-graph analysis. Gives coding agents crisp nx show projects --json graph discovery and --dry-run code generation.
brew install nx Use nx CLI (nx show, nx run-many, nx affected) directly for task execution; pair with Nx Console MCP when agents need workspace-wide architecture guidance.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
nx show projects --json, nx show project --json, --no-interactive, and --dry-run give agents structured project discovery and safe execution.
- Supports
nx show projects --jsonandnx show project <name> --json - Supports
--no-interactiveandNX_INTERACTIVE=false
Local build/test runner with --dry-run on all generators and zero mandatory remote writes.
- Generators support
--dry-runbefore writing files - Local cache isolation under
.nx/cache
Available via npm, npx, and Homebrew across macOS, Linux, and Windows with Rust-accelerated core.
- Cross-platform package with native Rust hashing daemon
Affected-only test/lint/build selection dramatically reduces agent verification times in large monorepos.
nx affectedskips unaffected workspace packages
Maintained by Nx (Nrwl) under MIT license with frequent releases.
- Active
nrwl/nxrepository
Thorough CLI documentation and self-describing schema validation.
- Complete command reference at nx.dev
Security, Auth & Guardrails
Local execution requires no auth; optional Nx Cloud remote caching reads NX_CLOUD_ACCESS_TOKEN.
MIT open-source CLI and local cache are free; optional Nx Cloud remote cache has free and paid tiers.
# Nx CLI (nx) Agent Rules - Always pass `--no-interactive` (or `NX_INTERACTIVE=false`) when invoking generators or runners. - Query `nx show projects --json` and `nx show project <name> --json` instead of manually scanning `project.json` files. - Run `nx g ... --dry-run` before writing generated boilerplate.
Agent-Ready Command Recipes
Safe Read-Only Queries
npx nx show projects --affected --json
Returns only the projects impacted by current Git changes in clean JSON.
npx nx show project <project-name> --json
Outputs full resolved targets, inputs, and executor options for one project as JSON.
Controlled Writes & Previews
npx nx g @nx/js:lib my-lib --dry-run --no-interactive
Simulates file creation and edits without touching the workspace.
Strengths for Agents
- +
nx show projects --affected --jsonlets agents verify only impacted packages in huge monorepos. - + Every Nx generator supports
--dry-runand--no-interactive. - + Fast Rust-backed project graph and local computation caching.
Caveats & Pitfalls
- ! Background Nx daemon can occasionally hold stale graph state unless
NX_DAEMON=falseis set in ephemeral sandboxes. - ! Task execution logs (
nx run) remain streaming text rather than JSON.