Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .bb/plugins.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"name": "charpeni-plugins",
"plugins": [
{ "name": "dependabot", "source": "./plugins/dependabot" },
{ "name": "disk-usage", "source": "./plugins/disk-usage" },
{ "name": "system-monitor", "source": "./plugins/system-monitor" }
]
}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ bb plugin install system-monitor@charpeni
| Plugin | Description |
| ---------------------------------------- | ---------------------------------------------------------------------------------- |
| [Dependabot](plugins/dependabot) | Review GitHub Dependabot alerts by dependency and send grouped fixes to BB agents. |
| [Disk Usage](plugins/disk-usage) | See what's taking up disk space on the bb server host, with drill-down. |
| [System Monitor](plugins/system-monitor) | Live CPU, memory, disk, load, and uptime statistics for the bb server host. |

Each plugin can also be installed directly, without the marketplace:
Expand Down
2 changes: 2 additions & 0 deletions plugins/disk-usage/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dist/
node_modules/
40 changes: 40 additions & 0 deletions plugins/disk-usage/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Disk Usage

See what's taking up disk space on the bb server host, `ncdu`-style: scan a
directory, get its immediate children sorted by recursive size, and drill down
until you find the culprit.

## What it does

- **Disk Usage panel** — a sidebar panel that scans a directory (default: the
server home directory) and lists its children largest-first with share bars,
breadcrumbs, drill-down by click, and a free-form path input. While a scan
runs, a live progress card streams entries visited, bytes so far, and the
directory currently being walked.
- **Per-path cache** — the last result for each path is kept in memory, so
drilling back up (or reopening the panel) is instant; the header shows the
snapshot's age and **Rescan** forces a fresh walk. Concurrent requests for
the same path join a single walk.
- **`bb disk-usage` CLI** — the same scan for agents and scripts:

```sh
bb disk-usage # scan the server home directory
bb disk-usage /var --top 10 # the 10 largest entries under /var
bb disk-usage ~/GitHub --json # machine-readable output
bb disk-usage --refresh # bypass the per-path cache
```

## How sizes are measured

- Sizes are **allocated disk blocks** (`blocks × 512`), not apparent size, so
sparse files are reported by what they actually occupy.
- Symlinks are **never followed** and count as zero bytes.
- Hardlinked files are counted **once** per scan.
- Unreadable entries (permissions, races) are skipped and counted, never fatal.
- Directories are walked concurrently (bounded), and a scan visits at most
500,000 entries; past that it stops descending and the result is flagged as
truncated, with the budget spread across the tree rather than exhausted
depth-first.

The scan runs on the machine hosting the bb server, so paths are server-host
paths — the same model as the System Monitor plugin.
Loading
Loading