hwatch: alternative watch command with history, diff view, JSONL logging, and change hooks. since 2018.
hwatch: alternative watch command with history, diff view, JSONL logging, and change hooks. since 2018.
hwatch - alternative watch command.
hwatch is a alternative watch command, it developed started in 2018.
That records the result of command execution, can display it history and diffs, hook and run commands.
hwatch has been accepted into Debian unstable, although availability may depend on mirror sync status.
If you need it immediately, use the release .deb package from GitHub Releases.
Official Fedora packaging is in progress and not yet available from Fedora repositories.
EPEL packaging is planned after Fedora packaging is finalized.
apk add hwatchThis repository includes packaging metadata for Debian-style .deb builds and RPM-based distributions, and GitHub Releases publishes prebuilt archives plus generated .deb and .rpm assets while official distro packaging is being worked on.
GitHub Actions validates the packaging flow in distro-specific containers:
debian:sid containerfedora:latest containerThese checks are intended to catch packaging regressions early while the project works toward official distribution packaging. Alpine packages are available today, and Debian/Fedora distribution repository submissions are still in progress.
Community-maintained packages are available in several ecosystems, but they may lag behind the latest upstream release.
# brew
brew install hwatch
# MacPorts
sudo port install hwatch# paru
paru -S hwatch
# yay
yay -S hwatchnix profile install nixpkgs#hwatchconda install conda-forge::hwatch
# or
mamba install conda-forge::hwatch# mise
mise use -g aqua:blacknon/hwatch
# asdf
asdf plugin add hwatch
asdf install hwatch latest
asdf global hwatch latestIf you want the latest upstream release immediately, use the assets published on GitHub Releases.
Current release assets include:
x86_64-unknown-linux-gnu.tar.gzx86_64-unknown-linux-musl.tar.gzaarch64-unknown-linux-musl.tar.gzx86_64-unknown-linux-musl.debx86_64-fedora.rpmx86_64-apple-darwin.tar.gzaarch64-apple-darwin.tar.gzx86_64-pc-windows-msvc.zipFor generic .tar.gz assets:
curl -LO https://github.com/blacknon/hwatch/releases/latest/download/hwatch-..tar.gz
tar xf hwatch-..tar.gz
sudo install -m 0755 bin/hwatch /usr/local/bin/hwatchFor the generated release packages:
# Debian/Ubuntu-style systems
sudo dpkg -i hwatch-.x86_64-unknown-linux-musl.deb
# Fedora/RHEL-style systems
sudo dnf install ./hwatch-.x86_64-fedora.rpmcargo install hwatch--diff-plugin loads native dynamic libraries. Only load plugins you trust.--shell, the monitored command itself, and --aftercommand execute commands on your system. Treat those values as trusted input only.…Watch mode keybind(Default).
| Key | Action |
|---|---|
| ↑, ↓ | move selected screen(history/watch). |
| pageup, pagedn | move selected screen(history/watch). |
| home, end | move selected screen(history/watch). |
| Tab | toggle select screen(history/watch). |
| ← | select watch screen. |
| → | select history screen. |
| Alt+←, Alt+→ | Watch window scrll left/right. |
| Shift+Alt+←, Shift+Alt+→ | Watch window scrll start/end. |
| Q | exit hwatch. |
| Esc | unfiltering. |
| Shift+D | delete selected history. |
| Shift+X | clear all history except selected history. |
| Ctrl+c | cancel. |
| H | show help window. |
| B | toggle enable/disable border. |
| C | toggle color. |
| N | switch line number display. |
| R | toggle reverse mode. |
| M | toggle mouse support. |
| T | toggle the UI (history pane and header). |
| Backspace | toggle the history pane. |
| D | switch diff mode. |
| 0 | disable diff. |
| 1 | switch watch type diff. |
| 2 | switch line type diff. |
| 3 | switch word type diff. |
| Shift+O | show only lines with differences(line/word diff mode only). |
| O | switch output mode(output->stdout->stderr). |
| W | Toggle wrap. |
| F1 | only stdout print. |
| F2 | only stderr print. |
| F3 | print output. |
| Ctrl+N | Forcus next keyword. |
| Ctrl+P | Forcus before keyword. |
| Shift+S | show summary information in history. |
| + | increase interval. |
| - | decrease interval. |
| P | Pause/unpause execution. |
| / | filter history by string. |
| * | filter history by regex. |
Can customize key bindings by using the -K Option.
Write it in the format keybind=funciton.
hwatch -K ctrl-p=history_pane_up -K ctrl-n=history_pane_down command...Keybind functions that can be specified are as follows.
| function | description |
|---|---|
| up | Move up |
| watch_pane_up | Move up in watch pane |
| history_pane_up | Move up in history pane |
| down | Move down |
| watch_pane_down | Move down in watch pane |
| history_pane_down | Move down in history pane |
| scroll_right | Move page right in watch pane |
| scroll_horizontal_end | Move page right end in watch pane |
| scroll_left | Move page left in watch pane |
| scroll_horizontal_home | Move page left start in watch pane |
| page_up | Move page up |
| watch_pane_page_up | Move page up in watch pane |
| history_pane_page_up | Move page up in history pane |
| page_down | Move page down |
| watch_pane_page_down | Move page down in watch pane |
| history_pane_page_down | Move page down in history pane |
| move_top | Move top |
| watch_pane_move_top | Move top in watch pane |
| history_pane_move_top | Move top in history pane |
| move_end | Move end |
| watch_pane_move_end | Move end in watch pane |
| history_pane_move_end | Move end in history pane |
| toggle_focus |
No open issues yet, or sync has not completed.