Nuxt/docs/3.api/4.commands/module.md
2024-12-18 16:36:46 +00:00

2.1 KiB

title description links
nuxi module Search and add modules to your Nuxt application with the command line.
label icon to size
Source i-simple-icons-github https://github.com/nuxt/cli/blob/main/src/commands/module/ xs

Nuxi provides a few utilities to work with Nuxt modules seamlessly.

nuxi module add

npx nuxi module add <MODULENAME> [--cwd=<directory>] [--logLevel=<silent|info|verbose>] [--skipInstall] [--skipConfig]
Argument Description
MODULENAME Module name
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

The command lets you install Nuxt modules in your application with no manual work.

When running the command, it will:

  • install the module as a dependency using your package manager
  • add it to your package.json file
  • update your nuxt.config file

Example:

Installing the Pinia module

npx nuxi module add pinia
npx nuxi module search <QUERY> [--cwd=<directory>] [--nuxtVersion=<2|3>]

Arguments

Argument Description
QUERY keywords to search for

Options

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)

The command searches for Nuxt modules matching your query that are compatible with your Nuxt version.

Example:

npx nuxi module search pinia