HWATCH(1)

πŸ“¦ version 0.4.2, in ubuntu stonking

πŸ’– hwatch(1) πŸ’–

okay bestie, sit down, hydrate, because I'm about to put you onto hwatch β€” a modern alternative to the watch command that records the differences in execution results and can check those differences after. yes, that's the whole name-line, and yes, it's iconic. it's the watch command but with ✨receipts✨. it lives in section 1 of the manual, so you know it's a user command, and it's here to make your terminal main character energy.


🌸 SYNOPSIS 🌸

hwatch [options] command

one command, as many options as your heart desires. that's it. that's the whole vibe check. 🫢


πŸ¦‹ DESCRIPTION πŸ¦‹

hwatch is like the watch command β€” it repeatedly executes a command and displays its output, on loop, forever, like your favorite song. BUT. and this is the part that ate β€” the output results can be scrolled and displayed. no more squinting at a frozen screen, bestie.

and it gets better. the difference of the execution result is recorded with the time stamp, so you can check it later. it's giving diary, it's giving historical archive, it's giving receipts for days. and when you're checking? it's also possible to display the diff with the previous difference together, so you can see the whole glow-up timeline.

if you specify it with options, the execution result can be recorded as a log with json. very much data girlboss behavior. πŸ’…

✨ Flags ✨

  • -h, --help β€” Prints help information πŸ’–
  • -V, --version β€” Prints version information πŸŽ€
  • -b, --batch β€” Output execution results to stdout. NOTE: Operations with TUI are not possible in batch mode. so like, no pretty panes for you in batch mode, sorry babe 😭
  • -B, --beep β€” beep if command has a change result. πŸ”Š tiny alarm clock energy, we love her
  • -g, --chgexit [count] β€” Exit when output changes. If no value is specified, exit after the first detected change. If count is specified, exit after that many detected changes. she leaves when things get interesting πŸ’€
  • --border β€” Surround each pane with a border frame. framing? for the aesthetic? obsessed πŸ–ΌοΈ
  • --with-scrollbar β€” When the border option is enabled, display scrollbar on the right side of watch pane. (yes, she has to be invited by --border first β€” they're a package deal)
  • --mouse β€” enable mouse wheel support. With this option, copying text with your terminal may be harder. Try holding the Shift key. ⚠️ real talk, this one's a trade-off
  • -c, --color β€” Interpret ANSI colors and style sequences and display in color. It can be changed later by key binding. 🌈 color is not a crime
  • -r, --reverse β€” Display text upside down. πŸ™ƒ literally what it says, no notes
  • -C, --compress β€” Compress data in memory. Note: If the output of the command is small, you may not get the desired effect. lowkey only worth it when the output is thicc
  • -t, --no-title β€” Hide the UI on start. Use t to toggle it. stealth mode activated 🀫
  • --enable-summary-char β€” collect character-level diff count in summary. counting characters like counting your blessings ✨
  • -N, --line-number β€” Show line number. numbered like a proper list bestie πŸ”’
  • -w, --wrap β€” Disable line wrap mode. (yes, the flag is called "wrap" and it disables wrap β€” she's complicated, we accept her) πŸŽ€
  • --no-help-banner β€” Hide the β€œDisplay help with h key” message. for when you already know, iykyk
  • --completion shell β€” Output shell completion script. Supported shells: bash, fish, zsh. autocomplete? slay 🌟
  • --no-summary β€” disable the calculation for summary that is running behind the scenes, and disable the summary function in the first place.
  • -x, --exec β€” Run the command directly, not through the shell. Much like the -x option of the watch command. direct communication, no middleman 🫢
  • -p, --use-pty β€” Run the command through a pseudo-TTY so commands that colorize on terminals can keep color output. keeping the color alive fr fr 🌸
  • -O, --diff-output-only β€” Display only the lines with differences during line diff and word diff. girlie does NOT have time for unchanged lines
  • --ignore-spaceblock β€” Ignore diffs where only consecutive whitespace blocks differ. whitespace drama? not today πŸ’…
  • --precise β€” Attempt to run as close to the interval as possible, regardless of how long the command takes to run. punctual queen ⏰

🌟 Options 🌟

  • -A, --aftercommand command to execute after difference occurs β€” Executes the specified command if the output changes. Information about changes is stored in json format in environment variable ${HWATCH_DATA}. a little and then what trigger, love that for us
  • --after-command-result-write-file β€” Pass ${HWATCH_DATA} to aftercommand as a temporary file path instead of inline JSON data. same tea, different cup πŸ“
  • -l, --logfile logfile β€” Output the command execution result and its time as a log in json. The execution results that are recorded are only those that differ from the previous execution results. If a log file is already used, its contents will be read and executed. journaling but make it json πŸ““
  • -s, --shell shell command β€” shell to use at runtime. can also insert the command to the location specified by {COMMAND}. pick your fighter, place your {COMMAND}
  • -n, --interval seconds β€” Seconds to wait between updates. Default is 2. the pause between re-runs, the dramatic beat 🎭
  • -L, --limit limit num β€” Set the number of history records to keep. only work in watch mode. Set 0 for unlimited recording. (default: 5000) [default: 5000]. unlimited recording is the hoarder arc, do it πŸ—ƒοΈ
  • --tab-size num β€” Specifying tab display size. default 4 char.
  • --diff-plugin path β€” Load a diffmode plugin dynamic library. Plugin-provided mode names can also be selected with -d/--differences. bringing her own plugins to the party 🧚
  • -d, --differences [none, watch, line, word] β€” set diff mode. highlight changes between updates. If only -d is specified, it will be a watch diff.
    • none … Do not show diff (default).
    • watch … Diff like watch command. Specifying the -d option applies this mode.
    • line … Can be done diff in line units.
    • word … Can be done diff in line word units.
  • -o, --output [output, stdout, stderr] β€” set output mode. If you specify the output mode, the history pane will also display only the history where the specified output mode has changed. filtering the timeline, periodt πŸ‘‘
  • -K, --keymap keymap β€” Customize Keymap. Keymap is specified in the format of key=action or modifierkey-key=action. build your own controls, main character behavior πŸ’…

🌈 Configuration 🌈

If you always want to use some command-line options, you can set them in the HWATCH environment variable. For example, if you use bash, you can add the following to your .bashrc:

export HWATCH="--no-title --color --no-help-banner"

HWATCH_WATCH_FG and HWATCH_WATCH_BG can also be used to customize watch diff highlight colors. Supported formats are named colors, 0-255, #RRGGBB, and R,G,B.

set it once, forget it forever, live your truth. set-and-forget is the highest form of self care 🫢

πŸŽ€ KEYBINDS πŸŽ€

hwatch uses Keybind for operations on the command execution screen. It is the default keymap.

  • h β€” Show help message. Press the h key again to return to the previous screen. your little helper fairy 🧚
  • q β€” Exit hwatch. bye bestie 😭
  • c β€” Interprets ANSI colors and style sequences and displays them in color. This is the same as the -c(–color) option. Press the c key again to return to the original. toggle toggle toggle πŸ”
  • n β€” Outputs the line number at the beginning of the line.
  • r β€” Displays the output of the watch pane in reverse order.
  • d β€” Highlight changes between updates. This is the same as the -d(–differences) option. You can switch the diff mode by pressing the d key. The d key toggles these in order. Use the 0, 1, 2, and 3 keys to switch directly to each mode.
    • none … Do not show diff (default).
    • watch … Diff like watch command. Specifying the -d option applies this mode.
    • line … Can be done diff in line units.
    • word … Can be done diff in line word units.
  • o β€” Switch output mode at stdout, stderr, and output. If you specify the output mode, the history pane will also display only the history where the specified output mode has changed.
  • O β€” Display only the lines with differences during line diff and word diff.
  • w β€” Toggle line wrap mode.
  • t β€” Switch display of header and history pane.
  • Backspace β€” Switch display of history pane.
  • m β€” Switch Mouse wheel support mode. With this option, copying text with your terminal may be harder. Try holding the Shift key. ⚠️ trade-off again, she's consistent
  • 0 β€” Switch diff mode to none.
  • 1 β€” Switch diff mode to watch.
  • 2 β€” Switch diff mode to line.
  • 3 β€” Switch diff mode to word.
  • F1 β€” Display only Stdout.
  • F2 β€” Display only Stderr.
  • F3 β€” Display Stdout and Stderr.
  • Ctrl+P β€” Focus before keyword.
  • Ctrl+N β€” Focus next keyword.
  • Shift+O β€” Show only lines with differences(line/word diff mode only).
  • Shift+S β€” Show summary infomation in history. (that's the original spelling okay, we keep it exactly as-is, no cap πŸ’–)
  • + β€” Increase interval by 0.5 seconds.
  • - β€” Decrease interval by 0.5 seconds (As long as it’s positive). don't go negative babe, that's not a vibe
  • p β€” Pause or resume command execution. ⏸️▢️ the power of the pause button
  • Tab β€” Switch the target(history or watch pad). The target is operated with the up and down keys.
  • / β€” Filter diffs by keyword.
  • * β€” Filter diffs by regex. regex girlies, rise up πŸ‘‘

πŸ’€ BUGS πŸ’€

See GitHub Issues: https://github.com/blacknon/hwatch/issues

found a bug? report it, don't just suffer in silence bestie 🫢

πŸ‘‘ AUTHOR πŸ‘‘

Blacknon <blacknon@orebibou.com>


okay and that's the whole page, you're fully caught up, you understood the assignment πŸ’… this was Version 0.4.2 of the hwatch(1) manual β€” thanks for reading all the way to the bottom, you're literally the bestie of all time. go watch something. slay. πŸŒˆβœ¨πŸ’–

πŸ“¦ where this page comes from