Watcher - A simple command line app to watch files in a directory for changes and run a command when files change!

Related tags

Command Line watcher
Overview

Watcher - Develop your programs easily

Watcher watches all the files present in the directory it is run from of the directory that is specified while running it and whenever a file is changed or a file is created/deleted from the directory, it runs the command specified while running it or a default command that it recognises from the contents of the current directory.

Features

  • Choose which directory to watch for file changes
  • Specify amount of time to wait before running the command after a file change occurs
  • List the files that are being watched
  • Choose whether to run the command on startup
  • Set the maximum number of files that can be watched
  • Supports never ending processes such as dev servers as the command
  • Have a default ignore list
  • Press keys for force refreshing even when file change is not detected
  • Automatically recognize commands for popular project structure

Arguments

Command

The command you want to run when any file changes

watcher --cmd '
   
    '
   

Directory

The directory that you want watcher to watch for file changes. (default: ".")

watcher --dir '
   
    '
   

Ignore

The files that you want to ignore. It also supports file globbing.

watcher --ignore '
   
    '
   

Ignore File

A file that contains the files that you want to ignore. It follows the gitignore file syntax

watcher --ignore-file '
   
    '
   

Hidden

Whether the hidden files should also be watched for file changes. (default: true)

watcher --hidden false

Delay

The amount of time to wait before running the specified command after a file change occurs. (default: 500ms)

watcher --delay 1000ms

Run on Start

Whether the specified command should run when watcher has first started. (default: true)

watcher --run-cmd-on-start false
or
watcher -r false

List on Start

Whether the list of files being watched should be printed when watcher has first started. (default: false)

watcher --list-on-start true

Limit

The maximum number of files that can be watched. (default: 10000)

watcher --limit 50000
or
watcher -l 50000

⚠️ Every system has a maximum value which cannot be exceeded. To find it look at:

  • Linux: /proc/sys/fs/inotify/max_user_watches contains the limit, reaching this limit results in a "no space left on device" error.
  • BSD / OSX: sysctl variables kern.maxfiles and kern.maxfilesperproc, reaching these limits results in a "too many open files" error.

Examples

  • Basic example (use default options):
    watcher
  • Intermediate example:
    watcher --cmd 'go run .' --delay 1s
  • Advanced example:
    watcher --cmd 'go run .' --dir '~/Projects/watcher' --hidden false -l 50000
You might also like...
The simple and easy-to-use program designed to watch user activity for Cloud Providers.

Cloud Agent The simple and easy-to-use program is designed to watch user activity and possible orphan clusters for Cloud Providers: Gardener GCP (work

An open-source GitLab command line tool bringing GitLab's cool features to your command line
An open-source GitLab command line tool bringing GitLab's cool features to your command line

GLab is an open source GitLab CLI tool bringing GitLab to your terminal next to where you are already working with git and your code without switching

A command line tool to prompt for a value to be included in another command line.

readval is a command line tool which is designed for one specific purpose—to prompt for a value to be included in another command line. readval prints

sttr is command line software that allows you to quickly run various transformation operations on the string.
sttr is command line software that allows you to quickly run various transformation operations on the string.

sttr is command line software that allows you to quickly run various transformation operations on the string.

Count once - Just once? no, when appear many it run once, but it can run many times

countOnce just once? no, when appear many it run once, but it can run many times

A CLI tool to change monitor settings over USB to the Gigabyte M32U

Gigabyte Monitor control Introduction A CLI tool to change monitor settings over USB to the Gigabyte M32U Supported monitors Gigabyte M32U In theory a

Git-reviewers - Find out who are the best reviewers for a given change.

git-reviewers Figure out who would be a good reviewer for a change. There are two places checked when determining reviewers: The results of git blame

Splasher is a tool to change desktop wallpaper random every 2 minutes from unsplash.

Splasher Splasher is a tool to change desktop wallpaper random every 2 minutes from unsplash. Download Latest Release: GitHub Release Installation & S

The go mod init command initializes and writes a new go.mod file in the current directory

go mod: The go mod init command initializes and writes a new go.mod file in the current directory, in effect creating a new module rooted at the curre

Owner
Geet Sethi
Geet Sethi
Simple application watcher

Anko Simple Application watcher The Anko project aims to be a command line used to watch files of different extensions, executing actions previously c

Guilherme Caruso 29 Dec 9, 2022
simple cli app for search and watch anime

simple terminal app for search and watch movie or anime

Muhammad Al Farizzi 1 Oct 30, 2021
Watch your favourite anime using the video player of your choice directly from the command line

anime-cli Watch your favourite anime using the video player of your choice direc

Ruben Dewitte 4 Feb 10, 2022
Command-line tool to load csv and excel (xlsx) files and run sql commands

csv-sql supports loading and saving results as CSV and XLSX files with data processing with SQLite compatible sql commands including joins.

Dhamith Hewamullage 24 Nov 2, 2022
a command line tool for syncing a local directory to wnfs

wnfs-sync demo demo CLI application to syncronize a local filesystem directory to a public web-native file system directory. # get this binary, assume

Brendan O'Brien 7 Mar 28, 2022
lls is lightweight ls. Using lls, you can get a list of files in a directory that contains a large number of files.

lls lls is lightweight ls. Using lls, you can get a list of files in a directory that contains a large number of files. How? You allocate a buffer for

Tatsuya Kaneko 59 Dec 29, 2022
Turn .mp3 files in current directory to a podcast feed just one command.

dir2cast Turn .mp3 files in current directory to a podcast feed just one command. Then you can subscribe to it with your favorite podcast client, down

王子亭 4 Jun 27, 2022
👀 A modern watch command. Time machine and pager etc.

Viddy Modern watch command. Viddy well, gopher. Viddy well. Demo Features Basic features of original watch command. Execute command periodically, and

Takumasa Sakao 3.8k Jan 2, 2023
A command line tool that builds and (re)starts your web application everytime you save a Go or template fileA command line tool that builds and (re)starts your web application everytime you save a Go or template file

# Fresh Fresh is a command line tool that builds and (re)starts your web application everytime you save a Go or template file. If the web framework yo

null 0 Nov 22, 2021
Golang-based simple file server to serve files of the current working directory

fileserve Golang-based simple file server to serve static files of the current working directory File sharing in LAN or home network Web application t

Frank Hübner 2 Jan 9, 2022