# Install watchexec with Homebrew, apk, MacPorts, Nix, pacman, scoop, zypper

Execute commands when watched files change. Version 2.5.1 via Homebrew; verified from local package data.

## Install

```sh
sudo av install brew:watchexec
```

Additional install commands:

### macOS

- Homebrew (100%):

```sh
brew install watchexec
```

  Evidence: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install watchexec
```

  Evidence: MacPorts ports tree: sysutils/watchexec/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1

### Linux

- apk (92%):

```sh
sudo apk add watchexec
```

  Evidence: Alpine Linux edge package indexes: watchexec from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz

- Nix (92%):

```sh
nix profile install nixpkgs#watchexec
```

  Evidence: nixpkgs package indexes: pkgs/by-name/wa/watchexec/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

- pacman (92%):

```sh
sudo pacman -S watchexec
```

  Evidence: Arch Linux sync databases: watchexec from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz

- zypper (92%):

```sh
sudo zypper install watchexec
```

  Evidence: openSUSE Tumbleweed package metadata: watchexec from https://download.opensuse.org/tumbleweed/repo/oss/repodata/be8d3611d25469107f32075a1697e69ec57a2b850b42348a658cc671ad5ec2b50760d02c3e59524d50da9a11d5be799bdaffba2e166e8ca8858512e3c0bd665d-primary.xml.zst

### Windows

- Scoop (92%):

```sh
scoop install main/watchexec
```

  Evidence: Scoop official bucket manifest trees: bucket/watchexec.json from https://api.github.com/repos/ScoopInstaller/Main/git/trees/master?recursive=1

## Package facts

- **Package key:** brew:watchexec
- **Package manager:** Homebrew
- **Package manager page:** <https://formulae.brew.sh/formula/watchexec>
- **Version:** 2.5.1
- **Source summary:** Execute commands when watched files change
- **Homepage:** <https://watchexec.github.io/>
- **Repository:** <https://github.com/watchexec/watchexec>
- **Upstream docs:** <https://watchexec.github.io/docs>
- **License:** Apache-2.0
- **Source archive:** <https://github.com/watchexec/watchexec/archive/refs/tags/v2.5.1.tar.gz>
- **Generated:** 2026-07-08T07:18:31+00:00

## Executables

- watchexec (cli)
- watchexec (alias)

## Build dependencies

- rust

## Install behavior

- Post-install hook: not defined
- Bottle: available on arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, sonoma, x86_64_linux

## Freshness

- Page generated: 2026-07-08
- Package-manager version: 2.5.1
- Local data: ok
- Upstream repository: https://github.com/watchexec/watchexec
- Upstream latest detected: v2.5.1 (current)
- info: No package-manager update timestamp was available.
## Project history and usage

watchexec is a Rust command-line tool that watches files and runs commands when they change. It is aimed at software-development feedback loops: rebuild, retest, rerun a server, invoke a linter, or emit structured file-change events without binding the workflow to one programming language or build system.

### Project history

The public GitHub repository dates to September 18, 2016, and the GitHub release feed records an early 1.5.0 release on November 23, 2016. The project has since grown from a standalone file-watcher command into what its citation metadata calls both a tool and a crate ecosystem, with the CLI, reusable library crates, event types, signal support, process supervision, ignore-file handling, project-origin helpers, and related utilities.

The current README emphasizes cross-platform behavior on OS X/macOS, Linux, Windows, and more, along with practical details that matter in real projects: recursive watching, coalescing editor save bursts, loading `.gitignore` and `.ignore`, process-group handling, exposing changed paths through environment variables or JSON on stdin, and avoiding any required language runtime. The 2026 citation metadata identifies version 2.5.1, released March 30, 2026, and credits Matt Green and Felix Saparelli.

### Adoption history

watchexec's adoption is visible in both packaging breadth and downstream specialization. The upstream package list distinguishes first-party binary packages, distro packages, Homebrew and MacPorts, Windows packaging through Scoop and Chocolatey, and installation through Cargo or cargo-binstall. The README also lists downstreams such as cargo-watch, cargo-lambda, devenv.sh, dotter, ghciwatch, and Tectonic, showing that watchexec is used both as an executable and as infrastructure for other developer tools.

The repository page reports roughly seven thousand stars and more than one hundred releases, which is substantial for a general-purpose CLI watcher. More importantly, the project's anti-feature is part of its adoption story: it is intentionally not tied to Git, not tied to a language ecosystem, and not a wrapper requiring cryptic `xargs` pipelines.

### How it is used

Common invocations are direct and task-shaped: watch JavaScript, CSS, and HTML files and run `npm run build`; restart `python server.py` when Python files change; run `make test` while ignoring `target`; send a signal instead of restarting; or emit JSON events to stdout for another program to consume. The CLI README documents extension filters, watch roots, ignore patterns, desktop notifications, timings, shell selection, process groups, and generated completions/manual pages.

In package-maintainer and developer workflows, watchexec is the lightweight alternative to writing a bespoke file watcher into each project. It can sit beside `make`, `just`, `systemfd`, cargo tools, static site generators, test runners, and local servers, providing the missing event loop while letting the existing command remain the source of truth.

### Why package nerds care

watchexec matters to package nerds because it packages the hard part of cross-platform file watching into a small, reusable Rust tool with first-party binaries, distro packages, and library crates. It also reflects a modern CLI pattern: one executable for everyday use, but a crate ecosystem underneath for downstream tools that need event filtering, process supervision, and shell-independent process control.

### Timeline

- 2016-09-18: GitHub repository created.
- 2016-11-23: Early 1.5.0 GitHub release published.
- 2020s: Project grows into a multi-crate ecosystem around the CLI and reusable watcher components.
- 2026-03-30: Citation metadata and releases identify CLI v2.5.1.
- 2026: Upstream package list documents first-party binaries plus Linux, macOS, Windows, Cargo, and Binstall distribution paths.

### Related projects

- Related tools include entr, Watchman, cargo-watch, notify-rs, just, systemfd, checkexec, ghciwatch, and language-specific development servers. watchexec's role is the general-purpose command rerunner rather than the source-control-aware service role played by Watchman.

### Sources

- <https://api.github.com/repos/watchexec/watchexec>
- <https://github.com/watchexec/watchexec>
- <https://raw.githubusercontent.com/watchexec/watchexec/main/CITATION.cff>
- <https://raw.githubusercontent.com/watchexec/watchexec/main/README.md>
- <https://raw.githubusercontent.com/watchexec/watchexec/main/crates/cli/README.md>
- <https://raw.githubusercontent.com/watchexec/watchexec/main/doc/packages.md>


## Security Notes

narrow executable package without higher-risk signals.

- **Geiger risk:** green / low
- narrow executable package without higher-risk signals

## Source Database Details

- **Source Database:** Homebrew formula API
- **Tap:** homebrew/core
- **Full Name:** watchexec
- **Version Scheme:** 0
- **Revision:** 0
- **Head Version:** HEAD
- **Bottle Stable Root URL:** <https://ghcr.io/v2/homebrew/core>
- **Deprecated:** no
- **Disabled:** no
- **Keg Only:** no
- **URL Keys:** head, stable

## Other Package-Manager Records

- Nix - watchexec: normalized package name match | nixpkgs package indexes: pkgs/by-name/wa/watchexec/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- apk - watchexec - 2.3.2-r1: normalized package name match | Alpine Linux edge package indexes: watchexec from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Executes commands in response to file modifications | https://github.com/watchexec/watchexec
- apk - watchexec-bash-completion - 2.3.2-r1: normalized package name match | Alpine Linux edge package indexes: watchexec-bash-completion from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Bash completions for watchexec | https://github.com/watchexec/watchexec
- apk - watchexec-doc - 2.3.2-r1: normalized package name match | Alpine Linux edge package indexes: watchexec-doc from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Executes commands in response to file modifications (documentation) | https://github.com/watchexec/watchexec
- apk - watchexec-fish-completion - 2.3.2-r1: normalized package name match | Alpine Linux edge package indexes: watchexec-fish-completion from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Fish completions for watchexec | https://github.com/watchexec/watchexec
- apk - watchexec-zsh-completion - 2.3.2-r1: normalized package name match | Alpine Linux edge package indexes: watchexec-zsh-completion from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Zsh completions for watchexec | https://github.com/watchexec/watchexec
- pacman - watchexec - 2.5.1-1: normalized package name match | Arch Linux sync databases: watchexec from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz | Executes commands in response to file modifications | https://github.com/watchexec/watchexec
- zypper - watchexec - 2.5.1-1.1: normalized package name match | openSUSE Tumbleweed package metadata: watchexec from https://download.opensuse.org/tumbleweed/repo/oss/repodata/be8d3611d25469107f32075a1697e69ec57a2b850b42348a658cc671ad5ec2b50760d02c3e59524d50da9a11d5be799bdaffba2e166e8ca8858512e3c0bd665d-primary.xml.zst | Watches a path and runs a command whenever it detects modifications. | https://github.com/watchexec/watchexec
- MacPorts - watchexec: normalized package name match | MacPorts ports tree: sysutils/watchexec/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1
- Scoop - main/watchexec: normalized package name match | Scoop official bucket manifest trees: bucket/watchexec.json from https://api.github.com/repos/ScoopInstaller/Main/git/trees/master?recursive=1


## Related links

- [Source-control packages](https://www.automicvault.com/pkg/source-control-tools/) - Belongs to a source-control command family.
- [Terminal utility packages](https://www.automicvault.com/pkg/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Text processing packages](https://www.automicvault.com/pkg/text-processing-tools/) - Matched text, document, or structured-data processing metadata.
- [Developer build packages](https://www.automicvault.com/pkg/developer-build-tools/) - Matched build, compiler, generator, or developer workflow metadata.
- [rust](https://www.automicvault.com/pkg/brew/rust/) - Build dependency declared by Homebrew.
- [gaze](https://www.automicvault.com/pkg/brew/gaze/) - Shares av.db curated category or tags: automation, cli, developer-tools, file-watcher, file-watching.
- [wgo](https://www.automicvault.com/pkg/brew/wgo/) - Shares av.db curated category or tags: automation, cli, developer-tools, file-watcher, file-watching.
- [watchman](https://www.automicvault.com/pkg/brew/watchman/) - Shares av.db curated category or tags: automation, cli, developer-tools, file-watcher, file-watching.
- [clive](https://www.automicvault.com/pkg/brew/clive/) - Shares av.db curated category or tags: automation, cli, developer-tools.
- [cmdshelf](https://www.automicvault.com/pkg/brew/cmdshelf/) - Shares av.db curated category or tags: automation, cli, developer-tools, rust.
- [entr](https://www.automicvault.com/pkg/brew/entr/) - Shares av.db curated category or tags: automation, cli, developer-tools, file-watcher.
- [fsw](https://www.automicvault.com/pkg/brew/fsw/) - Shares av.db curated category or tags: automation, cli, developer-tools, file-watcher, file-watching.
- [funzzy](https://www.automicvault.com/pkg/brew/funzzy/) - Shares av.db curated category or tags: automation, cli, developer-tools, file-watcher, file-watching.

## Combined YAML source

View the package source record on GitHub. [combined/watchexec.yml](https://github.com/automic-vault/db/blob/main/combined/watchexec.yml)


## Sources

- Nucleus package database
- Geiger risk classifier
- package-page enrichment
- curated package history
- package version freshness
- av.db category and tag curation
- package relationship graph
- external package-manager database matches
- cross-ecosystem install command graph
