From dfbcb973c39d3ea7cdcd8e94c825238aa52b1da1 Mon Sep 17 00:00:00 2001 From: Chen Asraf Date: Wed, 3 Dec 2025 14:28:01 +0200 Subject: [PATCH] docs: add README.md and LICENSE --- .prettierrc | 15 ++++++ LICENSE | 21 ++++++++ README.md | 136 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 172 insertions(+) create mode 100644 .prettierrc create mode 100644 LICENSE create mode 100644 README.md diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..548c817 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,15 @@ +{ + "printWidth": 100, + "semi": false, + "singleQuote": true, + "trailingComma": "all", + "overrides": [ + { + "files": "*.md", + "options": { + "printWidth": 100, + "proseWrap": "always" + } + } + ] +} diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..c6cb317 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright © 2025 Chen Asraf + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..2e917b3 --- /dev/null +++ b/README.md @@ -0,0 +1,136 @@ +# watchr + +**`watchr`** is a terminal UI for running commands and interactively browsing their output. It +provides vim-style navigation, filtering, and a preview pane—all without leaving your terminal. + +![Release](https://img.shields.io/github/v/release/chenasraf/watchr) +![Downloads](https://img.shields.io/github/downloads/chenasraf/watchr/total) +![License](https://img.shields.io/github/license/chenasraf/watchr) + +--- + +## 🚀 Features + +- **Interactive output viewer**: Browse command output with vim-style keybindings +- **Live filtering**: Press `/` to filter output lines in real-time +- **Preview pane**: Toggle a preview panel (bottom, top, left, or right) +- **Auto-refresh**: Optionally re-run commands at specified intervals +- **Line numbers**: Optional line numbering with configurable width +- **Full-screen TUI**: Clean, distraction-free interface using your entire terminal + +--- + +## 🎯 Installation + +### Download Precompiled Binaries + +Grab the latest release for **Linux**, **macOS**, or **Windows**: + +- [Releases →](https://github.com/chenasraf/watchr/releases/latest) + +### Homebrew (macOS/Linux) + +Install directly from the tap: + +```bash +brew install chenasraf/tap/watchr +``` + +Or tap and then install the package: + +```bash +brew tap chenasraf/tap +brew install watchr +``` + +### From Source + +```bash +git clone https://github.com/chenasraf/watchr +cd watchr +make build +make install # installs to ~/.local/bin +``` + +--- + +## ✨ Getting Started + +### Basic Usage + +```bash +# View output of any command +watchr ls -la + +# View logs +watchr "tail -100 /var/log/system.log" + +# Monitor processes +watchr "ps aux" +``` + +### Auto-Refresh + +```bash +# Refresh every 2 seconds +watchr -r 2 "docker ps" + +# Watch file changes +watchr -r 5 "find . -name '*.go' -mmin -1" +``` + +### Options + +``` +Usage: watchr [options] + +Options: + -h, --help Show help + -v, --version Show version + -r, --refresh int Auto-refresh interval in seconds (0 = disabled) + -p, --prompt string Prompt string (default "watchr> ") + -s, --shell string Shell to use for executing commands (default "sh") + -n, --no-line-numbers Disable line numbers + -w, --line-width int Line number width (default 6) + -P, --preview-height int Preview window height/width percentage (default 40) + --preview-position string Preview position: bottom, top, left, right (default "bottom") +``` + +--- + +## ⌨️ Keybindings + +| Key | Action | +| ------------------ | ------------------------------- | +| `r`, `Ctrl-r` | Reload (re-run command) | +| `q`, `Esc` | Quit | +| `j`, `k` | Move down/up | +| `g` | Go to first line | +| `G` | Go to last line | +| `Ctrl-d`, `Ctrl-u` | Half page down/up | +| `PgDn`, `Ctrl-f` | Full page down | +| `PgUp`, `Ctrl-b` | Full page up | +| `p` | Toggle preview pane | +| `/` | Enter filter mode | +| `Esc` | Exit filter mode / clear filter | + +--- + +## 🛠️ Contributing + +I am developing this package on my free time, so any support, whether code, issues, or just stars is +very helpful to sustaining its life. If you are feeling incredibly generous and would like to donate +just a small amount to help sustain this project, I would be very very thankful! + + +Buy Me a Coffee at ko-fi.com + + +I welcome any issues or pull requests on GitHub. If you find a bug, or would like a new feature, +don't hesitate to open an appropriate issue and I will do my best to reply promptly. + +--- + +## 📜 License + +`watchr` is licensed under the [MIT License](/LICENSE).