Skip to content

CLI Flags

npx vitiate <subcommand> [options]
SubcommandDescription
fuzzRun fuzz tests via vitest
regressionRun regression tests against saved corpus via vitest
optimizeMinimize cached corpus via set cover
libfuzzer <test-file> [corpus-dirs...] [flags]libFuzzer-compatible mode
initDiscover fuzz tests and create seed directories

npx vitiate fuzz [flags] [-- vitest-args...]

Sets VITIATE_FUZZ=1 and spawns vitest run filtered to fuzz test files (*.fuzz.*). Unrecognized flags are forwarded to vitest.

FlagTypeDefaultDescription
--fuzz-time <N>integer-Total fuzzing time limit in seconds
--fuzz-execs <N>integer-Total number of fuzzing iterations
--max-crashes <N>integer-Maximum crashes to collect
--detectors <spec>stringtier 1Comma-separated list of bug detectors to enable (see Detectors syntax)

npx vitiate regression [flags] [-- vitest-args...]

Spawns vitest run filtered to fuzz test files (*.fuzz.*) with no special environment variables. Runs saved corpus and crash inputs as regression tests. Unrecognized flags are forwarded to vitest.

FlagTypeDefaultDescription
--detectors <spec>stringtier 1Comma-separated list of bug detectors to enable (see Detectors syntax)

npx vitiate optimize [flags] [-- vitest-args...]

Sets VITIATE_OPTIMIZE=1 and spawns vitest run filtered to fuzz test files (*.fuzz.*). Minimizes the cached corpus via set cover. Unrecognized flags are forwarded to vitest.

FlagTypeDefaultDescription
--detectors <spec>stringtier 1Comma-separated list of bug detectors to enable (see Detectors syntax)

npx vitiate libfuzzer <test-file> [corpus-dirs...] [flags]

Runs in libFuzzer-compatible mode. Instruments JS/TS source with edge coverage counters via SWC and drives mutation-based fuzzing via LibAFL. Accepts libFuzzer-compatible flags. This is the mode used by OSS-Fuzz.

ArgumentDescription
test-filePath to the fuzz test file (required)
corpus-dirsAdditional corpus directories to load (optional, multiple allowed)
FlagTypeDefaultDescription
-max_len <N>integer4096Maximum input length in bytes
-seed <N>integerrandomRNG seed for reproducible fuzzing
-dict <path>string-Path to dictionary file (AFL/libFuzzer format)
FlagTypeDefaultDescription
-timeout <N>integer0Per-execution timeout in seconds (0 = disabled)
-runs <N>integer0Total fuzzing iterations (0 = unlimited)
-max_total_time <N>integer0Total fuzzing time limit in seconds (0 = unlimited)
-test <name>string-Run only the named fuzz test
FlagTypeDefaultDescription
-artifact_prefix <path>string./Path prefix for crash artifact output. When using vitiate fuzz, defaults to .vitiate/testdata/<hashdir>/crashes/.
FlagTypeDefaultDescription
-minimize_budget <N>integer10000Maximum re-executions during crash minimization
-minimize_time_limit <N>integer5Time limit for minimization in seconds
FlagTypeDefaultDescription
-detectors <spec>stringtier 1Comma-separated list of bug detectors to enable (see Detectors syntax)
FlagTypeDefaultDescription
-merge <0|1>integer0Corpus minimization mode. Reads all inputs from corpus directories, evaluates coverage, writes minimal set to the first directory.

These flags are parsed for libFuzzer/OSS-Fuzz compatibility but ignored:

FlagBehavior
-fork <N>Parsed, ignored (always 1 - Vitiate always uses a single supervised worker)
-jobs <N>Parsed, ignored (always 1 - Vitiate runs a single job at a time)

npx vitiate init

Discovers fuzz test files (*.fuzz.ts, *.fuzz.js, etc.), creates seed directories under .vitiate/testdata/, and ensures .vitiate/corpus/ is in .gitignore. No flags.


The --detectors (vitest subcommands) and -detectors (libfuzzer subcommand) flags share the same syntax. When specified, all default detectors are disabled and only the listed detectors are active.

--detectors prototypePollution,ssrf
--detectors pathTraversal.deniedPaths=/etc/passwd:/etc/shadow
  • name - enable the detector with default options
  • name.key=value - enable the detector with the given option

The pathTraversal detector accepts allowedPaths and deniedPaths options. Use the platform path separator (: on POSIX, ; on Windows) to specify multiple paths in a single value.

Pass an empty string to disable all detectors.