Favicon of Nx

Nx

Nx is an MIT-licensed monorepo build system for TypeScript and polyglot codebases with caching, affected-only runs, and CI integration.

Nx website screenshot
Nx GitHub repository preview

Nx is a build system and monorepo tool for JavaScript, TypeScript, and polyglot codebases. It's built for teams managing multiple apps and libraries in a single repository who want faster builds and CI runs without rewriting their existing setup. Written in TypeScript with a Rust core for performance, it works on top of npm, pnpm, or yarn workspaces.

It targets developers who already have a working package.json-based project and want incremental adoption rather than a full framework switch. It also fits teams running CI pipelines that re-run the same tests and builds on every commit, since Nx can detect what actually changed and skip the rest.

Key features

  • Incremental adoption: run npx nx init in an existing npm, pnpm, or yarn workspace and Nx picks up existing package.json scripts without requiring config changes.
  • Computation caching: Nx caches task outputs locally and remotely, so unchanged code doesn't get rebuilt or retested.
  • Affected-only execution: Nx analyzes the dependency graph and runs only the tasks impacted by a given change, instead of the whole workspace.
  • Polyglot plugin system: plugins auto-discover tasks and cache inputs/outputs for tools like Vite, Webpack, Jest, Vitest, ESLint, Gradle, Maven, .NET, and Go.
  • CI integration: connects to GitHub Actions, GitLab, Azure, and other providers to enable remote caching, task distribution across machines, and automatic e2e test splitting.
  • Self-healing CI: an AI agent can detect CI failures, analyze the root cause, propose a fix, and verify it, with local agents connecting to CI via MCP.
  • AI-agent-friendly CLI: the CLI is designed so autonomous AI agents can get workspace context and operate on the codebase similarly to a human developer.

Ideal use cases

Nx fits teams running multiple apps and shared libraries in one repository, especially where CI time has grown because every commit re-runs every build and test suite. It's a good fit if you already use npm, pnpm, or yarn workspaces and want caching and affected-detection layered on top without a rewrite. Organizations using a mix of frameworks (React, Angular, Next.js) alongside non-JS tooling (Gradle, Maven, .NET, Go) can use Nx's plugin system to unify task running across the stack.

It's less useful for single-package repositories with no build pipeline to optimize, or projects that never share code between multiple deployable units, since there's no monorepo structure for Nx to leverage. Teams fully committed to a different monorepo tool (like Bazel or Turborepo) with existing tuned pipelines may not see enough benefit to justify migration unless CI time or caching gaps are an active pain point.

Installation

Add Nx to an existing npm, pnpm, or yarn workspace:

npx nx init

This command inspects your existing package.json scripts, sets up caching for their outputs, and configures affected-only runs without requiring changes to your current project setup. For creating a new workspace from scratch or a full walkthrough, follow the Nx quickstart docs. To connect Nx to a CI provider for remote caching and task distribution, see the CI setup docs.

Frequently asked questions

Share:

Stars
29.1K
Forks
2.9K
Last commit
2 days ago
Repository age
9 years
License
MIT
Self-hosted
No
Activity score
84/100
View Repository
Ad
Favicon

 

  
 

Similar to Nx

Favicon

 

  
 
Favicon

 

  
 
Favicon