Go to file
Michael Jones 17c63c9d4e
Support --stdin-quit functionality (#217)
Co-authored-by: Félix Saparelli <felix@passcod.name>
2023-01-11 13:44:15 +00:00
.github/workflows Support --stdin-quit functionality (#217) 2023-01-11 13:44:15 +00:00
bin Auto-generate completions 2022-01-23 02:22:52 +13:00
completions Rename --no-ignore and --no-gitignore 2022-07-09 00:30:40 +12:00
examples Two ways to test 2022-07-10 01:04:34 +12:00
src Support --stdin-quit functionality (#217) 2023-01-11 13:44:15 +00:00
tests Make “watch when idle” the default, instead of restarting 2022-07-10 01:18:44 +12:00
.editorconfig Reformat 2022-01-22 17:40:09 +13:00
.gitignore Add testing utility 2022-07-09 23:22:03 +12:00
.rustfmt.toml Reformat 2022-01-22 17:40:09 +13:00
CITATION.cff Relicense: Apache 2.0 2022-01-22 18:14:31 +13:00
CODE_OF_CONDUCT.md Upgrade Code of Conduct 2017-03-30 03:12:09 +13:00
Cargo.lock Support --stdin-quit functionality (#217) 2023-01-11 13:44:15 +00:00
Cargo.toml Support --stdin-quit functionality (#217) 2023-01-11 13:44:15 +00:00
LICENSE Relicense: Apache 2.0 2022-01-22 18:14:31 +13:00
README.md Bump msrv to 1.60 2022-07-08 23:53:20 +12:00
TROUBLESHOOT.md Split readme into three files 2022-01-22 18:04:58 +13:00
USAGE.md They are now 2022-07-08 02:51:24 +12:00
build.rs Add windows manifest 2022-01-23 01:17:11 +13:00
cargo-watch-manifest.rc Fix manifest 2022-01-23 02:36:42 +13:00
cargo-watch.1 Update completions 2022-07-08 22:40:56 +12:00
cargo-watch.1.ronn Relicense: Apache 2.0 2022-01-22 18:14:31 +13:00
cargo-watch.exe.manifest Add windows manifest 2022-01-23 01:17:11 +13:00
logo.png Add logo 2021-04-30 01:04:39 +12:00
logo.svg Add logo 2021-04-30 01:04:39 +12:00

README.md

CI status

Cargo Watch

Cargo Watch is a tool to watch your Cargo-based project and run commands when files change. It focuses on the Rust development experience and aims to be flexible enough to suit most without becoming complicated to use.

If you've used nodemon, guard, or entr, it will probably feel familiar.

Looking for a similar tool that you can use for other kinds of projects? Try Watchexec, this project's bigger sibling.

Install

Packaging status

Install or upgrade today with Binstall:

$ cargo binstall cargo-watch

Or with cargo (rustc >= 1.60.0) if you don't have Binstall yet:

$ cargo install cargo-watch

Or unpack directly from the latest pre-built release.

This repository contains a manual page and shell completions that you may want to install; the pre-built packages also include these.

Use

By default, it runs check. You can easily override this, though:

$ cargo watch [-x command]...

A few examples:

# Run tests only
$ cargo watch -x test

# Run check then tests
$ cargo watch -x check -x test

# Run run with arguments
$ cargo watch -x 'run -- --some-arg'

# Run an arbitrary command
$ cargo watch -- echo Hello world

# Run with features passed to cargo
$ cargo watch --features "foo,bar"

There's a lot more you can do! Check out:

Augment

Cargo Watch pairs well with:

  • just: a modern alternative to make
  • systemfd: socket-passing in development

Extend