# joh/when-changed

Execute a command when a file is changed

Repository: https://github.com/joh/when-changed
Canonical: https://ross.abutalabs.com/products/when-changed
Language: Python
License: NOASSERTION
License Family: other
Last push: 2024-04-02T21:02:10+00:00

## Health v2 (maintenance only)
Score: 32/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 0, release rhythm 35, longevity 100
- inputs: {"age_days": 5693, "days_push": 883, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases, no_license
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1228, forks 103 (observed 2026-08-28T04:04:03.453936+00:00)

## What it is
when-changed is a Python command-line tool that watches files or directories and runs a specified command whenever a change is detected. It is built on the watchdog library and supports recursive watching, verbosity control, and event metadata via environment variables.

## Use cases
- automatically recompile latex documents when the source file changes
- run tests whenever source code is saved
- rebuild a project on file modification
- trigger a script when a file is created, modified, moved, or deleted
- watch a directory recursively and run a command on changes

## When to choose
- you want a simple, lightweight CLI to re-run a command on file changes
- you need cross-platform file watching from the terminal
- you want event details like file path and event type passed to your command

## When to avoid
- you need advanced build orchestration or task runners like make or just
- you need a GUI file-watching tool
- you need complex multi-step pipelines with dependency graphs

## Facets
- artifact type: cli-tool
- maturity: maintenance
- function: developer-tools, cli, file-system, workflow-automation
- domain: developer-tools
- platform: cross-platform, python, cli
- tags: file-watching, watchdog, auto-run, live-reload, command-line, automation

## Member repositories
- joh/when-changed (main) score 32

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:04:03.453936+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T06:15:11.667422+00:00, confidence not recorded.
  - readme: https://github.com/joh/when-changed (fetched 2026-08-28T04:04:03.453936+00:00, sha 9a20405ccceb)
  - registry_pypi: https://pypi.org/pypi/when-changed/json (fetched 2026-08-29T12:23:05.932059+00:00, sha b1f078e75bb2)
- Data as of 2026-08-30T08:39:29.467469+00:00.
