AwkP(review)
A proof of concept for live previewing output of an awk command.
The application is only about 100 lines of code.
Usage:
After building the binary with go build
:
./awkp path_to_file
You should have awk
in your path already for this to work correctly.
Installation
go install github.com/ngynkvn/awkp@latest
Motivation
There's a lot of friction for new users when learning command line tools like
awk, sed, and grep.
The motivation was to see how a quick feedback loop could potentially be useful for iteratively building out a command.
awk
is one of those commands I quickly iterate on until I get the appropriate output.
TUI's are just quicker to pull up than an online playground, and awk was a
simple target for experimenting ideas with how people interact with computers.
If you're interested in some cool TUI libraries, I recommend checking some of
these:
Nice to haves
Some extensions I think would be nice to have:
- Scrolling the output if it's longer than the text preview.
- Truncating the number of records returned in the preview (like
awk {print} | head -n 5
)
- Descriptions for the different flags that awk supports, and interative buttons
/ fields for setting them.
Dependencies