You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
vp pm approve / vp pm permissions (pnpm 12) are not forwarded to pnpm #3596
pnpm 12's approve (alias of pnpm permissions approve, which covers build scripts and package skills) isn't reachable through vp pm. vp pm approve and vp pm -- approve both fail with Command 'approve' not found. vp pm approve-builds exists but covers build scripts only. PmCommand in crates/vp_pm_cli/src/cli.rs has no Approve/Permissions variant and no passthrough for unknown subcommands. Workaround: vp exec pnpm approve <pkg>. Related: #2422 (same class, other subcommands).
Reproduced: Yes — vp pm approve esbuild, vp pm -- approve esbuild, and vp pm permissions … all fail with Command '…' not found (exit 2) in a minimal pnpm 12 project, while pnpm approve esbuild directly runs the esbuild postinstall.
Unit Test: No — triage stopped at the verify step; no fix or failing test was added.
Priority:Priority P2: Has Workaround. Affects only pnpm 12 users managing dependency permissions through vp pm, and a straightforward workaround exists (vp exec pnpm approve <pkg>, or vp pm approve-builds for build scripts only), so this is not blocking for most workflows.
The root cause is the deliberately curated vp pm command surface: PmCommand in crates/vp_pm_cli/src/cli.rs:75 is a closed clap Subcommand enum with per-package-manager, version-gated Resolve impls, and pnpm 12's new approve / permissions command family simply has no variant yet. There is no catch-all passthrough by design, so any unadapted subcommand — with or without -- — hits clap's InvalidSubcommand and is printed as Command '…' not found by crates/vp_global_cli/src/main.rs:575 / crates/vp_cli_help/src/error.rs:33 (the local NAPI binding fails identically since it flattens the same enum). Verification found this rejection behavior is intended (documented curated command list, snapshot-tested suggestion machinery, and maintainer policy in #2422), so the issue is in substance a request to extend the surface rather than a routing defect; notably, the approval workflow is implemented by three managers (pnpm 12, npm ≥ 11.16 approve-scripts, Bun pm trust), which meets the maintainers' stated inclusion bar — so an extension could well be accepted.
I wasn't able to find a fix, but I identified some areas that may be relevant. If maintainers want to adapt this family, the starting points are: crates/vp_pm_cli/src/cli.rs (PmCommand + PmCommand::resolve_for_manager), crates/vp_pm_cli/src/resolution/commands/approve_builds.rs (the closest existing per-manager pattern to copy, including npm/Bun/Yarn no-op diagnostics), crates/vp_pm_cli/src/resolution/dialect.rs (pnpm version gates), and crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/ (snapshot fixtures such as command_pm_approve_builds_*). Edge cases to keep in mind: the --all/-y/!<pkg> deny flags, permissions list/ls, old-pnpm/npm/yarn/bun no-op behavior, and local-CLI parity — details are in the full report below.
Title:vp pm approve / vp pm permissions (pnpm 12) are not forwarded to pnpm Result:Reproduced (reproducible: true, skipped: false) Issue type: Bug (per initial classification; verification below concludes the behavior itself is intended and the issue is effectively a feature request to extend vp pm)
Summary
pnpm 12's approve command (alias of pnpm permissions approve, covering build scripts and package skills) is not reachable through vp pm. The PmCommand enum in crates/vp_pm_cli/src/cli.rs has an ApproveBuilds variant (build scripts only) but no Approve/Permissions variant, and there is no passthrough for unknown subcommands, so vp pm approve <pkg> and vp pm -- approve <pkg> both fail with error: Command 'approve' not found (exit 2).
Expected:vp pm approve esbuild forwards to pnpm and runs the esbuild postinstall.
Actual:vp pm approve esbuild and vp pm -- approve esbuild both exit 2 with error: Command 'approve' not found and a suggestion to use vp pm approve-builds. Direct pnpm approve esbuild succeeds.
Environment
Component
Version
vp (global CLI on PATH)
v1.8.0
Local vite-plus
v1.8.0
Node.js
v24.22.3
pnpm (on PATH)
12.11.2
OS
Linux (GitHub Actions runner, x86_64)
Note: reporter used pnpm 12.23.0; the reproduction used the runner's pnpm 12.11.2, which already supports pnpm approve and shows the same behavior.
pnpm install — succeeds with Ignored build scripts: esbuild@0.28.2.
vp pm approve esbuild — error: Command 'approve' not found / Did you mean \vp pm approve-builds`?` — exit 2.
vp pm -- approve esbuild — same error; the -- passthrough form also fails; -- does not bypass the subcommand allowlist for vp pm. Exit 2.
vp pm permissions approve esbuild — error: Command 'permissions' not found / Did you mean \vp pm version`?` — exit 2.
Control: pnpm approve esbuild (direct, no vp) — exit 0, the esbuild postinstall ran (…/esbuild@0.28.2/node_modules/esbuild postinstall: Done), confirming the failure is in vp pm command routing, not in the environment or the project.
Diagnosis
Layer
Package-manager command surface: crates/vp_pm_cli. PackageManagerCommand is clap-flattened into both CLI surfaces, so the behavior is identical on the global Rust CLI and the local NAPI CLI:
crates/vp_global_cli/src/cli.rs:66 — Commands::PackageManager(PackageManagerCommand) (#[command(flatten)]), parsed in crates/vp_global_cli/src/main.rs.
packages/cli/binding/src/cli/types.rs:160 / packages/cli/binding/src/cli/mod.rs:453 — the local binding parses the same enum and dispatches through vp_pm_cli::dispatch_for_local_cli.
The design intent (documented in crates/vp_pm_cli/src/cli.rs lines 1–10) is that every vp pm subcommand is a typed variant with per-manager resolution and version gates in crates/vp_pm_cli/src/resolution/. There is deliberately no raw passthrough.
Root Cause
crates/vp_pm_cli/src/cli.rs:75 — PmCommand is a closed clap Subcommand enum with 27 variants (Ci, ApproveBuilds, …, Ping). It has:
No Approve/Permissions variant. pnpm 12's pnpm approve (alias of pnpm permissions approve) and the pnpm permissions family (approve, list/ls) were never added, unlike sibling commands that were added as pnpm grew them (Token → pnpm 12.13.0, Team → pnpm 11.13.0, Owner → pnpm 11.1.0; gates live in crates/vp_pm_cli/src/resolution/dialect.rs).
No catch-all passthrough. There is no #[command(external_subcommand)] variant on PmCommand, so any subcommand not in the enum is a clap ErrorKind::InvalidSubcommand.
Observed failure chain (matches the reproduction exactly):
Global CLI: crates/vp_global_cli/src/main.rs:575 → crates/vp_cli_help/src/error.rs:33 prints Command 'approve' not found; the suggestion machinery prints Did you mean \vp pm approve-builds`?`. Exit code 2.
vp pm -- approve esbuild: -- only ends option parsing in clap; the next token is still matched against the subcommand enum, so the same InvalidSubcommand error fires.
Local CLI: same clap enum fails; packages/cli/binding/src/cli/help.rs:42 and handler.rs:95 print the equivalent "not found" surface.
Why approve-builds is not a substitute (confirmed against pnpm 12.11.2): pnpm approve / pnpm permissions approve approve "what dependencies may do" — build scripts and package skills (agent skills) — with packages/!packages positionals, --all, and -y/--yes flags; vp pm approve-builds resolves only to pnpm approve-builds (crates/vp_pm_cli/src/resolution/commands/approve_builds.rs:28), which covers lifecycle scripts only.
Control Evidence
pnpm approve esbuild run directly exits 0 and executes the esbuild postinstall, proving the failure is vp's routing surface, not the environment. vp exec pnpm approve <pkg> (the reported workaround) also bypasses the enum because Exec is a raw forwarding command.
Suggested Fix Approach (not implemented)
Follow the established per-command pattern rather than adding a general passthrough:
Add Approve(ApproveArgs) and Permissions(PermissionsCommand) (subcommand enum: Approve/List, matching pnpm's permissions approve|list) variants to PmCommand in crates/vp_pm_cli/src/cli.rs, wired into PmCommand::resolve_for_manager.
New args/Resolve impls in crates/vp_pm_cli/src/resolution/commands/: pnpm builds pnpm approve … / pnpm permissions approve|list … with the documented packages/!packages/--all/-y args and #[arg(last = true)] pass-through, version-gated on pnpm 12 (verified present in 12.11.2; exact introducing minor should be confirmed from pnpm release notes — the reporter used 12.23.0). npm/yarn/bun have no equivalent command, so they should Noop with a diagnostic like the ApproveBuildsArgs Yarn/Bun impls do.
Update both help surfaces (vp help pm, unified subcommand help in crates/vp_global_cli / packages/cli/binding), the typo-suggestion path, and add CLI snapshot fixtures under crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/.
vp pm approve with no packages (pnpm launches interactive mode) and with --all/-y/!<pkg> deny syntax.
vp pm permissions list alias ls.
Old pnpm, npm, yarn, bun, and unknown-version managers (gating defaults).
Local NAPI CLI parity (dispatch_for_local_cli and local help/snapshot fixtures).
Managed-global projections: new variants must be absent from ManagedGlobalCommand unless intended.
Regression Evidence
None found: git log on crates/vp_pm_cli/src/cli.rs shows commands have only been added incrementally (e.g. Team in #3040, Token per pnpm 12.13.0). approve/permissions were never present, so this is a coverage gap exposed by pnpm 12's new permissions/skills command family, not a regression.
Confidence
High — the closed PmCommand enum is proven by code inspection to be the only gate for vp pm subcommands on both CLI surfaces, and the observed error text, suggestions, and exit codes match the clap InvalidSubcommand handling paths exactly.
Verification
Claim
Observed:vp pm approve esbuild, vp pm -- approve esbuild, and vp pm permissions … all fail with Command '…' not found (exit 2) on both CLI surfaces, while the detected pnpm 12 supports and correctly executes pnpm approve esbuild.
Reporter's expectation: pnpm 12's approve / permissions command family should be reachable through vp pm.
Research Findings
Documented design — curated vp pm surface, not a passthrough.docs/guide/package-management/index.md: "Vite+ provides one command interface for npm, pnpm, Yarn, and Bun … translates commands and supported options"; the docs enumerate an explicit curated command list; approve/permissions are not in it. The "Native Arguments" -- section documents pass-through for arguments of known commands, never for unknown subcommands.
Code design intent.crates/vp_pm_cli/src/cli.rs header: "Each variant owns the same typed argument value that is later diagnosed and resolved for the detected package manager. There is no parser-to-options compatibility layer." PmCommand is deliberately a closed clap enum with per-manager, version-gated Resolve impls. Rejection of unknown subcommands plus a "Did you mean …?" suggestion is the designed UX (crates/vp_cli_help/src/error.rs, crates/vp_global_cli/src/main.rs:575), exercised by the snapshot suite (e.g. command_pm_approve_builds_* fixtures).
collaborator jong-kyung: pnpm-only commands "would expose a pnpm-only API rather than a shared package-manager workflow."
MEMBER fengmk2: "We will only adapt commands implemented by more than two package managers. If only pnpm supports those commands, we will temporarily not support them."
The family is not pnpm-only. The "approve what dependencies may do" workflow exists in three managers: pnpm 12 (approve / permissions approve, build scripts and package skills), npm ≥ 11.16 (approve-scripts / deny-scripts), and Bun (pm trust) — and vp pm approve-builds already adapts this workflow partially for exactly those three. So under the Add missing pnpm-parity commands: vp pm peers check and vp pm patch-remove #2422 inclusion criterion, adding vp pm approve/permissions is consistent with policy; its absence today is an unadapted coverage gap, not a deliberate exclusion.
Verdict
Intended behavior (confidence: medium). The reproduced failure is exactly what the designed curated, typed vp pm surface does for any subcommand that has not been adapted, and Vite+ has never documented, tested, or promised forwarding of arbitrary pnpm subcommands. Nothing in docs, code, tests, or release history contradicts the observed behavior, so this is not a regression or an implementation defect; the issue is in substance a request to extend vp pm with the pnpm 12 approve/permissions command family. Medium rather than high confidence because there is no maintainer statement about this specific family, and unlike the pnpm-only commands in #2422, the approval workflow meets the stated "more than two package managers" bar (pnpm, npm, Bun), so maintainers may well accept an enhancement PR adding Approve/Permissions variants. Confidence in the diagnosis itself (closed PmCommand enum as the cause) remains high; the ambiguity is only about product intent for this specific command family.
This report was made by an LLM. The analysis may be wrong, and the potential fix might not work, but is intended as a starting point for exploring the issue.
Activity
voidzero-bot commentedon Nov 28, 2026
vp pm approve esbuild,vp pm -- approve esbuild, andvp pm permissions …all fail withCommand '…' not found(exit 2) in a minimal pnpm 12 project, whilepnpm approve esbuilddirectly runs the esbuild postinstall.vp pm peers checkandvp pm patch-remove#2422.vp pm, and a straightforward workaround exists (vp exec pnpm approve <pkg>, orvp pm approve-buildsfor build scripts only), so this is not blocking for most workflows.The root cause is the deliberately curated
vp pmcommand surface:PmCommandincrates/vp_pm_cli/src/cli.rs:75is a closed clapSubcommandenum with per-package-manager, version-gatedResolveimpls, and pnpm 12's newapprove/permissionscommand family simply has no variant yet. There is no catch-all passthrough by design, so any unadapted subcommand — with or without--— hits clap'sInvalidSubcommandand is printed asCommand '…' not foundbycrates/vp_global_cli/src/main.rs:575/crates/vp_cli_help/src/error.rs:33(the local NAPI binding fails identically since it flattens the same enum). Verification found this rejection behavior is intended (documented curated command list, snapshot-tested suggestion machinery, and maintainer policy in #2422), so the issue is in substance a request to extend the surface rather than a routing defect; notably, the approval workflow is implemented by three managers (pnpm 12, npm ≥ 11.16approve-scripts, Bunpm trust), which meets the maintainers' stated inclusion bar — so an extension could well be accepted.I wasn't able to find a fix, but I identified some areas that may be relevant. If maintainers want to adapt this family, the starting points are:
crates/vp_pm_cli/src/cli.rs(PmCommand+PmCommand::resolve_for_manager),crates/vp_pm_cli/src/resolution/commands/approve_builds.rs(the closest existing per-manager pattern to copy, including npm/Bun/Yarn no-op diagnostics),crates/vp_pm_cli/src/resolution/dialect.rs(pnpm version gates), andcrates/vp_cli_snapshots/tests/cli_snapshots/fixtures/(snapshot fixtures such ascommand_pm_approve_builds_*). Edge cases to keep in mind: the--all/-y/!<pkg>deny flags,permissions list/ls, old-pnpm/npm/yarn/bun no-op behavior, and local-CLI parity — details are in the full report below.Full Triage Report
Triage Report — Issue #3596
Title:
vp pm approve/vp pm permissions(pnpm 12) are not forwarded to pnpmResult: Reproduced (
reproducible: true,skipped: false)Issue type: Bug (per initial classification; verification below concludes the behavior itself is intended and the issue is effectively a feature request to extend
vp pm)Summary
pnpm 12's
approvecommand (alias ofpnpm permissions approve, covering build scripts and package skills) is not reachable throughvp pm. ThePmCommandenum incrates/vp_pm_cli/src/cli.rshas anApproveBuildsvariant (build scripts only) but noApprove/Permissionsvariant, and there is no passthrough for unknown subcommands, sovp pm approve <pkg>andvp pm -- approve <pkg>both fail witherror: Command 'approve' not found(exit 2).vp pm approve esbuildforwards to pnpm and runs the esbuild postinstall.vp pm approve esbuildandvp pm -- approve esbuildboth exit 2 witherror: Command 'approve' not foundand a suggestion to usevp pm approve-builds. Directpnpm approve esbuildsucceeds.Environment
Note: reporter used pnpm 12.23.0; the reproduction used the runner's pnpm 12.11.2, which already supports
pnpm approveand shows the same behavior.Reproduction
Path:
/tmp/vite-plus-triage/gh-3596/repro— minimal project withdevDependencies: { esbuild: "0.28.2" }.pnpm install— succeeds withIgnored build scripts: esbuild@0.28.2.vp pm approve esbuild—error: Command 'approve' not found/Did you mean \vp pm approve-builds`?` — exit 2.vp pm -- approve esbuild— same error; the--passthrough form also fails;--does not bypass the subcommand allowlist forvp pm. Exit 2.vp pm permissions approve esbuild—error: Command 'permissions' not found/Did you mean \vp pm version`?` — exit 2.pnpm approve esbuild(direct, no vp) — exit 0, the esbuild postinstall ran (…/esbuild@0.28.2/node_modules/esbuild postinstall: Done), confirming the failure is invp pmcommand routing, not in the environment or the project.Diagnosis
Layer
Package-manager command surface:
crates/vp_pm_cli.PackageManagerCommandis clap-flattened into both CLI surfaces, so the behavior is identical on the global Rust CLI and the local NAPI CLI:crates/vp_global_cli/src/cli.rs:66—Commands::PackageManager(PackageManagerCommand)(#[command(flatten)]), parsed incrates/vp_global_cli/src/main.rs.packages/cli/binding/src/cli/types.rs:160/packages/cli/binding/src/cli/mod.rs:453— the local binding parses the same enum and dispatches throughvp_pm_cli::dispatch_for_local_cli.The design intent (documented in
crates/vp_pm_cli/src/cli.rslines 1–10) is that everyvp pmsubcommand is a typed variant with per-manager resolution and version gates incrates/vp_pm_cli/src/resolution/. There is deliberately no raw passthrough.Root Cause
crates/vp_pm_cli/src/cli.rs:75—PmCommandis a closed clapSubcommandenum with 27 variants (Ci,ApproveBuilds, …,Ping). It has:Approve/Permissionsvariant. pnpm 12'spnpm approve(alias ofpnpm permissions approve) and thepnpm permissionsfamily (approve,list/ls) were never added, unlike sibling commands that were added as pnpm grew them (Token→ pnpm 12.13.0,Team→ pnpm 11.13.0,Owner→ pnpm 11.1.0; gates live incrates/vp_pm_cli/src/resolution/dialect.rs).#[command(external_subcommand)]variant onPmCommand, so any subcommand not in the enum is a clapErrorKind::InvalidSubcommand.Observed failure chain (matches the reproduction exactly):
vp pm approve esbuildwithInvalidSubcommand,ContextKind::InvalidSubcommand = "approve".crates/vp_global_cli/src/main.rs:575→crates/vp_cli_help/src/error.rs:33printsCommand 'approve' not found; the suggestion machinery printsDid you mean \vp pm approve-builds`?`. Exit code 2.vp pm -- approve esbuild:--only ends option parsing in clap; the next token is still matched against the subcommand enum, so the sameInvalidSubcommanderror fires.packages/cli/binding/src/cli/help.rs:42andhandler.rs:95print the equivalent "not found" surface.Why
approve-buildsis not a substitute (confirmed against pnpm 12.11.2):pnpm approve/pnpm permissions approveapprove "what dependencies may do" — build scripts and package skills (agent skills) — withpackages/!packagespositionals,--all, and-y/--yesflags;vp pm approve-buildsresolves only topnpm approve-builds(crates/vp_pm_cli/src/resolution/commands/approve_builds.rs:28), which covers lifecycle scripts only.Control Evidence
pnpm approve esbuildrun directly exits 0 and executes the esbuild postinstall, proving the failure is vp's routing surface, not the environment.vp exec pnpm approve <pkg>(the reported workaround) also bypasses the enum becauseExecis a raw forwarding command.Suggested Fix Approach (not implemented)
Follow the established per-command pattern rather than adding a general passthrough:
Approve(ApproveArgs)andPermissions(PermissionsCommand)(subcommand enum:Approve/List, matching pnpm'spermissions approve|list) variants toPmCommandincrates/vp_pm_cli/src/cli.rs, wired intoPmCommand::resolve_for_manager.Resolveimpls incrates/vp_pm_cli/src/resolution/commands/: pnpm buildspnpm approve …/pnpm permissions approve|list …with the documentedpackages/!packages/--all/-yargs and#[arg(last = true)]pass-through, version-gated on pnpm 12 (verified present in 12.11.2; exact introducing minor should be confirmed from pnpm release notes — the reporter used 12.23.0). npm/yarn/bun have no equivalent command, so they shouldNoopwith a diagnostic like theApproveBuildsArgsYarn/Bun impls do.vp help pm, unified subcommand help incrates/vp_global_cli/packages/cli/binding), the typo-suggestion path, and add CLI snapshot fixtures undercrates/vp_cli_snapshots/tests/cli_snapshots/fixtures/.vp pm peers checkandvp pm patch-remove#2422 class (general forwarding of unknownvp pmsubcommands) is a separate, riskier design decision; this family can be added within the existing typed-surface pattern.Edge Cases to Cover When Fixing
vp pm approvewith no packages (pnpm launches interactive mode) and with--all/-y/!<pkg>deny syntax.vp pm permissions listaliasls.dispatch_for_local_cliand local help/snapshot fixtures).ManagedGlobalCommandunless intended.Regression Evidence
None found:
git logoncrates/vp_pm_cli/src/cli.rsshows commands have only been added incrementally (e.g.Teamin #3040,Tokenper pnpm 12.13.0).approve/permissionswere never present, so this is a coverage gap exposed by pnpm 12's new permissions/skills command family, not a regression.Confidence
High — the closed
PmCommandenum is proven by code inspection to be the only gate forvp pmsubcommands on both CLI surfaces, and the observed error text, suggestions, and exit codes match the clapInvalidSubcommandhandling paths exactly.Verification
Claim
vp pm approve esbuild,vp pm -- approve esbuild, andvp pm permissions …all fail withCommand '…' not found(exit 2) on both CLI surfaces, while the detected pnpm 12 supports and correctly executespnpm approve esbuild.approve/permissionscommand family should be reachable throughvp pm.Research Findings
vp pmsurface, not a passthrough.docs/guide/package-management/index.md: "Vite+ provides one command interface for npm, pnpm, Yarn, and Bun … translates commands and supported options"; the docs enumerate an explicit curated command list;approve/permissionsare not in it. The "Native Arguments"--section documents pass-through for arguments of known commands, never for unknown subcommands.crates/vp_pm_cli/src/cli.rsheader: "Each variant owns the same typed argument value that is later diagnosed and resolved for the detected package manager. There is no parser-to-options compatibility layer."PmCommandis deliberately a closed clap enum with per-manager, version-gatedResolveimpls. Rejection of unknown subcommands plus a "Did you mean …?" suggestion is the designed UX (crates/vp_cli_help/src/error.rs,crates/vp_global_cli/src/main.rs:575), exercised by the snapshot suite (e.g.command_pm_approve_builds_*fixtures).vp pm peers checkandvp pm patch-remove#2422, closed). A similar "missing pnpm-parity commands" issue (vp pm peers check,vp pm patch-remove) was closed with explicit maintainer guidance:gh searchfound no issue/PR aboutvp pm approve/permissions;vp pm approve/vp pm permissions(pnpm 12) are not forwarded to pnpm #3596 is the first report.approve/permissions approve, build scripts and package skills), npm ≥ 11.16 (approve-scripts/deny-scripts), and Bun (pm trust) — andvp pm approve-buildsalready adapts this workflow partially for exactly those three. So under the Add missing pnpm-parity commands:vp pm peers checkandvp pm patch-remove#2422 inclusion criterion, addingvp pm approve/permissionsis consistent with policy; its absence today is an unadapted coverage gap, not a deliberate exclusion.Verdict
Intended behavior (confidence: medium). The reproduced failure is exactly what the designed curated, typed
vp pmsurface does for any subcommand that has not been adapted, and Vite+ has never documented, tested, or promised forwarding of arbitrary pnpm subcommands. Nothing in docs, code, tests, or release history contradicts the observed behavior, so this is not a regression or an implementation defect; the issue is in substance a request to extendvp pmwith the pnpm 12approve/permissionscommand family. Medium rather than high confidence because there is no maintainer statement about this specific family, and unlike the pnpm-only commands in #2422, the approval workflow meets the stated "more than two package managers" bar (pnpm, npm, Bun), so maintainers may well accept an enhancement PR addingApprove/Permissionsvariants. Confidence in the diagnosis itself (closedPmCommandenum as the cause) remains high; the ambiguity is only about product intent for this specific command family.This report was made by an LLM. The analysis may be wrong, and the potential fix might not work, but is intended as a starting point for exploring the issue.