2023-12-18 12:00:03 +00:00
|
|
|
---
|
|
|
|
title: "nuxi module"
|
|
|
|
description: "Search and add modules to your Nuxt application with the command line."
|
|
|
|
links:
|
|
|
|
- label: Source
|
|
|
|
icon: i-simple-icons-github
|
2025-01-16 23:58:26 +00:00
|
|
|
to: https://github.com/nuxt/cli/blob/main/packages/nuxi/src/commands/module/
|
2023-12-18 12:00:03 +00:00
|
|
|
size: xs
|
|
|
|
---
|
|
|
|
|
|
|
|
Nuxi provides a few utilities to work with [Nuxt modules](/modules) seamlessly.
|
|
|
|
|
|
|
|
## nuxi module add
|
|
|
|
|
2024-12-18 10:29:56 +00:00
|
|
|
<!--module-add-cmd-->
|
2023-12-18 12:00:03 +00:00
|
|
|
```bash [Terminal]
|
2025-01-06 16:27:27 +00:00
|
|
|
npx nuxi module add <MODULENAME> [--cwd=<directory>] [--logLevel=<silent|info|verbose>] [--skipInstall] [--skipConfig] [--dev]
|
2023-12-18 12:00:03 +00:00
|
|
|
```
|
2024-12-18 10:29:56 +00:00
|
|
|
<!--/module-add-cmd-->
|
2023-12-18 12:00:03 +00:00
|
|
|
|
2024-12-18 10:29:56 +00:00
|
|
|
<!--module-add-args-->
|
|
|
|
Argument | Description
|
|
|
|
--- | ---
|
|
|
|
`MODULENAME` | Module name
|
|
|
|
<!--/module-add-args-->
|
|
|
|
|
|
|
|
<!--module-add-opts-->
|
|
|
|
Option | Default | Description
|
|
|
|
--- | --- | ---
|
|
|
|
`--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
|
2025-01-06 16:27:27 +00:00
|
|
|
`--dev` | | Install module as dev dependency
|
2024-12-18 10:29:56 +00:00
|
|
|
<!--/module-add-opts-->
|
2023-12-18 12:00:03 +00:00
|
|
|
|
|
|
|
The command lets you install [Nuxt modules](/modules) in your application with no manual work.
|
|
|
|
|
|
|
|
When running the command, it will:
|
2024-12-18 10:29:56 +00:00
|
|
|
|
2023-12-18 12:00:03 +00:00
|
|
|
- install the module as a dependency using your package manager
|
|
|
|
- add it to your [package.json](/docs/guide/directory-structure/package) file
|
|
|
|
- update your [`nuxt.config`](/docs/guide/directory-structure/nuxt-config) file
|
|
|
|
|
|
|
|
**Example:**
|
|
|
|
|
|
|
|
Installing the [`Pinia`](/modules/pinia) module
|
2024-12-18 10:29:56 +00:00
|
|
|
|
2023-12-18 12:00:03 +00:00
|
|
|
```bash [Terminal]
|
2024-12-18 10:29:56 +00:00
|
|
|
npx nuxi module add pinia
|
2023-12-18 12:00:03 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
## nuxi module search
|
|
|
|
|
2024-12-18 10:29:56 +00:00
|
|
|
<!--module-search-cmd-->
|
2023-12-18 12:00:03 +00:00
|
|
|
```bash [Terminal]
|
2024-12-18 10:29:56 +00:00
|
|
|
npx nuxi module search <QUERY> [--cwd=<directory>] [--nuxtVersion=<2|3>]
|
2023-12-18 12:00:03 +00:00
|
|
|
```
|
2024-12-18 10:29:56 +00:00
|
|
|
<!--/module-search-cmd-->
|
|
|
|
|
|
|
|
### Arguments
|
|
|
|
|
|
|
|
<!--module-search-args-->
|
|
|
|
Argument | Description
|
|
|
|
--- | ---
|
|
|
|
`QUERY` | keywords to search for
|
|
|
|
<!--/module-search-args-->
|
|
|
|
|
|
|
|
### Options
|
2023-12-18 12:00:03 +00:00
|
|
|
|
2024-12-18 10:29:56 +00:00
|
|
|
<!--module-search-opts-->
|
|
|
|
Option | Default | Description
|
|
|
|
--- | --- | ---
|
|
|
|
`--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-->
|
2023-12-18 12:00:03 +00:00
|
|
|
|
|
|
|
The command searches for Nuxt modules matching your query that are compatible with your Nuxt version.
|
|
|
|
|
|
|
|
**Example:**
|
|
|
|
|
2024-02-07 16:18:48 +00:00
|
|
|
```bash [Terminal]
|
2023-12-18 12:00:03 +00:00
|
|
|
npx nuxi module search pinia
|
|
|
|
```
|