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; normal generation can overwrite an existing test file.
specwatch fix Re-runs existing test files and regenerates failing files from source. Review replacements before keeping them.
specwatch coverage Reads an existing Istanbul coverage-final.json report and lists files below a statement threshold. JSON output is available.
specwatch.config.ts All code analysis happens on your machine, with models you choose. Cloud providers are opt-in and per-project.
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. Normal watch and generation may replace an existing sibling test file.
./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
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. Normal gen, watch, and fix can replace an existing sibling test file.
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; normal generation, watch and repair can replace sibling test files. Keep existing tests in version control and review each generated change.