saw-it

Crates.iosaw-it
lib.rssaw-it
version0.1.12
created_at2026-01-08 06:15:17.907439+00
updated_at2026-01-08 09:09:00.308858+00
descriptionA simple CLI tool to watch files and execute commands
homepage
repositoryhttps://github.com/fepfitra/saw-it
max_upload_size
id2029645
size26,826
Fitriansyah Eka Putra (fepfitra)

documentation

README

saw-it

A simple, lightweight CLI tool that watches for file changes in a directory and executes a specified command.

Philosophy

The name saw is the past tense of the verb see. The concept is grounded in simple cause and effect:

"I saw a change, so it (the file) needs to be done."

This tool acts as a vigilant observer for your workspace. It watches your files, and the moment it saw a modification, it immediately triggers your specified action. It bridges the gap between observing an event and automating the response.

Features

  • Watch: Recursively watches a directory or file for changes.
  • Execute: specific command when a change is detected.
  • Cross-platform: Works on Linux, macOS, and Windows.
  • Clear Screen: Option to clear the terminal before running the command.

Usage

saw --it <PATH> --do <COMMAND>

Options

Short Long Description Default
--it Directory or file to watch (Required)
--do Command to execute on change (Required)
-c --clear Clear screen before executing false
-v --verbose Print verbose logs (change info, etc.) false
-r --restart Terminate and restart if still running false
-h --help Print help information
-V --version Print version information

Examples

Watch the current directory and run cargo check on change:

saw --it . --do "cargo check"

Watch the src folder, clear the screen, and run tests with verbose output:

saw --it src -c -v --do "cargo test"

Watch a specific file and restart the command if it's still running:

saw --it server.py -r --do "python server.py"

Watch a specific file and run a python script:

saw --it script.py --do "python script.py"

Installation

From Cargo

cargo install saw-it

From Binstall (Quickest)

cargo binstall saw-it

From Source

git clone https://github.com/fepfitra/saw-it.git
cd saw-it
cargo install --path .

This will install the binary saw.

Commit count: 7

cargo fmt