#file-watcher #cargo-command #run-command #command-line-tool #projects #recursion #directory

app cargo-auto-run

A file watcher for Rust projects that runs a specified command on file changes

1 unstable release

0.1.2 Jul 30, 2024
0.1.1 Jul 28, 2024
0.1.0 Jul 28, 2024

#1784 in Command line utilities

MIT license

6KB

Here's the full README.md for your CLI tool, Cargo Auto-Run:

Cargo Auto-Run

Cargo Auto-Run is a versatile CLI tool that watches for file changes in a specified directory and runs a specified command if changes are detected. This tool is particularly useful for automatically running commands like cargo run whenever you make changes to your code, but it can be used with any command you specify.

Features

  • Watches for file changes recursively in the specified directory.
  • Runs a specified command if any changes are detected.
  • Can be used with any command, not just cargo run.

Installation

To install Cargo Auto-Run, use the following command:

cargo install cargo-auto-run

Usage

To use Cargo Auto-Run, navigate to the directory you want to watch and run the following command:

cargo-auto-run --command "<command>"

Arguments

  • --command <command>: The command to run on file changes. This should be the full command you want to execute, e.g., cargo run, make build, npm start, etc.

Example

To watch the current directory for changes and run cargo run if any changes are detected, use:

cargo-auto-run --command "cargo run"

You can also use it with any other command. For example, to watch for changes and run npm start, use:

cargo-auto-run --command "npm start"

Dependencies

~1.7–9.5MB
~86K SLoC