-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
docs: update nuxt
command pages
#33336
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
WalkthroughDocumentation updates across multiple Nuxt CLI command pages. A new -e, --extends= option is added to analyze, build, dev, generate, prepare, preview, and typecheck docs. dev replaces --no-clear with --clear and adjusts host default. preview adds -p, --port and revises its description. init adds --logLevel and updates modules flag to -M, --modules. add expands the TEMPLATE list. module tweaks argument and --dev descriptions. upgrade expands channel values and refines dedupe text. A new test command page is introduced documenting usage, arguments, options, and NODE_ENV behaviour. Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
`--cwd=<directory>` | | Specify the working directory, this takes precedence over ROOTDIR (default: `.`) | ||
`--logLevel=<silent\|info\|verbose>` | | Specify build-time log level | ||
`--dedupe` | | Will deduplicate dependencies but not recreate the lockfile | ||
`--dedupe` | | Dedupe dependencies after upgrading |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the description used in nuxt/cli, the original description is not entirely accurate as was mentioned here #31467 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
docs/3.api/4.commands/preview.md (1)
13-37
: Document--port
as a valued option with its default.The CLI still expects a numeric argument for
--port
(args.port ?? process.env.PORT ?? 3000
inpackages/nuxi/src/commands/preview.ts
), so the usage sample on Line 13 and the options table on Lines 35-37 should show the<port>
placeholder. Also, the command continues to fall back to3000
when neither the flag norPORT
is set; dropping that default from the table makes the docs inaccurate. Please restore both details.-npx nuxt preview [ROOTDIR] [--cwd=<directory>] [--logLevel=<silent|info|verbose>] [--envName] [-e, --extends=<layer-name>] [-p, --port] [--dotenv] +npx nuxt preview [ROOTDIR] [--cwd=<directory>] [--logLevel=<silent|info|verbose>] [--envName] [-e, --extends=<layer-name>] [-p, --port=<port>] [--dotenv] @@ -`-p, --port` | | Port to listen on (use `PORT` environment variable to override) +`-p, --port=<port>` | `3000` | Port to listen on (use `PORT` environment variable to override)
🧹 Nitpick comments (2)
docs/3.api/4.commands/upgrade.md (2)
13-13
: Include Nuxt 3 defaults in usage synopsisThe CLI still defaults
--logLevel
toinfo
, so the usage synopsis should show[--logLevel=<silent|info|verbose>
(default:info
)] just like the other command docs in this PR do. Please add the(default: info)
annotation here for consistency and clarity.
34-36
: Clarify channel defaults across options tableLine 34 now reads nicely, but Line 36 still says “(default: stable)” in the description column even though the dedicated “Default” column already states
stable
. That repetition stood out after the change—could we drop the trailing “(default: stable)” to keep the table concise?
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (12)
docs/3.api/4.commands/add.md
(1 hunks)docs/3.api/4.commands/analyze.md
(2 hunks)docs/3.api/4.commands/build.md
(2 hunks)docs/3.api/4.commands/dev.md
(2 hunks)docs/3.api/4.commands/generate.md
(2 hunks)docs/3.api/4.commands/init.md
(3 hunks)docs/3.api/4.commands/module.md
(2 hunks)docs/3.api/4.commands/prepare.md
(2 hunks)docs/3.api/4.commands/preview.md
(2 hunks)docs/3.api/4.commands/test.md
(1 hunks)docs/3.api/4.commands/typecheck.md
(2 hunks)docs/3.api/4.commands/upgrade.md
(2 hunks)
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-07-18T16:46:07.446Z
Learnt from: CR
PR: nuxt/nuxt#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-18T16:46:07.446Z
Learning: Applies to **/*.{test,spec}.{ts,tsx,js,jsx} : Write unit tests for core functionality using `vitest`
Applied to files:
docs/3.api/4.commands/test.md
📚 Learning: 2025-07-18T16:46:07.446Z
Learnt from: CR
PR: nuxt/nuxt#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-18T16:46:07.446Z
Learning: Applies to **/e2e/**/*.{ts,js} : Write end-to-end tests using Playwright and `nuxt/test-utils`
Applied to files:
docs/3.api/4.commands/test.md
🔇 Additional comments (1)
docs/3.api/4.commands/module.md (1)
34-34
: Clarify dev-dependency flag behaviour
The docs say--dev
installs a module as a dev dependency, but I can’t locate the CLI implementation to confirm it writes todevDependencies
in package.json. Please verify thatisDev
truly yields adevDependencies
entry; otherwise tighten the wording (e.g. “Install module for development only”).
Argument | Description | ||
--- | --- | ||
`MODULENAME` | Module name | ||
`MODULENAME` | Specify one or more modules to install by name, separated by spaces |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Revert multi-module wording for MODULENAME
.
packages/nuxi/src/commands/module/add.ts
still accepts only a single module name; it doesn’t split or iterate over additional arguments. Documenting “one or more modules… separated by spaces” will mislead users—extra arguments are simply ignored. Please keep the description singular (or document the actual enhancement if the CLI changes accordingly).
🤖 Prompt for AI Agents
In docs/3.api/4.commands/module.md around line 24, the description for
`MODULENAME` incorrectly says "one or more modules… separated by spaces"
although the CLI accepts only a single module; change the phrasing to indicate a
single module (e.g., "Specify the module to install by name") so documentation
matches current behavior, or alternatively note that multiple names are not
supported if you want to be explicit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This positional argument does support multiple space separated module names, this description is copied directly from the file you are referencing.
You rock ❤️ |
`--packageManager` | | Package manager choice (npm, pnpm, yarn, bun) | ||
`--modules` | | Nuxt modules to install (comma separated without spaces) | ||
`-M, --modules` | | Nuxt modules to install (comma separated without spaces) | ||
`--no-modules` | | Skip module installation prompt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We actually support --no-M
(and more unjs/citty#209)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you ❤️
🔗 Linked issue
📚 Description
This syncs the documentation again with the actual command definition in nuxt/cli.
This also adds documentation for the
test
command, I haven't used that command myself so do check if it is correct.