Constructing complex multi-stage UNIX command pipelines—stringing together grep, sed, awk, cut, sort, and jq—is standard practice for Linux system administrators. However, designing these pipelines traditionally requires tedious trial-and-error: executing the command, inspecting the output, pressing the Up arrow to edit the syntax, running it again, and repeating the cycle until the formatting is correct.
pipr is a modern, interactive command-line utility built in Rust that revolutionizes this workflow. It provides a live, interactive text-user interface (TUI) where you type shell commands into a pipeline and watch the transformed output update in real time with every keystroke. This guide covers installation, keybindings, and advanced pipeline development with pipr.
Installing pipr on Linux
Because pipr is developed in Rust, it can be installed via Cargo or pre-compiled release binaries:
Method 1: Install via Cargo
# Ensure Rust and Cargo are installed
sudo apt update && sudo apt install cargo -y
# Compile and install pipr
cargo install pipr
Method 2: Download Pre-compiled Binary
# Download latest release from GitHub
curl -s https://api.github.com/repos/elkowar/pipr/releases/latest \
| grep "browser_download_url.*linux" \
| cut -d : -f 2,3 \
| tr -d \" \
| wget -qi -
# Make executable and move to PATH
chmod +x pipr
sudo mv pipr /usr/local/bin/
Interactive Pipeline Construction Workflow
To start constructing a pipeline with sample input data (such as a server log file or JSON payload):
# Pipe input data directly into pipr
cat /var/log/syslog | pipr
Once pipr launches:
- The top pane presents an interactive command input bar.
- The middle pane displays an instant, live preview of the transformed data stream.
- Begin typing:
grep "systemd" | awk '{print $1, $2, $5}' | sort | uniq -c - As you modify parameters or regex patterns, pipr evaluates the pipeline on a background thread and refreshes the preview pane instantaneously.
- When satisfied with your pipeline, press
Enterto exit pipr and print the completed pipeline string directly to your terminal prompt for immediate execution or script integration.
Essential Keyboard Shortcuts
| Keybinding | Action |
|---|---|
Enter |
Confirm pipeline and output command to shell |
Ctrl + C / Esc |
Exit pipr without saving |
Page Up / Page Down |
Scroll through the live output preview window |
Tab |
Autocompletes common shell utilities and file paths |
Ctrl + Z |
Toggle execution pause (useful for long streams) |