DEV Community

tetsu
tetsu

Posted on • Edited on

👁️Accelerates your coding using Gaze

Software development often forces us to manually run the same commands over and over.

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

It significantly helps you stay focused on writing code!

Gaze

Gaze is designed as a CLI tool to streamline your coding process.

  • Easy to use, out-of-the-box experience
  • Super quick response time
  • Language- and editor-agnostic
  • Flexible configuration options
  • Useful advanced features
  • Multiplatform support (macOS, Windows, Linux)
  • Efficient parallel execution 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 incredibly easy to use.

gaze .
Enter fullscreen mode Exit fullscreen mode

Then, open your preferred editor in another terminal and start coding:

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 require complicated file specification options. You can leverage familiar shell wildcards like *, **, and ?. No need to memorize 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

Specify an arbitrary command by -c option.

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

Kill the previous one before launching a new process. This is useful if 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 infinite loops.

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

Specify multiple commands in quotations, separated by newlines.

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

👁️Motivation

I frequently write Python scripts to automate tasks. I'd create a.py, write a few lines, and then run python a.py. Often, the result wasn't perfect, so I'd edit a.py again and re-run python a.py.

This cycle repeated endlessly...

I realized I was constantly switching between my editor and terminal, typing the same command over and over again. It was a huge waste of time and energy!

That's why I developed Gaze: to automate command execution and eliminate this repetitive, manual process.

Learn more at: https://github.com/wtetsu/gaze

Top comments (0)