# monitr
`monitr` is a lightweight macOS activity monitor for the terminal. It is built in Rust with Ratatui and focuses on a fast process table, low overhead sampling, and an Activity Monitor-style layout.
## Features
- CPU, Memory, Energy, Disk, and Network views
- Sortable process table with fast keyboard navigation
- Process filter by PID, name, user, command, or status
- Inspector panel for the selected process
- Disk and Network tabs include system-level volume/interface totals in the inspector
- CPU, memory, virtual memory, runtime, status, user, parent PID, command, executable, and current working directory
- Disk read/write rates and totals
- macOS thread count for the selected process
- Open file counts where the OS exposes them
- Confirmed TERM and KILL actions
- Small native release binary
## Install
Install from crates.io:
```bash
cargo install monitr
```
Build from source:
```bash
cargo install --path .
```
Or install into `~/.local/bin` from this checkout:
```bash
make install-local
```
## Usage
```bash
monitr
```
Start with a custom refresh interval:
```bash
monitr --interval 750
```
Refresh intervals must be between `250` and `10000` milliseconds.
Start with a filter:
```bash
monitr --filter codex
```
## Controls
| `1`-`5`, `Tab` | Switch views |
| `j`/`k`, arrows | Move selection |
| `PageUp`/`PageDown`, `Home`/`End` | Jump in the process table |
| `/` | Filter processes |
| `Ctrl-U` | Clear the active filter from anywhere |
| `s` | Cycle sort key |
| `S` | Reverse sort direction |
| `c`, `m`, `e`, `d`, `D`, `n`, `p`, `T`, `u` | Sort by CPU, memory, energy impact, disk write, disk read, name, PID, runtime, user |
| `i`, `Enter` | Toggle inspector |
| `t` | Send TERM after confirmation |
| `f` | Send KILL after confirmation |
| `+` | Slow the refresh interval |
| `-` | Speed up the refresh interval |
| `r` | Refresh now |
| `?` | Help |
| `q`, `Esc`, `Ctrl-C` | Quit |
## Scope
`monitr` is intended to be a faster, lighter terminal alternative to Activity Monitor for common process and system inspection. It does not use Apple's private Activity Monitor internals, so some values are approximations or interface-level summaries:
- Energy impact is a lightweight estimate based on CPU, memory share, I/O, and run state.
- Disk and Network tabs keep a process table for context, while the inspector shows system-level volumes or interfaces.
- Network data is interface-level, not per-process.
- Some process details depend on macOS permissions and may show `-` for protected processes.
## Development
`monitr` uses Rust 2024 and requires Rust 1.88 or newer.
```bash
make check
```
This runs formatting, clippy, unit tests, and a release build.