Core CLI Commands in Vitest
From the Vitest cheat sheet ยท CLI & Watch Mode ยท verified Nov 2026
Core CLI Commands
The vitest commands and flags you reach for every day
bash
vitest # watch mode (single run in CI)
vitest run # run once and exit
vitest math # files whose path contains "math"
vitest src/math.test.ts:12 # the test at line 12
vitest -t "adds" # test names matching a regex
vitest -u # update snapshots
vitest run --coverage # with coverage๐ Path filters are substring matches, not globs or regex
โก vitest related --run is ideal for lint-staged pre-commit hooks
๐ก vitest doctor reruns your suite with other pools and suggests a win
๐ Flags accept camelCase or kebab-case: --passWithNoTests works
clirunwatch
Continue with Vitest
Save the full cheat sheet or work through every related task.