Start a new project with Nx

When you start a new project with Nx, you have the following options.

Option 1: Add Nx to your existing setup

You can add Nx to any existing setup - whether you're creating a new project from scratch (for example using npm/pnpm/yarn workspaces), bootstrapping with a framework or metaframework CLI, or working with an existing project you've been developing for a while.

Let's take the example of an NPM workspace. Create a new root-level package.json like:

1{ 2 "name": "my-workspace", 3 "version": "1.0.0", 4 "private": true, 5 "workspaces": ["packages/*", "apps/*"] 6} 7

Then you can add Nx to it by using:

nx init

(Note, make sure you have Nx installed globally or use npx if you're in a JavaScript environment)

Nx will detect the underlying workspace configuration, ask you a couple of questions and install itself into the workspace. As you keep going, you can incrementally add functionality, like:

Option 2: Create a new workspace with presets

Alternatively, you can choose a more guided approach by leveraging some of the presets Nx comes with.

Run the following command to get started:

npx create-nx-workspace@latest

This interactive command will guide you through the setup process, allowing you to:

  • Choose your workspace name - This will be the name of your root directory
  • Select your preferred package manager - npm, yarn, or pnpm
  • Pick a preset - Choose from various technology stacks and configurations
  • Configure additional options - Such as styling solutions, testing frameworks, and more

Choose a preset that matches your technology stack. This gives you a fully configured workspace.

You can also choose an empty workspace preset which sets up the bare minimum configuration including Nx itself. This allows you to add technologies and features incrementally over time as you need them.

Option 3: Get the complete Nx platform experience

Nx Cloud onboarding

For the complete experience, you can also get started directly from the Nx Cloud application.

This approach gives you a fully end-to-end development workflow right from the start, making it easy to get up and running when your project is in its initial phase. You'll get a fully working CI configuration that includes Nx Cloud's AI-powered features like AI-powered self-healing CI that automatically fixes common CI failures. This means you benefit from intelligent automation right from day one, without having to configure complex CI pipelines manually.

As your project grows and scales, you'll have access to additional features like remote caching to speed up builds across your team, distributed task execution with Nx Agents to parallelize work across multiple machines, and automatic test splitting to optimize your CI pipeline performance.

Get started with the complete Nx platform experience →