| Crates.io | pv |
| lib.rs | pv |
| version | 0.4.0 |
| created_at | 2019-10-27 13:49:03.871749+00 |
| updated_at | 2025-07-19 13:51:35.384995+00 |
| description | Rust reimplementation of the unix pipeview (pv) utility |
| homepage | https://github.com/SeanTater/pv |
| repository | https://github.com/SeanTater/pv |
| max_upload_size | |
| id | 176115 |
| size | 194,747 |
pv is a Unix pipe monitoring application. (And this is copy of the much older original)
You can use it in places where a progressbar, or at least a flow rate meter, would be handy. Some handy examples:
# Is it still transferring or did something freeze?
docker save excelsior | pv | ssh me@devbox.company.com "docker load"
# Why doesn't gzip have a progressbar already?
pv gigantic-file | gunzip | gawk '/size/ { x += $4 } END {print x}'
This Rust implementation covers the core functionality of the original pv utility but is missing several advanced features. Here's a comparison:
| Feature | Standard pv | Status |
|---|---|---|
| Core Display | ||
Progress bar (-p) |
✅ | ✅ Implemented |
Timer (-t) |
✅ | ✅ Implemented |
ETA (-e) |
✅ | ✅ Implemented |
Finish ETA (-I) |
✅ | ✅ Implemented |
Rate counter (-r) |
✅ | ✅ Implemented |
Average rate (-a) |
✅ | ✅ Implemented |
Byte counter (-b) |
✅ | ✅ Implemented |
Line mode (-l) |
✅ | ✅ Implemented |
Null termination (-0) |
✅ | ✅ Implemented |
Size specification (-s) |
✅ | ✅ Implemented |
Width control (-w) |
✅ | ✅ Implemented |
Name prefix (-N) |
✅ | ✅ Implemented |
Update interval (-i) |
✅ | ✅ Implemented |
Skip input errors (-E) |
✅ | ✅ Implemented |
| Additional Core Features | ||
Buffer percentage (-T) |
✅ | 🔴 Not Implemented |
Last written bytes (-A) |
✅ | 🔴 Not Implemented |
Custom format (-F) |
✅ | ✅ Implemented |
Numeric output (-n) |
✅ | ✅ Implemented |
Quiet mode (-q) |
✅ | ✅ Implemented |
| Display Options | ||
Bits instead of bytes (-8) |
✅ | ✅ Implemented |
SI units (-k) |
✅ | ✅ Implemented |
Wait for first byte (-W) |
✅ | ✅ Implemented |
Delay start (-D) |
✅ | ✅ Implemented |
Gauge mode (-g) |
✅ | 🔴 Not Implemented |
Average rate window (-m) |
✅ | 🔴 Not Implemented |
Bar style (-u) |
✅ | 🔴 Not Implemented |
Extra display (-x) |
✅ | 🔴 Not Implemented |
Transfer stats (-v) |
✅ | 🔴 Not Implemented |
Force output (-f) |
✅ | ✅ Implemented |
Cursor positioning (-c) |
✅ | 🔴 Not Implemented |
| Data Transfer Features | ||
Output to file (-o) |
✅ | ✅ Implemented |
Rate limiting (-L) |
✅ | ✅ Implemented |
Buffer size control (-B) |
✅ | 🔴 Not Implemented |
No splice (-C) |
✅ | 🔴 Not Implemented |
Skip output errors (-O) |
✅ | ✅ Implemented |
Error skip blocks (-Z) |
✅ | 🔴 Not Implemented |
Stop at size (-S) |
✅ | ✅ Implemented |
Sync writes (-Y) |
✅ | 🔴 Not Implemented |
Direct I/O (-K) |
✅ | 🔴 Not Implemented |
Discard output (-X) |
✅ | 🔴 Not Implemented |
Store and forward (-U) |
✅ | 🔴 Not Implemented |
| Advanced Features | ||
Watch file descriptor (-d) |
✅ | 🔴 Not Implemented |
Remote control (-R) |
✅ | 🔴 Not Implemented |
PID file (-P) |
✅ | 🔴 Not Implemented |
High Priority (Additional Core Features):
-F) - Essential for scripting and integration-n) - Important for automation-L) - Common use case for bandwidth control-o) - Basic I/O redirection-f) - Important for non-terminal usage-q) - Essential for silent operationMedium Priority (Enhanced Display):
-k) - Standards compliance-8) - Network monitoring use case-T) - Useful debugging feature-v) - Nice summary feature-g) - Alternative progress displayLower Priority (Advanced Features):
-d) - Advanced monitoring feature-R) - Advanced process control-U) - Specialized use case-K) - Performance optimization-c) - Terminal control featureThe current implementation covers exactly 70% of the standard pv features (32 out of 46 options). It successfully implements the core progress monitoring functionality including custom format strings, numeric output, rate limiting, output to file, force output, SI units, bits display, stop at size, wait for first byte, and delay start, but lacks many advanced features that make the original pv versatile for different use cases.
Some features are currently out of scope for this implementation due to limitations with the underlying indicatif library or complexity considerations:
Remote Control (-R)
indicatif is designed for single-process useCursor Positioning (-c)
indicatif's abstractionsBuffer Percentage (-T) & Last Written Bytes (-A)
indicatif doesn't exposeGauge Mode (-g)
indicatif's percentage-focused approachAdvanced Terminal Features
-u)-x, -v)indicatif or custom terminal handlingThe focus remains on implementing high-value features that provide the most utility while working well within the indicatif framework.
Download the pre-built static binary for Linux x86_64 from the releases page:
# Download and install the latest release
curl -L -o pv https://github.com/SeanTater/pv/releases/latest/download/pv-linux-x86_64
chmod +x pv
sudo mv pv /usr/local/bin/
# Verify installation
pv --version
The static binary has no dependencies and works on any Linux x86_64 system.
Download the latest Flatpak bundle from the releases page and install:
flatpak install pv.flatpak
Then run with:
flatpak run com.github.SeanTater.pv [options] [files...]
# Install from GitHub
cargo install --git https://github.com/SeanTater/pv.git
# Or clone and build locally
git clone https://github.com/SeanTater/pv.git
cd pv
cargo build --release
This project uses pre-commit hooks to automatically format code and run linting checks before commits. This prevents formatting-related CI failures.
Option 1: Automatic Git Hook (Recommended)
The repository includes a Git pre-commit hook that will automatically run cargo fmt and cargo clippy:
# Hook is already set up - just make sure it's executable
chmod +x .git/hooks/pre-commit
Option 2: Pre-commit Framework
For more advanced setups, install the pre-commit framework:
# Install pre-commit (requires Python)
uv tool install pre-commit
# Install the git hook scripts
pre-commit install
# Optionally run against all files
pre-commit run --all-files
# Format code
cargo fmt
# Check linting
cargo clippy --all-targets --all-features -- -D warnings
# Run tests
cargo test
# Check formatting without fixing
cargo fmt --all -- --check