Hwatch
A modern alternative to the watch command, records the differences in execution results and can check this differences at after.
Install / Use
/learn @blacknon/HwatchREADME
hwatch
hwatch - alternative watch command.
<p align="center"> <img src="./img/hwatch.gif" /> </p>Description
hwatch is a alternative watch command.
That records the result of command execution and can display it history and diffs.
Features
- Can keep the history when the difference, occurs and check it later.
- Can check the difference in the history. The display method can be changed in real time.
- Can output the execution result as log (json format).
- Custom keymaps are available.
- Support ANSI color code.
- Execution result can be scroll.
- Not only as a TUI application, but also to have the differences output as standard output.
- If a difference occurs, you can have the specified command additionally executed.
Install
macOS (brew)
brew install hwatch
macOS (MacPorts)
sudo port install hwatch
Arch Linux (AUR)
paru -S hwatch
Cargo Install
cargo install hwatch
Usage
Command
$ hwatch --help
A modern alternative to the watch command, records the differences in execution results and can check this differences at after.
Usage: hwatch [OPTIONS] [command]...
Arguments:
[command]...
Options:
-b, --batch output execution results to stdout
-B, --beep beep if command has a change result
--border Surround each pane with a border frame
--with-scrollbar When the border option is enabled, display scrollbar on the right side of watch pane.
--mouse enable mouse wheel support. With this option, copying text with your terminal may be harder. Try holding the Shift key.
-c, --color interpret ANSI color and style sequences
-r, --reverse display text upside down.
-C, --compress Compress data in memory. Note: If the output of the command is small, you may not get the desired effect.
-t, --no-title hide the UI on start. Use `t` to toggle it.
-N, --line-number show line number
--no-help-banner hide the "Display help with h key" message
--completion <shell> output shell completion script (bash, fish, zsh)
-x, --exec Run the command directly, not through the shell. Much like the `-x` option of the watch command.
-O, --diff-output-only Display only the lines with differences during `line` diff and `word` diff.
-A, --aftercommand <after_command> Executes the specified command if the output changes. Information about changes is stored in json format in environment variable ${HWATCH_DATA}.
-l, --logfile [<logfile>] logging file. if a log file is already used, its contents will be read and executed.
-s, --shell <shell_command> shell to use at runtime. can also insert the command to the location specified by {COMMAND}. [default: "sh -c"]
-n, --interval <interval> seconds to wait between updates [default: 2]
--precise Attempt to run as close to the interval as possible, regardless of how long the command takes to run
-L, --limit <limit> Set the number of history records to keep. only work in watch mode. Set `0` for unlimited recording. [default: 5000]
--tab-size <tab_size> Specifying tab display size [default: 4]
-d, --differences [<differences>] highlight changes between updates [possible values: none, watch, line, word]
-o, --output [<output>] Select command output. [default: output] [possible values: output, stdout, stderr]
-K, --keymap <keymap> Add keymap
-h, --help Print help
-V, --version Print version
Keybind
Watch mode keybind(Default).
| Key | Action | | ------------------------------------------------------------------------------------------ | ----------------------------------------------------------- | | <kbd>↑</kbd>, <kbd>↓</kbd> | move selected screen(history/watch). | | <kbd>pageup</kbd>, <kbd>pagedn</kbd> | move selected screen(history/watch). | | <kbd>home</kbd>, <kbd>end</kbd> | move selected screen(history/watch). | | <kbd>Tab</kbd> | toggle select screen(history/watch). | | <kbd>←</kbd> | select watch screen. | | <kbd>→</kbd> | select history screen. | | <kbd>Alt</kbd>+<kbd>←</kbd>, <kbd>Alt</kbd>+<kbd>→</kbd> | Watch window scrll left/right. | | <kbd>Shift</kbd>+<kbd>Alt</kbd>+<kbd>←</kbd>, <kbd>Shift</kbd>+<kbd>Alt</kbd>+<kbd>→</kbd> | Watch window scrll start/end. | | <kbd>Q</kbd> | exit hwatch. | | <kbd>Esc</kbd> | unfiltering. | | <kbd>Shift</kbd>+<kbd>D</kbd> | delete selected history. | | <kbd>Shift</kbd>+<kbd>X</kbd> | clear all history except selected history. | | <kbd>Ctrl</kbd>+<kbd>c</kbd> | cancel. | | <kbd>H</kbd> | show help window. | | <kbd>B</kbd> | toggle enable/disable border. | | <kbd>C</kbd> | toggle color. | | <kbd>N</kbd> | switch line number display. | | <kbd>R</kbd> | toggle reverse mode. | | <kbd>M</kbd> | toggle mouse support. | | <kbd>T</kbd> | toggle the UI (history pane and header). | | <kbd>Backspace</kbd> | toggle the history pane. | | <kbd>D</kbd> | switch diff mode. | | <kbd>0</kbd> | disable diff. | | <kbd>1</kbd> | switch watch type diff. | | <kbd>2</kbd> | switch line type diff. | | <kbd>3</kbd> | switch word type diff. | | <kbd>Shift</kbd>+<kbd>O</kbd> | show only lines with differences(line/word diff mode only). | | <kbd>O</kbd> | switch output mode(output->stdout->stderr). | | <kbd>W</kbd> | Toggle wrap. | | <kbd>F1</kbd> | only stdout print. | | <kbd>F2</kbd> | only stderr print. | | <kbd>F3</kbd> | print output. | | <kbd>Ctrl</kbd>+<kbd>N</kbd> | Forcus next keyword. | | <kbd>Ctrl</kbd>+<kbd>P</kbd> | Forcus before keyword. | | <kbd>Shift</kbd>+<kbd>S</kbd> | show summary infomation in history. | | <kbd>+</kbd>
Related Skills
himalaya
340.5kCLI to manage emails via IMAP/SMTP. Use `himalaya` to list, read, write, reply, forward, search, and organize emails from the terminal. Supports multiple accounts and message composition with MML (MIME Meta Language).
tmux
340.5kRemote-control tmux sessions for interactive CLIs by sending keystrokes and scraping pane output.
coding-agent
340.5kDelegate coding tasks to Codex, Claude Code, or Pi agents via background process
tavily
340.5kTavily web search, content extraction, and research tools.
