2022-10-06 09:15:30 +00:00
|
|
|
---
|
|
|
|
title: "nuxi init"
|
|
|
|
description: The init command initializes a fresh Nuxt project.
|
2023-10-18 10:59:43 +00:00
|
|
|
links:
|
|
|
|
- label: Source
|
|
|
|
icon: i-simple-icons-github
|
|
|
|
to: https://github.com/nuxt/cli/blob/main/src/commands/init.ts
|
|
|
|
size: xs
|
2022-10-06 09:15:30 +00:00
|
|
|
---
|
|
|
|
|
2023-10-18 10:59:43 +00:00
|
|
|
```bash [Terminal]
|
2024-01-15 11:23:40 +00:00
|
|
|
npx nuxi init [--verbose|-v] [--template,-t] [dir]
|
2022-04-06 05:56:08 +00:00
|
|
|
```
|
|
|
|
|
2022-09-10 13:37:25 +00:00
|
|
|
The `init` command initializes a fresh Nuxt project using [unjs/giget](https://github.com/unjs/giget).
|
|
|
|
|
|
|
|
## Options
|
2022-04-06 05:56:08 +00:00
|
|
|
|
|
|
|
Option | Default | Description
|
|
|
|
-------------------------|-----------------|------------------
|
2024-05-07 11:54:41 +00:00
|
|
|
`--cwd` | | Current working directory
|
|
|
|
`--log-level` | | Log level
|
2022-09-10 13:37:25 +00:00
|
|
|
`--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.
|
2024-05-07 11:54:41 +00:00
|
|
|
`--force, -f` | `false` | Force clone to any existing directory.
|
|
|
|
`--offline` | `false` | Force offline mode (do not attempt to download template from GitHub and only use local cache).
|
|
|
|
`--prefer-offline` | `false` | Prefer offline mode (try local cache first to download templates).
|
|
|
|
`--no-install` | `false` | Skip installing dependencies.
|
|
|
|
`--git-init` | `false` | Initialize git repository.
|
|
|
|
`--shell` | `false` | Start shell after installation in project directory (experimental).
|
|
|
|
`--package-manager` | `npm` | Package manager choice (npm, pnpm, yarn, bun).
|
|
|
|
`--dir` | | Project directory.
|
2022-09-10 13:37:25 +00:00
|
|
|
|
|
|
|
## Environment variables
|
|
|
|
|
|
|
|
- `NUXI_INIT_REGISTRY`: Set to a custom template registry. ([learn more](https://github.com/unjs/giget#custom-registry)).
|
|
|
|
- Default registry is loaded from [nuxt/starter/templates](https://github.com/nuxt/starter/tree/templates/templates)
|