docs: update nuxi command pages (#30199)

This commit is contained in:
Bobbie Goede 2024-12-18 11:29:56 +01:00 committed by GitHub
parent 8de9c5be50
commit c83507e315
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
15 changed files with 349 additions and 99 deletions

View File

@ -8,16 +8,30 @@ links:
size: xs size: xs
--- ---
<!--add-cmd-->
```bash [Terminal] ```bash [Terminal]
npx nuxi add [--cwd] [--force] <TEMPLATE> <NAME> npx nuxi add <TEMPLATE> <NAME> [--cwd=<directory>] [--logLevel=<silent|info|verbose>] [--force]
``` ```
<!--/add-cmd-->
### Arguments
<!--add-args-->
Argument | Description
--- | ---
`TEMPLATE` | Specify which template to generate (options: <api\|plugin\|component\|composable\|middleware\|layout\|page>)
`NAME` | Specify name of the generated file
<!--/add-args-->
### Options
<!--add-opts-->
Option | Default | Description Option | Default | Description
-------------------------|-----------------|------------------ --- | --- | ---
`TEMPLATE` | - | Specify a template of the file to be generated. `--cwd=<directory>` | `.` | Specify the working directory
`NAME` | - | Specify a name of the file that will be created. `--logLevel=<silent\|info\|verbose>` | | Specify build-time log level
`--cwd` | `.` | The directory of the target application. `--force` | `false` | Force override file if it already exists
`--force` | `false` | Force override file if it already exists. <!--/add-opts-->
**Modifiers:** **Modifiers:**

View File

@ -8,15 +8,33 @@ links:
size: xs size: xs
--- ---
<!--analyze-cmd-->
```bash [Terminal] ```bash [Terminal]
npx nuxi analyze [--log-level] [rootDir] npx nuxi analyze [ROOTDIR] [--cwd=<directory>] [--logLevel=<silent|info|verbose>] [--dotenv] [--name=<name>] [--no-serve]
``` ```
<!--/analyze-cmd-->
The `analyze` command builds Nuxt and analyzes the production bundle (experimental). The `analyze` command builds Nuxt and analyzes the production bundle (experimental).
## Arguments
<!--analyze-args-->
Argument | Description
--- | ---
`ROOTDIR="."` | Specifies the working directory (default: `.`)
<!--/analyze-args-->
## Options
<!--analyze-opts-->
Option | Default | Description Option | Default | Description
-------------------------|-----------------|------------------ --- | --- | ---
`rootDir` | `.` | The directory of the target application. `--cwd=<directory>` | | Specify the working directory, this takes precedence over ROOTDIR (default: `.`)
`--logLevel=<silent\|info\|verbose>` | | Specify build-time log level
`--dotenv` | | Path to `.env` file to load, relative to the root directory
`--name=<name>` | `default` | Name of the analysis
`--no-serve` | | Skip serving the analysis results
<!--/analyze-opts-->
::note ::note
This command sets `process.env.NODE_ENV` to `production`. This command sets `process.env.NODE_ENV` to `production`.

View File

@ -8,17 +8,35 @@ links:
size: xs size: xs
--- ---
<!--build-module-cmd-->
```bash [Terminal] ```bash [Terminal]
npx nuxi build-module [--stub] [rootDir] npx nuxi build-module [ROOTDIR] [--cwd=<directory>] [--logLevel=<silent|info|verbose>] [--build] [--stub] [--sourcemap] [--prepare]
``` ```
<!--/build-module-cmd-->
The `build-module` command runs `@nuxt/module-builder` to generate `dist` directory within your `rootDir` that contains the full build for your **nuxt-module**. The `build-module` command runs `@nuxt/module-builder` to generate `dist` directory within your `rootDir` that contains the full build for your **nuxt-module**.
Option | Default | Description ## Arguments
-------------------------|-----------------|------------------
`rootDir` | `.` | The root directory of the module to bundle.
`--stub` | `false` | Stub out your module for development using [jiti](https://github.com/unjs/jiti#jiti). (**note:** This is mainly for development purposes.)
::read-more{to="https://github.com/nuxt/module-builder" icon="i-simple-icons-github" color="gray" target="_blank"} <!--build-module-args-->
Argument | Description
--- | ---
`ROOTDIR="."` | Specifies the working directory (default: `.`)
<!--/build-module-args-->
## Options
<!--build-module-opts-->
Option | Default | Description
--- | --- | ---
`--cwd=<directory>` | | Specify the working directory, this takes precedence over ROOTDIR (default: `.`)
`--logLevel=<silent\|info\|verbose>` | | Specify build-time log level
`--build` | `false` | Build module for distribution
`--stub` | `false` | Stub dist instead of actually building it for development
`--sourcemap` | `false` | Generate sourcemaps
`--prepare` | `false` | Prepare module for local development
<!--/build-module-opts-->
::read-more{to="https://github.com/nuxt/module-builder" icon="i-simple-icons-github" color="gray" target="\_blank"}
Read more about `@nuxt/module-builder`. Read more about `@nuxt/module-builder`.
:: ::

View File

@ -8,19 +8,34 @@ links:
size: xs size: xs
--- ---
<!--build-cmd-->
```bash [Terminal] ```bash [Terminal]
npx nuxi build [--prerender] [--preset] [--dotenv] [--log-level] [rootDir] npx nuxi build [ROOTDIR] [--cwd=<directory>] [--logLevel=<silent|info|verbose>] [--prerender] [--preset] [--dotenv] [--envName]
``` ```
<!--/build-cmd-->
The `build` command creates a `.output` directory with all your application, server and dependencies ready for production. The `build` command creates a `.output` directory with all your application, server and dependencies ready for production.
## Arguments
<!--build-args-->
Argument | Description
--- | ---
`ROOTDIR="."` | Specifies the working directory (default: `.`)
<!--/build-args-->
## Options
<!--build-opts-->
Option | Default | Description Option | Default | Description
-------------------------|-----------------|------------------ --- | --- | ---
`rootDir` | `.` | The root directory of the application to bundle. `--cwd=<directory>` | | Specify the working directory, this takes precedence over ROOTDIR (default: `.`)
`--prerender` | `false` | Pre-render every route of your application. (**note:** This is an experimental flag. The behavior might be changed.) `--logLevel=<silent\|info\|verbose>` | | Specify build-time log level
`--preset` | - | Set a [Nitro preset](https://nitro.unjs.io/deploy#changing-the-deployment-preset) `--prerender` | | Build Nuxt and prerender static routes
`--dotenv` | `.` | Point to another `.env` file to load, **relative** to the root directory. `--preset` | | Nitro server preset
`--log-level` | `info` | Specify build-time logging level, allowing `silent` \| `info` \| `verbose`. `--dotenv` | | Path to `.env` file to load, relative to the root directory
`--envName` | | The environment to use when resolving configuration overrides (default is `production` when building, and `development` when running the dev server)
<!--/build-opts-->
::note ::note
This command sets `process.env.NODE_ENV` to `production`. This command sets `process.env.NODE_ENV` to `production`.

View File

@ -1,6 +1,6 @@
--- ---
title: 'nuxi cleanup' title: 'nuxi cleanup'
description: "Remove common generated Nuxt files and caches." description: 'Remove common generated Nuxt files and caches.'
links: links:
- label: Source - label: Source
icon: i-simple-icons-github icon: i-simple-icons-github
@ -8,16 +8,31 @@ links:
size: xs size: xs
--- ---
<!--cleanup-cmd-->
```bash [Terminal] ```bash [Terminal]
npx nuxi cleanup [rootDir] npx nuxi cleanup [ROOTDIR] [--cwd=<directory>]
``` ```
<!--/cleanup-cmd-->
The `cleanup` command removes common generated Nuxt files and caches, including: The `cleanup` command removes common generated Nuxt files and caches, including:
- `.nuxt` - `.nuxt`
- `.output` - `.output`
- `node_modules/.vite` - `node_modules/.vite`
- `node_modules/.cache` - `node_modules/.cache`
## Arguments
<!--cleanup-args-->
Argument | Description
--- | ---
`ROOTDIR="."` | Specifies the working directory (default: `.`)
<!--/cleanup-args-->
## Options
<!--cleanup-opts-->
Option | Default | Description Option | Default | Description
-------------------------|-----------------|------------------ --- | --- | ---
`rootDir` | `.` | The root directory of the project. `--cwd=<directory>` | | Specify the working directory, this takes precedence over ROOTDIR (default: `.`)
<!--/cleanup-opts-->

View File

@ -8,25 +8,45 @@ links:
size: xs size: xs
--- ---
<!--dev-cmd-->
```bash [Terminal] ```bash [Terminal]
npx nuxi dev [rootDir] [--dotenv] [--log-level] [--clipboard] [--open, -o] [--no-clear] [--port, -p] [--host, -h] [--https] [--ssl-cert] [--ssl-key] [--tunnel] npx nuxi dev [ROOTDIR] [--cwd=<directory>] [--logLevel=<silent|info|verbose>] [--dotenv] [--envName] [--no-clear] [--no-fork] [-p, --port] [-h, --host] [--clipboard] [-o, --open] [--https] [--publicURL] [--qr] [--public] [--tunnel] [--sslCert] [--sslKey]
``` ```
<!--/dev-cmd-->
The `dev` command starts a development server with hot module replacement at [http://localhost:3000](https://localhost:3000) The `dev` command starts a development server with hot module replacement at [http://localhost:3000](https://localhost:3000)
## Arguments
<!--dev-args-->
Argument | Description
--- | ---
`ROOTDIR="."` | Specifies the working directory (default: `.`)
<!--/dev-args-->
## Options
<!--dev-opts-->
Option | Default | Description Option | Default | Description
-------------------------|-----------------|------------------ --- | --- | ---
`rootDir` | `.` | The root directory of the application to serve. `--cwd=<directory>` | | Specify the working directory, this takes precedence over ROOTDIR (default: `.`)
`--dotenv` | `.` | Point to another `.env` file to load, **relative** to the root directory. `--logLevel=<silent\|info\|verbose>` | | Specify build-time log level
`--open, -o` | `false` | Open URL in browser. `--dotenv` | | Path to `.env` file to load, relative to the root directory
`--clipboard` | `false` | Copy URL to clipboard. `--envName` | | The environment to use when resolving configuration overrides (default is `production` when building, and `development` when running the dev server)
`--no-clear` | `false` | Does not clear the console after startup. `--no-clear` | | Disable clear console on restart
`--port, -p` | `3000` | Port to listen. `--no-fork` | | Disable forked mode
`--host, -h` | `localhost` | Hostname of the server. `-p, --port` | | Port to listen on (default: `NUXT_PORT \|\| NITRO_PORT \|\| PORT \|\| nuxtOptions.devServer.port`)
`--https` | `false` | Listen with `https` protocol with a self-signed certificate by default. `-h, --host` | | Host to listen on (default: `NUXT_HOST \|\| NITRO_HOST \|\| HOST \|\| nuxtOptions._layers?.[0]?.devServer?.host`)
`--ssl-cert` |`null` | Specify a certificate for https. `--clipboard` | `false` | Copy the URL to the clipboard
`--ssl-key` |`null` | Specify the key for the https certificate. `-o, --open` | `false` | Open the URL in the browser
`--tunnel` | `false` | Tunnel your local server to the internet with [unjs/untun](https://github.com/unjs/untun) `--https` | | Enable HTTPS
`--publicURL` | | Displayed public URL (used for QR code)
`--qr` | | Display The QR code of public URL when available
`--public` | | Listen to all network interfaces
`--tunnel` | | Open a tunnel using https://github.com/unjs/untun
`--sslCert` | | (DEPRECATED) Use `--https.cert` instead.
`--sslKey` | | (DEPRECATED) Use `--https.key` instead.
<!--/dev-opts-->
The port and host can also be set via NUXT_PORT, PORT, NUXT_HOST or HOST environment variables. The port and host can also be set via NUXT_PORT, PORT, NUXT_HOST or HOST environment variables.

View File

@ -8,16 +8,31 @@ links:
size: xs size: xs
--- ---
<!--devtools-cmd-->
```bash [Terminal] ```bash [Terminal]
npx nuxi devtools enable|disable [rootDir] npx nuxi devtools <COMMAND> [ROOTDIR] [--cwd=<directory>]
``` ```
<!--/devtools-cmd-->
Running `nuxi devtools enable` will install the Nuxt DevTools globally, and also enable it within the particular project you are using. It is saved as a preference in your user-level `.nuxtrc`. If you want to remove devtools support for a particular project, you can run `nuxi devtools disable`. Running `nuxi devtools enable` will install the Nuxt DevTools globally, and also enable it within the particular project you are using. It is saved as a preference in your user-level `.nuxtrc`. If you want to remove devtools support for a particular project, you can run `nuxi devtools disable`.
Option | Default | Description ## Arguments
-------------------------|-----------------|------------------
`rootDir` | `.` | The root directory of the app you want to enable devtools for.
::read-more{icon="i-simple-icons-nuxtdotjs" to="https://devtools.nuxt.com" target="_blank"} <!--devtools-args-->
Argument | Description
--- | ---
`COMMAND` | Command to run (options: <enable\|disable>)
`ROOTDIR="."` | Specifies the working directory (default: `.`)
<!--/devtools-args-->
## Options
<!--devtools-opts-->
Option | Default | Description
--- | --- | ---
`--cwd=<directory>` | | Specify the working directory, this takes precedence over ROOTDIR (default: `.`)
<!--/devtools-opts-->
::read-more{icon="i-simple-icons-nuxtdotjs" to="https://devtools.nuxt.com" target="\_blank"}
Read more about the **Nuxt DevTools**. Read more about the **Nuxt DevTools**.
:: ::

View File

@ -8,16 +8,33 @@ links:
size: xs size: xs
--- ---
<!--generate-cmd-->
```bash [Terminal] ```bash [Terminal]
npx nuxi generate [rootDir] [--dotenv] npx nuxi generate [ROOTDIR] [--cwd=<directory>] [--logLevel=<silent|info|verbose>] [--preset] [--dotenv] [--envName]
``` ```
<!--/generate-cmd-->
The `generate` command pre-renders every route of your application and stores the result in plain HTML files that you can deploy on any static hosting services. The command triggers the `nuxi build` command with the `prerender` argument set to `true` The `generate` command pre-renders every route of your application and stores the result in plain HTML files that you can deploy on any static hosting services. The command triggers the `nuxi build` command with the `prerender` argument set to `true`
## Arguments
<!--generate-args-->
Argument | Description
--- | ---
`ROOTDIR="."` | Specifies the working directory (default: `.`)
<!--/generate-args-->
## Options
<!--generate-opts-->
Option | Default | Description Option | Default | Description
-------------------------|-----------------|------------------ --- | --- | ---
`rootDir` | `.` | The root directory of the application to generate `--cwd=<directory>` | | Specify the working directory, this takes precedence over ROOTDIR (default: `.`)
`--dotenv` | `.` | Point to another `.env` file to load, **relative** to the root directory. `--logLevel=<silent\|info\|verbose>` | | Specify build-time log level
`--preset` | | Nitro server preset
`--dotenv` | | Path to `.env` file to load, relative to the root directory
`--envName` | | The environment to use when resolving configuration overrides (default is `production` when building, and `development` when running the dev server)
<!--/generate-opts-->
::read-more{to="/docs/getting-started/deployment#static-hosting"} ::read-more{to="/docs/getting-started/deployment#static-hosting"}
Read more about pre-rendering and static hosting. Read more about pre-rendering and static hosting.

View File

@ -8,12 +8,26 @@ links:
size: xs size: xs
--- ---
<!--info-cmd-->
```bash [Terminal] ```bash [Terminal]
npx nuxi info [rootDir] npx nuxi info [ROOTDIR] [--cwd=<directory>]
``` ```
<!--/info-cmd-->
The `info` command logs information about the current or specified Nuxt project. The `info` command logs information about the current or specified Nuxt project.
## Arguments
<!--info-args-->
Argument | Description
--- | ---
`ROOTDIR="."` | Specifies the working directory (default: `.`)
<!--/info-args-->
## Options
<!--info-opts-->
Option | Default | Description Option | Default | Description
-------------------------|-----------------|------------------ --- | --- | ---
`rootDir` | `.` | The directory of the target application. `--cwd=<directory>` | | Specify the working directory, this takes precedence over ROOTDIR (default: `.`)
<!--/info-opts-->

View File

@ -8,27 +8,37 @@ links:
size: xs size: xs
--- ---
<!--init-cmd-->
```bash [Terminal] ```bash [Terminal]
npx nuxi init [--verbose|-v] [--template,-t] [dir] npx nuxi init [DIR] [--cwd=<directory>] [-t, --template] [-f, --force] [--offline] [--preferOffline] [--no-install] [--gitInit] [--shell] [--packageManager]
``` ```
<!--/init-cmd-->
The `init` command initializes a fresh Nuxt project using [unjs/giget](https://github.com/unjs/giget). The `init` command initializes a fresh Nuxt project using [unjs/giget](https://github.com/unjs/giget).
## Arguments
<!--init-args-->
Argument | Description
--- | ---
`DIR=""` | Project directory
<!--/init-args-->
## Options ## Options
<!--init-opts-->
Option | Default | Description Option | Default | Description
-------------------------|-----------------|------------------ --- | --- | ---
`--cwd` | | Current working directory `--cwd=<directory>` | `.` | Specify the working directory
`--log-level` | | Log level `-t, --template` | | Template name
`--template, -t` | `v3` | Specify template name or git repository to use as a template. Format is `gh:org/name` to use a custom github template. `-f, --force` | | Override existing directory
`--force, -f` | `false` | Force clone to any existing directory. `--offline` | | Force offline mode
`--offline` | `false` | Force offline mode (do not attempt to download template from GitHub and only use local cache). `--preferOffline` | | Prefer offline mode
`--prefer-offline` | `false` | Prefer offline mode (try local cache first to download templates). `--no-install` | | Skip installing dependencies
`--no-install` | `false` | Skip installing dependencies. `--gitInit` | | Initialize git repository
`--git-init` | `false` | Initialize git repository. `--shell` | | Start shell after installation in project directory
`--shell` | `false` | Start shell after installation in project directory (experimental). `--packageManager` | | Package manager choice (npm, pnpm, yarn, bun)
`--package-manager` | `npm` | Package manager choice (npm, pnpm, yarn, bun). <!--/init-opts-->
`--dir` | | Project directory.
## Environment variables ## Environment variables

View File

@ -12,17 +12,31 @@ Nuxi provides a few utilities to work with [Nuxt modules](/modules) seamlessly.
## nuxi module add ## nuxi module add
<!--module-add-cmd-->
```bash [Terminal] ```bash [Terminal]
npx nuxi module add <NAME> npx nuxi module add <MODULENAME> [--cwd=<directory>] [--logLevel=<silent|info|verbose>] [--skipInstall] [--skipConfig]
``` ```
<!--/module-add-cmd-->
<!--module-add-args-->
Argument | Description
--- | ---
`MODULENAME` | Module name
<!--/module-add-args-->
<!--module-add-opts-->
Option | Default | Description Option | Default | Description
-------------------------|-----------------|------------------ --- | --- | ---
`NAME` | - | The name of the module to install. `--cwd=<directory>` | `.` | Specify the working directory
`--logLevel=<silent\|info\|verbose>` | | Specify build-time log level
`--skipInstall` | | Skip npm install
`--skipConfig` | | Skip nuxt.config.ts update
<!--/module-add-opts-->
The command lets you install [Nuxt modules](/modules) in your application with no manual work. The command lets you install [Nuxt modules](/modules) in your application with no manual work.
When running the command, it will: When running the command, it will:
- install the module as a dependency using your package manager - install the module as a dependency using your package manager
- add it to your [package.json](/docs/guide/directory-structure/package) file - add it to your [package.json](/docs/guide/directory-structure/package) file
- update your [`nuxt.config`](/docs/guide/directory-structure/nuxt-config) file - update your [`nuxt.config`](/docs/guide/directory-structure/nuxt-config) file
@ -30,19 +44,35 @@ When running the command, it will:
**Example:** **Example:**
Installing the [`Pinia`](/modules/pinia) module Installing the [`Pinia`](/modules/pinia) module
```bash [Terminal] ```bash [Terminal]
npx nuxi module add pinia npx nuxi module add pinia
``` ```
## nuxi module search ## nuxi module search
<!--module-search-cmd-->
```bash [Terminal] ```bash [Terminal]
npx nuxi module search <QUERY> npx nuxi module search <QUERY> [--cwd=<directory>] [--nuxtVersion=<2|3>]
``` ```
<!--/module-search-cmd-->
### Arguments
<!--module-search-args-->
Argument | Description
--- | ---
`QUERY` | keywords to search for
<!--/module-search-args-->
### Options
<!--module-search-opts-->
Option | Default | Description Option | Default | Description
-------------------------|-----------------|------------------ --- | --- | ---
`QUERY` | - | The name of the module to search for. `--cwd=<directory>` | `.` | Specify the working directory
`--nuxtVersion=<2\|3>` | | Filter by Nuxt version and list compatible modules only (auto detected by default)
<!--/module-search-opts-->
The command searches for Nuxt modules matching your query that are compatible with your Nuxt version. The command searches for Nuxt modules matching your query that are compatible with your Nuxt version.

View File

@ -8,12 +8,29 @@ links:
size: xs size: xs
--- ---
<!--prepare-cmd-->
```bash [Terminal] ```bash [Terminal]
npx nuxi prepare [--log-level] [rootDir] npx nuxi prepare [ROOTDIR] [--dotenv] [--cwd=<directory>] [--logLevel=<silent|info|verbose>] [--envName]
``` ```
<!--/prepare-cmd-->
The `prepare` command creates a [`.nuxt`](/docs/guide/directory-structure/nuxt) directory in your application and generates types. This can be useful in a CI environment or as a `postinstall` command in your [`package.json`](/docs/guide/directory-structure/package). The `prepare` command creates a [`.nuxt`](/docs/guide/directory-structure/nuxt) directory in your application and generates types. This can be useful in a CI environment or as a `postinstall` command in your [`package.json`](/docs/guide/directory-structure/package).
## Arguments
<!--prepare-args-->
Argument | Description
--- | ---
`ROOTDIR="."` | Specifies the working directory (default: `.`)
<!--/prepare-args-->
## Options
<!--prepare-opts-->
Option | Default | Description Option | Default | Description
-------------------------|-----------------|------------------ --- | --- | ---
`rootDir` | `.` | The root directory of the application to prepare. `--dotenv` | | Path to `.env` file to load, relative to the root directory
`--cwd=<directory>` | | Specify the working directory, this takes precedence over ROOTDIR (default: `.`)
`--logLevel=<silent\|info\|verbose>` | | Specify build-time log level
`--envName` | | The environment to use when resolving configuration overrides (default is `production` when building, and `development` when running the dev server)
<!--/prepare-opts-->

View File

@ -8,16 +8,32 @@ links:
size: xs size: xs
--- ---
<!--preview-cmd-->
```bash [Terminal] ```bash [Terminal]
npx nuxi preview|start [rootDir] [--dotenv] npx nuxi preview [ROOTDIR] [--cwd=<directory>] [--logLevel=<silent|info|verbose>] [--envName] [--dotenv]
``` ```
<!--/preview-cmd-->
The `preview` command starts a server to preview your Nuxt application after running the `build` command. The `start` command is an alias for `preview`. When running your application in production refer to the [Deployment section](/docs/getting-started/deployment). The `preview` command starts a server to preview your Nuxt application after running the `build` command. The `start` command is an alias for `preview`. When running your application in production refer to the [Deployment section](/docs/getting-started/deployment).
## Arguments
<!--preview-args-->
Argument | Description
--- | ---
`ROOTDIR="."` | Specifies the working directory (default: `.`)
<!--/preview-args-->
## Options
<!--preview-opts-->
Option | Default | Description Option | Default | Description
-------------------------|-----------------|------------------ --- | --- | ---
`rootDir` | `.` | The root directory of the application to preview. `--cwd=<directory>` | | Specify the working directory, this takes precedence over ROOTDIR (default: `.`)
`--dotenv` | `.` | Point to another `.env` file to load, **relative** to the root directory. `--logLevel=<silent\|info\|verbose>` | | Specify build-time log level
`--envName` | | The environment to use when resolving configuration overrides (default is `production` when building, and `development` when running the dev server)
`--dotenv` | | Path to `.env` file to load, relative to the root directory
<!--/preview-opts-->
This command sets `process.env.NODE_ENV` to `production`. To override, define `NODE_ENV` in a `.env` file or as command-line argument. This command sets `process.env.NODE_ENV` to `production`. To override, define `NODE_ENV` in a `.env` file or as command-line argument.

View File

@ -8,15 +8,30 @@ links:
size: xs size: xs
--- ---
<!--typecheck-cmd-->
```bash [Terminal] ```bash [Terminal]
npx nuxi typecheck [--log-level] [rootDir] npx nuxi typecheck [ROOTDIR] [--cwd=<directory>] [--logLevel=<silent|info|verbose>]
``` ```
<!--/typecheck-cmd-->
The `typecheck` command runs [`vue-tsc`](https://github.com/vuejs/language-tools/tree/master/packages/tsc) to check types throughout your app. The `typecheck` command runs [`vue-tsc`](https://github.com/vuejs/language-tools/tree/master/packages/tsc) to check types throughout your app.
## Arguments
<!--typecheck-args-->
Argument | Description
--- | ---
`ROOTDIR="."` | Specifies the working directory (default: `.`)
<!--/typecheck-args-->
## Options
<!--typecheck-opts-->
Option | Default | Description Option | Default | Description
-------------------------|-----------------|------------------ --- | --- | ---
`rootDir` | `.` | The directory of the target application. `--cwd=<directory>` | | Specify the working directory, this takes precedence over ROOTDIR (default: `.`)
`--logLevel=<silent\|info\|verbose>` | | Specify build-time log level
<!--/typecheck-opts-->
::note ::note
This command sets `process.env.NODE_ENV` to `production`. To override, define `NODE_ENV` in a [`.env`](/docs/guide/directory-structure/env) file or as a command-line argument. This command sets `process.env.NODE_ENV` to `production`. To override, define `NODE_ENV` in a [`.env`](/docs/guide/directory-structure/env) file or as a command-line argument.

View File

@ -8,13 +8,29 @@ links:
size: xs size: xs
--- ---
<!--upgrade-cmd-->
```bash [Terminal] ```bash [Terminal]
npx nuxi upgrade [--force|-f] npx nuxi upgrade [ROOTDIR] [--cwd=<directory>] [--logLevel=<silent|info|verbose>] [-f, --force] [-ch, --channel=<stable|nightly>]
``` ```
<!--/upgrade-cmd-->
The `upgrade` command upgrades Nuxt to the latest version. The `upgrade` command upgrades Nuxt to the latest version.
## Arguments
<!--upgrade-args-->
Argument | Description
--- | ---
`ROOTDIR="."` | Specifies the working directory (default: `.`)
<!--/upgrade-args-->
## Options
<!--upgrade-opts-->
Option | Default | Description Option | Default | Description
-------------------------|-----------------|------------------ --- | --- | ---
`--force, -f` | `false` | Removes `node_modules` and lock files before upgrade. `--cwd=<directory>` | | Specify the working directory, this takes precedence over ROOTDIR (default: `.`)
`--channel, -ch` | `"stable"` | Specify a channel to install from ("nightly" or "stable") `--logLevel=<silent\|info\|verbose>` | | Specify build-time log level
`-f, --force` | | Force upgrade to recreate lockfile and node_modules
`-ch, --channel=<stable\|nightly>` | `stable` | Specify a channel to install from (default: stable)
<!--/upgrade-opts-->