Skip to content

Accept arguments before command name (e.g. vp -r run) #2983

Description

@developerzeke

Description

I keep accidentally running vp --filter backend run dev, but viteplus refuses to accept --filter before run. pnpm is fine with this ordering of arguments.

Suggested solution

Accept --filter and other args before the specific command to run, instead of only after.

Validations

  • Read the Contributing Guidelines.
  • Confirm this request is for Vite+ itself and not for Vite, Vitest, tsdown, Rolldown, or Oxc.
  • Check that there isn't already an issue requesting the same feature.

Activity

  1. self-assigned this
    on Nov 18, 2026
  2. naokihaba commented on Nov 18, 2026

    @naokihaba
    Collaborator

    @developerzeke

    Thanks for the suggestion.

    In pnpm, --filter is a global option that works with every command. In Vite+, though, it's only supported by vp run and package management commands like vp add and vp install. Since commands like vp build and vp test don't support it, something like vp --filter backend build doesn't really make sense.

    Vite+ already shows an error when it runs into an unknown argument. Maybe we could update that message to point out the right order whenever --filter or -r is placed before the command?

    error: unexpected argument '--filter'
    hint: try running 'vp run --filter backend dev' instead

    That way, anyone who gets the order mixed up can see how to fix it right away.

  3. developerzeke commented on Nov 18, 2026

    @developerzeke
    Author

    Sure, or being able to just hit y to run it like you can with a typo'd command could be nice.

  4. naokihaba commented on Nov 18, 2026

    @naokihaba
    Collaborator

    I will work on this soon.

  5. added a commit that references this issue on Nov 21, 2026
    e98aaa0
  6. naokihaba commented on Nov 21, 2026

    @naokihaba
    Collaborator

    Thanks again for the suggestion, @developerzeke! 🙌

    #3500 adds the hint I mentioned above. It'll ship in the next release, so give it a try once it's out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Fields

Priority

None yet

Start date

None yet

Target date

None yet

Effort

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions