DEV Community

tetsu
tetsu

Posted on • Updated on

👁️Accelerates your coding using Gaze

Software development often forces us to execute the same command again and again, by hand!

👁️Gaze runs commands for you, right after you save a file.

It greatly helps you focus on writing code!

Gaze

Gaze is designed as a CLI tool that accelerates your coding.

  • Easy to use, out-of-the-box
  • Super quick reaction
  • Language-agnostic, editor-agnostic
  • Flexible configurations
  • Useful advanced options
  • Multiplatform (macOS, Windows, Linux)
  • Appropriate parallel handling

👁️Installation

On macOS

brew install gaze
Enter fullscreen mode Exit fullscreen mode

Windows/Linux: download binary https://github.com/wtetsu/gaze/releases

👁️How to use

Gaze is really easy to use.

gaze .
Enter fullscreen mode Exit fullscreen mode

And invoke your favorite editor on another terminal and edit it!

vi a.py
Enter fullscreen mode Exit fullscreen mode

👁️More examples

Gaze at one file. You can just specify file names.

gaze a.py
Enter fullscreen mode Exit fullscreen mode

Gaze doesn't have complicated options to specify files. You can use wildcards (*, **, ?) that shell users are familiar with. You don't have to remember Gaze-specific command-line options!

gaze "*.py"
Enter fullscreen mode Exit fullscreen mode

Gaze at subdirectories. Runs a modified file.

gaze "src/**/*.rb"
Enter fullscreen mode Exit fullscreen mode

Gaze at subdirectories. Runs a command to a modified file.

gaze "src/**/*.js" -c "eslint {{file}}"
Enter fullscreen mode Exit fullscreen mode

Kill an ongoing process, every time before it runs the next. This is useful when you are writing a server.

gaze -r server.py
Enter fullscreen mode Exit fullscreen mode

Kill an ongoing process, after 1000(ms). This is useful if you love to write infinite loops.

gaze -t 1000 complicated.py
Enter fullscreen mode Exit fullscreen mode

In order to run multiple commands for one update, just simply write multiple lines (use quotations for general shells). If an exit code was not 0, Gaze doesn't invoke the next command.

gaze "*.cpp" -c "gcc {{file}} -o a.out
ls -l a.out
./a.out"
Enter fullscreen mode Exit fullscreen mode

👁️Motivation

I often write Python scripts to automate boring tasks. I created a.py, wrote 5 lines of code and run "python a.py". Since the result was not perfect, I edited a.py again, and run "python a.py" again.

Again and again...

Then, I found myself going back and forth between the editor and terminal and typing the same command thousands of times that is total waste of time and energy!

That's the reason I developed Gaze in order to automate commands execution.

See more details!
https://github.com/wtetsu/gaze

Top comments (0)