| Crates.io | cargo-rerun |
| lib.rs | cargo-rerun |
| version | 2.1.0 |
| created_at | 2026-01-22 06:17:04.960031+00 |
| updated_at | 2026-01-23 03:17:26.944333+00 |
| description | A tool that runs cargo run and automatically restarts when watched files change |
| homepage | |
| repository | https://github.com/envelica/cargo-rerun |
| max_upload_size | |
| id | 2060874 |
| size | 81,950 |
A tool that runs cargo run and automatically restarts your application whenever watched files change.
Perfect for development workflows where you want instant feedback as you code—similar to nodemon for Node.js or live reload for web development, but optimized for Rust projects.
../api/**/*.proto)Cargo.tomlcargo install cargo-rerun
git clone https://github.com/yourusername/cargo-rerun.git
cd cargo-rerun
cargo install --path .
Optionally add this to your Cargo.toml:
[tool.rerun]
watch = ["src/**/*.rs"]
Then run:
cargo-rerun
cargo-rerun will:
cargo runYour app will restart automatically whenever a Rust file in src/ changes—perfect for rapid development iteration.
cargo runPass arguments through to your application:
# Pass arguments to cargo run
cargo-rerun -- --release --verbose
# Arguments before `--` go to cargo, after `--` go to your app
cargo-rerun --release -- --debug-mode
Configure what to watch in your Cargo.toml. There are three ways to configure cargo-rerun, listed in priority order:
[package.metadata.rerun]
watch = ["src/**/*.rs"]
Use this for workspace-level configuration (only used if package metadata is not found):
[workspace.metadata.rerun]
watch = ["src/**/*.rs"]
Supported for backward compatibility (shows deprecation warning):
watch = [ "src//*.rs", # Rust source "assets//*", # Static assets "config.toml", # Config file ]
**Parent Directory Support**
Watch files outside your project:
```toml
[package.metadata.rerun]
watch = [
"src/**/*.rs",
"../shared/**/*.proto", # Proto definitions
"../config/app.yaml", # Shared config
]
If no [tool.rerun] section exists, it defaults to watching src/**/*.rs.
Watch source and static files:
[tool.rerun]
watch = [
"src/**/*.rs",
"templates/**/*.html",
"static/**/*",
"config/**/*.toml",
]
[tool.rerun]
watch = [
"src/**/*.rs",
"../proto/**/*.proto",
"../shared/**/*.rs",
]
Monitor source and data directories:
[tool.rerun]
watch = [
"src/**/*.rs",
"data/**/*",
]
cargo run when cargo-rerun launchescargo run with fresh codecargo command available in PATHMake sure your glob patterns are specific. For example:
watch = ["**/*"] (watches everything)watch = ["src/**/*.rs", "config/**/*.toml"] (specific paths)Ensure the path exists and use ../ syntax:
watch = ["api/**/*.rs"]watch = ["../api/**/*.rs"] (relative to your crate root)Some editors (vim, emacs) create temporary files. Standard globs like src/**/*.rs won't match .swp files, so you shouldn't be affected. If you experience issues, check your glob patterns.
Licensed under either of:
at your option.
See THIRD_PARTY_LICENSES.md for third-party dependency licenses.
Contributions are welcome! Please feel free to submit a Pull Request.