Skip to content

feat(global-cli): pass the raw subcommand to the local CLI#2262

Open
wan9chi wants to merge 1 commit into
fix/note-stderrfrom
feat/global-forward-subcommand
Open

feat(global-cli): pass the raw subcommand to the local CLI#2262
wan9chi wants to merge 1 commit into
fix/note-stderrfrom
feat/global-forward-subcommand

Conversation

@wan9chi

@wan9chi wan9chi commented Jul 27, 2026

Copy link
Copy Markdown
Member

Motivation

The local CLI runs a command under its canonical name, so it sees fmt whether
the user wrote vp fmt or vp format. The spelling is gone by the time it
arrives, and nothing downstream can recover it from argv.

#2259, above this in the stack, needs it: a note that says "use vpr fmt" when
the user wrote vp format is pointing at the wrong script.

What this does

The subcommand is read from argv before normalize_args can rewrite it, and
travels to the local CLI as VP_RAW_SUBCOMMAND.

It is passed alongside the command rather than in place of it: the command
name stays canonical, because that string becomes the local CLI's argv[0] and
has to name the command this process resolved. vp help fmt is the case where
the two differ — the user wrote help, but the local CLI must still run
fmt --help, since being handed help --help would print vp's top-level help
instead of the formatter's.

Nothing reads VP_RAW_SUBCOMMAND in this PR.

vite_plugins_skip_on_format now runs both flavors, so the global one covers
forwarding the alias.

@netlify

netlify Bot commented Jul 27, 2026

Copy link
Copy Markdown

Deploy Preview for viteplus-preview canceled.

Name Link
🔨 Latest commit 42a80af
🔍 Latest deploy log https://app.netlify.com/projects/viteplus-preview/deploys/6a66d6c209423100088af68c

wan9chi commented Jul 27, 2026

Copy link
Copy Markdown
Member Author

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more


How to use the Graphite Merge Queue

Add the label auto-merge to this PR to add it to the merge queue.

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@github-actions

github-actions Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Native binary sizes (363be77)

Final release artifacts built by the canonical build-upstream and build-windows-cli actions.

Artifact Format Base PR Change
vp (Linux x64) Binary 10.31 MiB 10.31 MiB 0 B (0.00%)
vp (Linux x64) gzip -9 4.42 MiB 4.42 MiB +360 B (+0.01%)
NAPI (Linux x64) Binary 33.07 MiB 33.07 MiB 0 B (0.00%)
NAPI (Linux x64) gzip -9 12.72 MiB 12.72 MiB 0 B (0.00%)
vp (macOS ARM64) Binary 7.64 MiB 7.64 MiB 0 B (0.00%)
vp (macOS ARM64) gzip -9 3.84 MiB 3.84 MiB +1.20 KiB (+0.03%)
NAPI (macOS ARM64) Binary 40.50 MiB 40.50 MiB 0 B (0.00%)
NAPI (macOS ARM64) gzip -9 16.97 MiB 16.97 MiB -88 B (-0.00%)
vp (Windows x64) Binary 8.34 MiB 8.35 MiB +2.00 KiB (+0.02%)
vp (Windows x64) gzip -9 3.64 MiB 3.64 MiB +448 B (+0.01%)
NAPI (Windows x64) Binary 27.51 MiB 27.51 MiB 0 B (0.00%)
NAPI (Windows x64) gzip -9 10.70 MiB 10.70 MiB -1 B (-0.00%)
Trampoline (Windows x64) Binary 203.00 KiB 203.00 KiB 0 B (0.00%)
Trampoline (Windows x64) gzip -9 97.91 KiB 97.91 KiB +3 B (+0.00%)
Installer (Windows x64) Binary 4.44 MiB 4.44 MiB 0 B (0.00%)
Installer (Windows x64) gzip -9 2.08 MiB 2.08 MiB +1 B (+0.00%)

@wan9chi
wan9chi changed the base branch from main to graphite-base/2262 July 27, 2026 10:39
@wan9chi
wan9chi force-pushed the feat/global-forward-subcommand branch from 42a80af to de5c091 Compare July 27, 2026 10:40
@wan9chi
wan9chi changed the base branch from graphite-base/2262 to fix/note-stderr July 27, 2026 10:40
@wan9chi
wan9chi force-pushed the feat/global-forward-subcommand branch from de5c091 to dd3ac6c Compare July 27, 2026 11:35
@wan9chi wan9chi changed the title refactor(global-cli): delegate the subcommand as the user spelled it feat(global-cli): pass the user-typed subcommand to the delegated CLI Jul 27, 2026
@wan9chi
wan9chi force-pushed the feat/global-forward-subcommand branch from dd3ac6c to 2c4e38a Compare July 27, 2026 11:55
@wan9chi wan9chi changed the title feat(global-cli): pass the user-typed subcommand to the delegated CLI feat(global-cli): pass the user-typed subcommand to the local CLI Jul 27, 2026
@wan9chi
wan9chi force-pushed the feat/global-forward-subcommand branch from 2c4e38a to 4aa3c6c Compare July 27, 2026 12:03
@wan9chi wan9chi changed the title feat(global-cli): pass the user-typed subcommand to the local CLI feat(global-cli): pass the raw subcommand to the local CLI Jul 27, 2026
@wan9chi
wan9chi force-pushed the feat/global-forward-subcommand branch from 4aa3c6c to 311383d Compare July 27, 2026 12:10
The local CLI runs a command under its canonical name, so it sees `fmt` whether
the user wrote `vp fmt` or `vp format`, and has no way to recover the spelling
from its own argv.

The subcommand is now read from argv before `normalize_args` rewrites anything,
and travels to the local CLI as `VP_RAW_SUBCOMMAND` alongside the canonical
command name, which is unchanged. Nothing reads it yet.
@wan9chi
wan9chi force-pushed the feat/global-forward-subcommand branch from 311383d to 363be77 Compare July 27, 2026 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant