---
title: "Nuxt CLI"
description: "The Nuxt CLI runs, builds and inspects your Nuxt application from the command line."
canonical_url: "https://nuxt.com/docs/4.x/api/commands/overview"
---
# Nuxt CLI

> The Nuxt CLI runs, builds and inspects your Nuxt application from the command line.

`@nuxt/cli` is the `nuxt` command: it runs the dev server, builds your application for production, scaffolds files, manages modules and answers questions about your project. It is a dependency of `nuxt`, so a Nuxt project already has it.

```bash [Terminal]
npx nuxt dev
```

The binary is installed as `nuxt`, and also as `nuxi`, `nuxi-ng` and `nuxt-cli` for compatibility with older setups.

Two other packages ship the same commands for different situations. `nuxi` is a standalone build with no runtime dependencies, for running commands outside a project or installing globally. Scaffolding a new project is [`create-nuxt`](https://nuxt.com/docs/4.x/api/commands/init), a separate package so that it can be run without a project to install into.

## Running commands

Inside a project, your package manager runs the version the project depends on:

```bash [Terminal]
pnpm nuxt dev
npm exec nuxt dev
yarn nuxt dev
bun nuxt dev
```

Outside a project, `npx nuxi` runs the same commands from its own bundled copy.

## Global options

`--cwd` may be passed before the command name as well as after it, which is useful in a monorepo:

```bash [Terminal]
npx nuxt --cwd apps/web dev
```

Commands that take a `ROOTDIR` positional treat an explicit `--cwd` as an override of it. `--help` on any command prints its arguments and options, and `--version` prints the CLI version.

Node.js 18 or newer is required. Older versions still run, with a warning that they are unsupported.

## Project commands

A command the CLI does not provide is looked up as a `nuxt-<command>` binary in your project, so a dependency can add a command of its own. This is how [`nuxt build-module`](https://nuxt.com/docs/4.x/api/commands/build-module) works: it runs the `nuxt-build-module` binary that `@nuxt/module-builder` installs.

## Shell completions

`nuxt complete <shell>` prints a completion script, powered by [`@bomb.sh/tab`](https://github.com/bombshell-dev/tab). It completes commands, flags and some flag values: ports and hosts for `nuxt dev`, Nitro presets for `nuxt build --preset`, starter templates for `nuxt init --template`, and log levels.

<code-group>

```bash [zsh]
npx nuxt complete zsh > "${fpath[1]}/_nuxt"
```

```bash [bash]
npx nuxt complete bash > /etc/bash_completion.d/nuxt
```

```bash [fish]
npx nuxt complete fish > ~/.config/fish/completions/nuxt.fish
```

</code-group>

`powershell` is also supported, and `create-nuxt complete <shell>` has its own script which completes starter template names.

<note>

Completions work through your package manager too (`pnpm nuxt <Tab>`), if you install [tab's package manager completions](https://github.com/bombshell-dev/tab?tab=readme-ov-file#package-manager-completions).

</note>

## Debugging the CLI

Set `DEBUG=nuxi` for extra diagnostics from the CLI itself, such as dev server startup timings and the paths it removes during cleanup.

## Prereleases

Every commit is published to the nightly channel:

```bash [Terminal]
npm install -D @nuxt/cli-nightly
npx @nuxt/cli-nightly dev
```

`create-nuxt-nightly` scaffolds with it, and `npm create nuxt@latest --nightly` scaffolds a project against the Nuxt nightly channel.

Builds for an individual pull request are published by [pkg.pr.new](https://pkg.pr.new) and linked from the pull request itself, which is the quickest way to check whether a fix works before it is released.

---

- [Source](https://github.com/nuxt/cli)


## Sitemap

See the full [sitemap](https://nuxt.com/sitemap.md) for all pages.
