Version
@playwright/cli 0.1.18 (playwright-core 1.63.0-alpha-2026-08-05); also reproduces on 0.1.14
Steps to reproduce
Serve any scrollable page, then:
playwright-cli mousewheel 0 300 # works, page scrolls down
playwright-cli mousewheel 0 -100 # fails
Actual
Unknown options: --0, --1
Exit code 1, and the page receives no wheel event at all (verified with a
capture-phase wheel listener counting by sign: up stays 0, scrollY unchanged).
Since mousewheel <dx> <dy> takes both deltas as positional arguments, scrolling
up is unreachable through this command.
Expected
mousewheel 0 -100 scrolls up.
Root cause
packages/playwright-core/src/tools/cli-client/minimist.ts: -100 matches the
short-flag branch /^-[^-]+/, which has no escape for numeric arguments, so the
value never reaches _:
minimist(['mousewheel', '0', '-100'])
// => { _: ['mousewheel', '0'], '0': true, '1': true }
The vendored parser inherits this from minimist, but the CLI pairs it with commands
whose positional arguments are legitimately signed, so any negative positional is
unreachable — not just wheel deltas.
Workaround
playwright-cli mousewheel 0 -- -100 # => up=1, scrollY 300 -> 200
Suggested fix
Treat an argument matching /^-\d/ (or the numeric pattern already used inside that
branch) as positional, the way commander and yargs do. Related positional-parsing
fixes on the same parser: #39148, #39215.
Also worth noting: the bundled skills/playwright-cli/SKILL.md only ever shows
mousewheel 0 100, so an agent following it hits this the first time it needs to
scroll up.
Version
@playwright/cli 0.1.18 (playwright-core 1.63.0-alpha-2026-08-05); also reproduces on 0.1.14
Steps to reproduce
Serve any scrollable page, then:
Actual
Exit code 1, and the page receives no wheel event at all (verified with a
capture-phase
wheellistener counting by sign:upstays 0,scrollYunchanged).Since
mousewheel <dx> <dy>takes both deltas as positional arguments, scrollingup is unreachable through this command.
Expected
mousewheel 0 -100scrolls up.Root cause
packages/playwright-core/src/tools/cli-client/minimist.ts:-100matches theshort-flag branch
/^-[^-]+/, which has no escape for numeric arguments, so thevalue never reaches
_:The vendored parser inherits this from minimist, but the CLI pairs it with commands
whose positional arguments are legitimately signed, so any negative positional is
unreachable — not just wheel deltas.
Workaround
playwright-cli mousewheel 0 -- -100 # => up=1, scrollY 300 -> 200Suggested fix
Treat an argument matching
/^-\d/(or the numeric pattern already used inside thatbranch) as positional, the way commander and yargs do. Related positional-parsing
fixes on the same parser: #39148, #39215.
Also worth noting: the bundled
skills/playwright-cli/SKILL.mdonly ever showsmousewheel 0 100, so an agent following it hits this the first time it needs toscroll up.