Skip to content

shareBin

shareBin/ is a folder of small executables that ship with τ-mux. Its absolute path is prepended to $PATH in every shell τ-mux spawns, so the bundled scripts (show_md, show_img, show_chart, …) are reachable as bare commands from any pane — no install step, no shell-rc edits, no bun run wrapper.

Each script uses the sideband protocol (fd 3/4/5) to render a full-pane HTML/SVG panel pinned to the host pane. When the user closes the panel — or sends SIGINT / SIGTERM — the script exits.

CommandWhat it does
show_md <file.md>Live markdown previewer. Re-renders on mtime change unless --no-watch.
show_img <path>Centered image panel. Preserves aspect ratio; 50 MB cap.
show_html <file>Wrap arbitrary HTML in standard panel chrome.
show_table <csv|tsv>Sortable HTML table. Click headers to sort asc / desc / restore.
show_chart <csv>Line / bar / scatter plot. Re-rendered on every pane resize.
show_json <file>Collapsible JSON tree. --depth N controls default-expanded depth.
show_yaml <file>YAML → tree (subset parser; pipe through yq -o json for complex docs).
show_diff <patch>Side-by-side unified diff with hunk + add / delete counts.
show_gitdiffgit diff of the current repo, side-by-side.
show_gitlog [path]Branch-graph commit log. --max N and --branches.
show_qr <text>QR code SVG. --ec, --scale, --margin, --dark/--light.
show_sysmonFull-pane system monitor — CPU arc, per-core bars, RAM, top procs, sparkline.
show_webcamMJPEG webcam stream via ffmpeg + AVFoundation (macOS) / V4L2 (Linux).
show_logs [file]Live log viewer — level colors, counts, search, bounded buffering. Reads a file once or streams stdin live. (0.3.186)
show_csv_profile <csv|tsv>Data profiling — inferred column types, nulls, distinct counts, top values, numeric summaries, histograms, sample rows. (0.3.186)
show_httpHTTP response inspector — from curl -i output, a saved file, stdin, or a direct --url fetch. Status, headers, redirects, JSON/HTML/text bodies. (0.3.186)
show_mermaid [file.mmd]Mermaid diagram renderer (file or stdin). First version loads Mermaid from a CDN — needs network access. (0.3.186)
show_envEnvironment + project diagnostics dashboard, with conservative secret redaction. (0.3.186)
show_sqlite <db>Read-only SQLite browser — tables, schemas, row counts, previews, optional read-only query. (0.3.186)
show_portsLive dashboard of listening TCP ports and their owning processes. (0.3.186)
show_procLive process tree / resource inspector (ps-based). (0.3.186)
show_image_diff <a> <b>Image comparison for screenshots/design artifacts — split, onion-skin, and diff-heatmap modes. (0.3.186)
show_openapi <spec>Interactive read-only OpenAPI/Swagger explorer (JSON or YAML). (0.3.186)
demo_status_keysExercise every renderer in the smart status-key DSL via ht set-status.

Most accept <path> or stdin (- is implicit when nothing is on argv), so they compose with shell pipes:

Terminal window
ps aux | show_table --tsv
git diff | show_diff
curl -s api.example.com/data.json | show_json --depth 3
echo "https://example.com" | show_qr --ec H
  • src/bun/pty-manager.ts resolves the absolute path to shareBin/ (whether running from a dev checkout or from inside the packaged .app) and prepends it to PATH on every Bun.spawn. The folder is also listed under build.copy in electrobun.config.ts so it ships in the bundle.
  • Every script is a #!/usr/bin/env bun (or python3) executable with no extension — show_md, not show_md.ts. The shebang lets the kernel run them directly via PATH lookup.
  • Scripts import from shareBin/lib/ (rendering helpers — full-screen, chart, csv, markdown, json-tree, qr, git-log, diff-render, table, yaml) and from the bundled clients hyperterm.ts / hyperterm.py. Those clients no-op when not running inside τ-mux, so the same script also runs sanely from a plain terminal.
  • Output is rendered through lib/full-screen.ts, which produces a Catppuccin-styled HTML page and pins it to the host pane. The page re-renders on pane resize, exits cleanly on close, and never affects the underlying PTY.

Drop an executable in shareBin/, mark it +x, and it becomes a first-class command in every τ-mux shell. The full agent-oriented authoring guide — boilerplate, rendering helpers, panel positioning, event handling — lives in doc/system-sharebin.md. Short version:

#!/usr/bin/env bun
// shareBin/show_widget
import { fullScreenHtml, fullScreenPage, CATPPUCCIN } from "./lib/full-screen";
fullScreenHtml({
render: () => fullScreenPage({
tag: { label: "WIDGET", color: CATPPUCCIN.blue },
title: "hello",
body: `<p style="padding:24px">…</p>`,
}),
});
Terminal window
chmod +x shareBin/show_widget
# rebuild / restart τ-mux — `show_widget` is now on $PATH in every pane
  • shareBin/ — the scripts themselves and their lib/ helpers.
  • shareBin/hyperterm.ts / shareBin/hyperterm.py — sideband client libraries.
  • src/bun/pty-manager.ts — PATH prepend at shell-spawn time.
  • electrobun.config.ts — build.copy.shareBin ships the folder in the packaged app.
  • doc/system-sharebin.md — authoring guide for new commands.