Nx is designed for incremental adoption. You don’t need to restructure your project or migrate to a new setup — just run one command and Nx starts working alongside your existing tools.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/nrwl/nx/llms.txt
Use this file to discover all available pages before exploring further.
Add Nx with a single command
nx init walks you through adding and configuring Nx. At the end you’ll have an Nx workspace ready to use.
What nx init does
When you run nx init in an existing npm, pnpm, or yarn workspace, Nx:
- Installs the
nxpackage as a dev dependency in your rootpackage.json. - Creates
nx.json— the Nx configuration file at the root of your workspace. - Picks up your existing
package.jsonscripts — every script defined in anypackage.jsonin the workspace is automatically available as an Nx task. No manual task configuration needed. - Configures caching — Nx infers sensible cache inputs and outputs for common tools (Vite, Jest, TypeScript, etc.) so caching works immediately.
You do not need to rewrite or replace your existing
package.json scripts. Nx wraps them — calling nx build my-app executes the build script from my-app/package.json, equivalent to running npm run build inside that directory.After initializing
Oncenx init completes, try these commands:
Incremental adoption path
Nx is modular — you can adopt as much or as little as you need. A typical adoption progression looks like this:Start with task running and caching
After
nx init, every package.json script is available as an Nx task with local caching. No further configuration is required.Add Nx plugins for your tech stack
Nx plugins for React, Angular, Node, Vite, Jest, and others add:
- Precise cache input/output configuration (so cache invalidation is accurate)
- Code generators for scaffolding new projects, components, and configurations
- Inferred tasks from tool config files (e.g., a
vite.config.tsautomatically becomes abuildtarget)
Enable remote caching
Connect to Nx Cloud so cache hits are shared across your team and CI:Once connected, a build that passes on CI will never need to run again locally. Any developer or CI agent that runs the same task with the same inputs gets a cache hit.
In-depth adoption guides
Migrate to Nx
Step-by-step guide for migrating from Lerna, Turborepo, or a plain npm/pnpm/yarn workspace.
Angular plugin
Migrate an existing Angular CLI project to Nx with the automated migration command.
Set up CI
Connect Nx to GitHub Actions, GitLab, Azure, or any other CI provider.
Nx plugins
Add plugins for your tech stack to unlock auto-configured tasks, generators, and more.
