Let an AI agent set it up for you Help me add Nx to my existing repository.
1. Run `npx nx@latest init` from the repo root and walk me through the prompts. Do not pass `--interactive=false`, the answers depend on how my repo is laid out.
2. Show me the diff. `nx.json` is new, and `package.json` gains an `nx` devDependency. Scripts should be left alone.
3. Run `npx nx run-many -t build` to confirm tasks still work, then run it a second time so I can see the cache hit.
4. Run `npx nx graph` and walk me through the project graph.
Stage what changed but do not commit. Do not add plugins or restructure the repo unless I ask.
Page: https://nx.dev/docs/getting-started/start-with-existing-project.md
Help me add Nx to my existing repository.
1. Run `npx nx@latest init` from the repo root and walk me through the prompts. Do not pass `--interactive=false`, the answers depend on how my repo is laid out.
2. Show me the diff. `nx.json` is new, and `package.json` gains an `nx` devDependency. Scripts should be left alone.
3. Run `npx nx run-many -t build` to confirm tasks still work, then run it a second time so I can see the cache hit.
4. Run `npx nx graph` and walk me through the project graph.
Stage what changed but do not commit. Do not add plugins or restructure the repo unless I ask.
Page: https://nx.dev/docs/getting-started/start-with-existing-project.md
Help me add Nx to my existing repository.
1. Run `npx nx@latest init` from the repo root and walk me through the prompts. Do not pass `--interactive=false`, the answers depend on how my repo is laid out.
2. Show me the diff. `nx.json` is new, and `package.json` gains an `nx` devDependency. Scripts should be left alone.
3. Run `npx nx run-many -t build` to confirm tasks still work, then run it a second time so I can see the cache hit.
4. Run `npx nx graph` and walk me through the project graph.
Stage what changed but do not commit. Do not add plugins or restructure the repo unless I ask.
Page: https://nx.dev/docs/getting-started/start-with-existing-project.md
Nx is designed for incremental adoption. Start with task running and caching, then add plugins, CI integrations, or other capabilities as your needs grow.
From PNPM Workspaces to Distributed CI
Watch full courseAdd Nx to any existing project with a single command:
$ npx nx@latest init✓ detecting workspace structure✓ adding Nx to package.json→ ready in 12sWhether a monorepo, single project, or something in between, nx init walks you through adding and configuring Nx. At the end you'll have an Nx workspace ready for anything.
Next steps
Section titled “Next steps”After initializing Nx, try these commands:
nx build <project-name> # Run a tasknx build <project-name> # Run again - instant cache hitnx run-many -t build test # Run tasks across all projectsnx graph # Visualize project dependenciesFrom here you can:
- Configure task caching to speed up repeated builds
- Add Nx plugins for your tech stack (React, Angular, Node, etc.)
- Work through the adoption guides for your setup, such as migrating from the Angular CLI or importing projects from another repo
Keep learning
Section titled “Keep learning”- New to Nx? → Follow the tutorial series to learn core concepts hands-on
- Working with AI? → Set up AI integrations so agents understand your workspace
- Ready for CI? → Set up CI with remote caching and affected commands
- Prefer video? → Learn with our video courses