Run commands when files change.

Related tags

Command Line crow
Overview

Crow

crow is a simple command-line utility that lets you run arbitrary commands when certain files change.

Crow Banner

Demo

A demonstration of crow being used to re-execute tests every time a file is saved. Also, see other use cases.

Crow Demo

Installation

Install with go get

go get github.com/maaslalani/crow

Install from source

Clone this repository and cd into it.

git clone [email protected]:maaslalani/crow.git && cd crow

Install crow with go install.

go install

Ensure ~/go/bin is in your PATH.

Usage

crow [--watch path] [--ext extensions] command

or pipe in a list of filenames to watch from stdin from fd, find, ls, echo, etc...

filenames | crow command

Use cases

Use crow to run tests once you save main.go.

crow -w main.go go test ./...
echo main.go | crow go test ./...

Automatically restart your server on changes (watches all files in the current directory).

crow go run main.go

Live preview markdown in your terminal with glow.

crow -w README.md glow README.md
fd .md | crow glow README.md

Use crow with !! to watch files and run the last command.

crow !!

Alternatives

Contributing

Pull requests are welcome.

License

MIT

Comments
  • Related project: entr

    Related project: entr

    Not a feature request but merely a note about another similar project, entr. Do you know it? How do you think entr and crow compare to each other? Maybe it's worth mentioning it in the readme as related project.

    opened by pylipp 1
  • Pipe

    Pipe

    Fixes #2

    Changes Introduced

    • Ability to input filenames from stdin to watch

    This uses a little bit of a hack since extensions just matches the suffix instead of using .go or actual extensions we can just add the full path.

    We should deprecate the -w and -e fields and replace it with -f/--files, if the -f flag isn't provided then we should look in the current directory and look at all extensions.

    opened by maaslalani 0
  • Pipe filenames from `stdin`

    Pipe filenames from `stdin`

    Is your feature request related to a problem? Please describe. It would be cool to pipe in file names from stdin like entr does.

    Describe the solution you'd like Ability to pipe in filenames from programs like fd, ls, echo, find, etc...

    fd .go | crow go test ./...
    

    This makes crow really extensible in terms of limiting files being watched.

    Describe alternatives you've considered Introducing another flag for file names --files

    opened by maaslalani 0
  • Deprecate `--watch` and `--ext` flags in favour of `stdin` arguments

    Deprecate `--watch` and `--ext` flags in favour of `stdin` arguments

    Is your feature request related to a problem? Please describe. Deprecate --watch and --ext flags in favour of stdin arguments. Since you can use stdin to get a list of filenames the current flags are redundant because --watch specifies a directory and --ext specifies the extension. Using stdin can always replace these in a more unix way.

    For example:

    1. Watching all markdown files and running glow on README.md
    crow -e .md glow README.md
    
    fd .md | crow glow README.md
    
    1. Watching all go files in the src directory and rerunning tests
    crow -w src -e go go test ./...
    
    fd src -e go | crow go test ./...
    
    opened by maaslalani 0
  • Windows support

    Windows support

    Describe the bug crow doesn't work on windows.

    Build output:

    c:\Code\crow>go build
    go: downloading github.com/urfave/cli/v2 v2.2.0
    go: downloading github.com/fsnotify/fsnotify v1.4.9
    go: downloading github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d
    go: downloading github.com/russross/blackfriday/v2 v2.0.1
    go: downloading github.com/shurcooL/sanitized_anchor_name v1.0.0
    # github.com/maaslalani/crow/command
    command\command.go:20:39: unknown field 'Setpgid' in struct literal of type syscall.SysProcAttr
    command\command.go:46:2: undefined: syscall.Kill
    
    opened by maaslalani 0
Releases(v1)
Owner
Maas Lalani
Maas Lalani
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
painless task queue manager for shell commands with an intuitive cli interface (execute shell commands in distributed cloud-native queue manager).

EXEQ DOCS STILL IN PROGRESS. Execute shell commands in queues via cli or http interface. Features Simple intuitive tiny cli app. Modular queue backend

Mohammed Al Ashaal 13 Dec 14, 2022
Commando - run commands against networking devices in batch mode

Commando is a tiny tool that enables users to collect command outputs from a single or a multiple networking devices defined in an inventory file.

Roman Dodin 40 Oct 30, 2022
Handy commands to run in Go projects

Handy commands to run in Go projects

Nikolay Dubina 2.3k Jan 3, 2023
Commands to Build and Run dockerized-go-service

Dockerized Go Service Commands to Build and Run dockerized-go-service Syntax: $ docker image build /path/to -t imageName:version -t imageName:revision

Gökhan Tamkoç 1 Oct 24, 2021
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

null 1 Jan 29, 2022
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

Kelvie Wong 21 Dec 30, 2022
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

Mike Christof 0 Jan 10, 2022
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

XXIV 0 Jan 7, 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
tinygo-used-files is a CLI tool that lists only the files to be built as specified by buildtag.

tinygo-used-files is a CLI tool that lists only the files to be built as specified by buildtag.

sago35 0 Feb 6, 2022
Related is a simple cli utility tool to create files or a group of files.

Related - Create files based on individual definitions or groups Related helps with common file-creation-based tasks. You can predefine single types a

Andrej Benz 3 Apr 16, 2022
🧑‍💻📊 Show off your most used shell commands

tsukae ??‍?? ?? Tsukae, 使え - means use in Japanese (so it refers to commands that you use) Built on top of termui and cobra Big shoutout to jokerj40 f

Ilya Revenko 430 Dec 17, 2022
cTRL is a server for remote execution of pending tasks and commands in real time, supporting a queue with continuous thread limiting and throttling.

Документация на русском: https://github.com/eltaline/ctrl/blob/master/README-RUS.md cTRL is a server written in Go language that uses a modified versi

Eltaline 24 Mar 3, 2022
Tool for shell commands execution, visualization and alerting. Configured with a simple YAML file.

Sampler. Visualization for any shell command. Sampler is a tool for shell commands execution, visualization and alerting. Configured with a simple YAM

Alexander Lukyanchikov 11.1k Dec 28, 2022
Go Library to Execute Commands Over SSH at Scale

Go library to handle tens of thousands SSH connections and execute the command(s) with higher-level API for building network device / server automation.

Yahoo 882 Dec 9, 2022
miscellaneous useful commands, including 'gosh' the Go scripting tool

utilities Miscellaneous useful commands. gosh This is a tool for running Go code from the command line. See here. findCmpRm This finds files with copi

Nick Wells 25 Oct 31, 2022
Integrated console application library, using Go structs as commands, with menus, completions, hints, history, Vim mode, $EDITOR usage, and more ...

Gonsole - Integrated Console Application library This package rests on a readline console library, (giving advanced completion, hint, input and histor

null 18 Nov 20, 2022
ag is a tool for defining an alias for a group of commands

AG Introduction ag is a command line tool that similar to Makefile. with ag you can make an alias for group of commands with custom flags. This tool i

Mostafa Hosseini 5 Jul 17, 2022