Giter Club home page Giter Club logo

twitch-cli's Introduction

Twitch CLI

License

A simple command-line tool to watch one or more Glob patterns and run commands when they change. Essentially this is a more ergonomic version of inotifywait.

The CLI UI of this tool is inspired by the twitch library, hence the name.

For a more advanced tool with similar features, checkout steeloverseer. steeloverseer allows for more complex rules at the cost of a slightly less friendly interface.

Usage

twitch --help

# Watches for .pyc files at any depth and deletes
# them when created or modified.
twitch --debounce 0 -p '**/*.pyc:rm $FILE'

# Watches .cabal files and reconfigures when they change.
# Also watches .hs files at any depth in the src folder
# and rebuilds the project when they change.
twitch -p '*.cabal:cabal configure && cabal build' -p 'src/**/*.hs:cabal build'

# Watches all .log files in /var/log and prints their last line
# when they change.
twitch --debounce 0 -p '/var/log/*.log:tail -n 1 $FILE'

Development

Build with one of:

  • stack build
  • nix-shell --run 'cabal build'
  • nix-build

Develop with one of:

  • stack ghci
  • nix-shell --run 'cabal repl'

twitch-cli's People

Contributors

3noch avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

twitch-cli's Issues

Submit to hackage and stackage

Once a few of the glaring improvements are made, submit this to hackage and stackage so we can start using it in nixpkgs too.

Properly escape paths

This is a hacky solution for supplying the $FILE variable to the command. Inject it properly using process API.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.