Skip to content

wp043/wp-mac-watch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

wp-mac-watch

wp-mac-watch is a fast, Mac-focused Activity Monitor alternative: process management (who’s running, why, kill/kill-tree) plus system metrics (Stats-style CPU, memory, swap) in one TUI, with a clean core so you can add a menubar later.

Why wp-mac-watch?

  • One place for “what’s running” and “how’s the system”
    If you use Stats (menu bar) and also need to see processes, search, and force-quit, wp-mac-watch merges system overview and process management in a single TUI (and is designed so the same data can drive a menubar later).
  • macOS-native
    LaunchAgent/Daemon attribution (“why is this running?”), .app detection, kill-tree. Not a generic top/htop clone.
  • Scriptable
    snapshot, kill, kill-tree subcommands for automation and tooling (e.g. macdevkit/doctor).

Features (v0.1)

  • System bar (Stats-style)
    One line at top: CPU %, memory bar (used/total), swap.
  • Process list
    CPU, memory, PID, process name; instant search (/), sort (s), group toggle (Apps / Background / All).
  • Details pane
    Path and attribution (LaunchAgent/Daemon/App, plist path).
  • Actions
    Force quit (f, SIGKILL), kill tree (t, SIGTERM).
  • CLI
    snapshot (JSON), kill, kill-tree for scripting.

Project layout

wp-mac-watch/
  Cargo.toml        # workspace
  .gitignore
  README.md
  crates/
    core/           # data model + diffing + search
    mac/            # macOS collectors, attribution, kill/kill-tree
    tui/            # ratatui UI + input + rendering
    cli/            # JSON snapshot + simple process control
  wp-mac-watch/     # main binary, wires sampler + TUI + actions

Crates

  • wp_mac_watch_core
    • ProcessRow, ProcessSnapshot, SnapshotDiff, SystemMetrics
    • Attribution, AttributionKind
    • SearchQuery, GroupMode, SortKey
    • filter_and_sort, build_snapshot, diff_snapshots
  • wp_mac_watch_mac
    • MacCollector – processes + system metrics (CPU, memory, swap)
    • Lightweight launchd plist index for attribution
    • kill_pid, kill_tree, handle_action
  • wp_mac_watch_tui
    • run_tui(rx, tx) – main TUI event loop
    • Mac-ish layout: header, process table, details pane, footer
  • wp_mac_watch_cli
    • CLI entrypoint using clap

Install (run from anywhere)

Uses a symlink so the global command runs the binary from your repo; one build and it’s updated. Requires Rust and ~/.cargo/bin on your PATH (default with rustup).

One-time, from the repo root:

cd /path/to/wp-mac-watch
cargo build --release -p wp-mac-watch
ln -sf "$(pwd)/target/release/wp-mac-watch" ~/.cargo/bin/wp-mac-watch

Then from any directory run wp-mac-watch. To update after changes:

cargo build --release -p wp-mac-watch

Optional — CLI helper (symlink as well):

cargo build --release -p wp_mac_watch_cli
ln -sf "$(pwd)/target/release/wp-mac-watch-cli" ~/.cargo/bin/wp-mac-watch-cli

Update CLI after changes: cargo build --release -p wp_mac_watch_cli.

Running (from repo, without symlink)

From the workspace root:

cargo run -p wp-mac-watch

Key bindings

Key Action
j, Move selection down
k, Move selection up
/ Search: type to filter by name/path (Enter or Esc to finish)
Tab Cycle list: AppsBackgroundAll
s Cycle sort: CPUMemNamePID
f Force quit selected process (SIGKILL) — confirm with y, cancel with n/Esc
t Kill tree: SIGTERM to process + children — confirm with y, cancel with n/Esc
q Quit
  • Force quit (f): shows “Force kill PID xxx (name)? [y]es [N]o/Esc”. Press y to send SIGKILL, n or Esc to cancel.
  • Kill tree (t): same confirmation before sending SIGTERM to the process and its children.

CLI (with symlink above, or from repo):

wp-mac-watch-cli snapshot
wp-mac-watch-cli kill 12345
wp-mac-watch-cli kill-tree 12345 --force

From repo without symlink: cargo run -p wp_mac_watch_cli -- snapshot (and similarly for kill / kill-tree).

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages