Watch mode
specwatch watch Watches JavaScript and TypeScript source files, generates a nearby test file, and can run it through Jest or Vitest.
Specwatch drafts JavaScript and TypeScript tests from source changes, then can run the generated file with Jest or Vitest. Ollama is the default model provider; cloud providers are optional. Review generated tests before relying on them.
What it does
specwatch watch Watches JavaScript and TypeScript source files, generates a nearby test file, and can run it through Jest or Vitest.
specwatch gen src/ Draft tests for a file, directory, or glob using detected conventions. Preview with gen --dry-run; existing tests are kept unless you pass --overwrite.
specwatch fix Re-runs existing test files and regenerates failing ones from source. A failing test is only replaced by a candidate that passes.
specwatch coverage Reads an existing Istanbul coverage-final.json report and lists files below a statement threshold. JSON output is available.
specwatch.config.ts Coverage reports and source analysis run on your machine. If you choose a cloud model for test generation, the selected source is sent to that provider.
specwatch ci --coverage Runs existing test files and optionally checks an existing coverage report. Missing or invalid coverage reports fail the gate before test execution.
The shape of it
npm install --save-dev ./specwatch-0.1.0.tgz Download the CLI archive below and install it in your JavaScript or TypeScript project with Jest or Vitest.
./node_modules/.bin/specwatch watch On source changes, Specwatch asks the selected model for a test file and can run that file. Existing tests stay untouched unless you pass --overwrite, and a candidate only lands after it passes.
./node_modules/.bin/specwatch ci --coverage Run existing tests and check an existing Istanbul coverage report against a statement threshold. Missing or invalid measurements are setup errors; generate the report with your framework first.
Plays well with
Try it now
Open the Istanbul report your Jest or Vitest run already produces. Specwatch ranks measured
files by missed statements, functions and branches — the same order specwatch gen --coverage-gaps works through.
Your report stays in this browser tab. Coverage describes executed code; it does not measure the quality of your assertions.
Open an Istanbul coverage-final.json and see which measured files need attention.
Read in this tab. Nothing is uploaded or saved. Files absent from your report remain unknown.
Review your test drafts
Run Specwatch in your own project with Node.js, Jest or Vitest, and a model you choose. Local Ollama keeps model requests on your machine; optional cloud providers receive source context to draft tests.
gen --dry-run previews a generated test. gen and watch keep existing test files unless you pass --overwrite; fix replaces a failing test only with a candidate that passes.
Generate coverage with your test framework first. ci --coverage checks the existing Istanbul report and refuses missing or invalid measurements. Review assertion quality as well as coverage.
Start in your project
Use Node.js 22.12 or newer and your existing Jest or Vitest project. Test generation needs a running Ollama model or a configured cloud provider.
npm install --save-dev ./specwatch-0.1.0.tgz ./node_modules/.bin/specwatch --help ./node_modules/.bin/specwatch gen src/example.ts --dry-run ./node_modules/.bin/specwatch ci --coverage --json
Run commands from your project folder. Generate an Istanbul coverage-final.json before using the coverage gate. Preview with --dry-run. Existing tests are kept unless you pass --overwrite, and repairs land only when the new test passes. Review each generated change.