Skip to content
badhopePublic

About

Workbench - a local-first desktop workbench (Tauri 2 + React 19): live process / port / dev-server visibility + AI session token cost metering. All data stays on-device. MIT licensed.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

47 stars

Watchers

0 watching

Forks

Latest commit

ย 

History

17 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Workbench

English | ็ฎ€ไฝ“ไธญๆ–‡ | ๆ—ฅๆœฌ่ชž

Tauri 2 desktop app ยท Local system dashboard ยท AI session cost metering

CI Release License Platform Tauri React

A local-first, privacy-preserving desktop workbench for your machine: processes, ports, dev servers, and AI coding-session token costs โ€” all visible in one place. All data stays on your device. Dark & light themes. UI available in English, ็ฎ€ไฝ“ไธญๆ–‡ and ๆ—ฅๆœฌ่ชž.

Windows-only for now: port collection uses netstat -ano and packaging targets NSIS. macOS / Linux are untested and not yet packaged.

๐ŸŒ Project homepage โ€” every mirror hosts its own copy of the landing page (see the mirror table below); each copy automatically links back to its own repository and releases.


Download

No dev environment needed (Windows 10 / 11 x64). Each GitHub mirror below publishes its own Release with the same installer โ€” pick the platform you prefer:

Channel File Notes
Recommended Workbench_<version>_x64-setup.exe (Releases โ†’ latest) NSIS installer, ~4 MB
Portable workbench.exe (Releases โ†’ latest) Single file, no registry writes

The installer is not code-signed, so Windows SmartScreen may show an "Unknown publisher" warning โ€” choose More info โ†’ Run anyway. This is because signing certificates cost money, not because the file is unsafe.

Mirrors

Identical code, five platforms; each runs its own CI and publishes its own releases where supported:

Platform Repository Landing page
GitHub X33834/workbench x33834.github.io/workbench
GitHub badhope/workbench badhope.github.io/workbench
GitHub Morningstar202604/workbench morningstar202604.github.io/workbench
Gitee badhope/workbench โ€” (downloads on its Releases page)
GitCode badhope/workbench โ€” (downloads on its Releases page)

Screenshots

Captured in browser demo mode (npm run preview): outside Tauri the app injects static demo data from src/lib/demo.ts; all paths and host names are placeholders, no real machine data.

Overview Processes
Overview Processes
CPU / memory trends, disks, process groups Full snapshot, virtual scrolling, kill confirmation
Servers & ports AI sessions & cost
Servers AI sessions
netstat parsing, dev-framework tags Session preview, token metering, budgets
Projects Tasks
Projects Tasks
Local projects, Git branch detection Drag-and-drop kanban
Settings Logs
Settings Logs
Theme, refresh interval, budgets, import/export Built-in log viewer, tail reading

Regenerate screenshots yourself: npm run build, then npm run preview, then run a headless Chrome with --remote-debugging-port=9222, then node scripts/shoot_docs.mjs. The script asserts demo mode is active and refuses to shoot otherwise, so real data can never leak into the repo.

Features

Module What it does
๐Ÿ–ฅ Overview CPU / memory trend charts, disk usage donut, process group stats
โš™ Processes Full snapshot, CPU / memory sorting, virtual scrolling (viewport-only rows), kill with confirmation, AI agent detection
๐ŸŒ Servers & ports netstat listener detection, dev-framework tags (Vite / Next / Djangoโ€ฆ)
๐Ÿค– AI sessions opencode online sessions, local Claude / Codex session preview
๐Ÿ’ฐ Cost metering Token usage, daily trends, budget alerts, Anthropic cache pricing
๐Ÿ“ Projects Local project registry, automatic Git branch detection
โœ… Tasks Kanban board (drag to change status)
โš™ Settings Theme / refresh interval, budget thresholds, JSON import & export
๐Ÿ“‹ Logs Built-in viewer, auto refresh, tail reading

Cost metering

  • Three-level confidence: measured (API-reported usage) โ†’ estimated (character heuristic) โ†’ zero_pricing
  • 40+ model prices built in; pricing_overrides.json overrides are currently read-only (drop the file in manually, no UI editor yet)
  • Anthropic cache semantics: input_tokens excludes cache; cache_read_input_tokens billed at 0.1ร—, cache_creation_input_tokens at 1.25ร—
  • Day attribution: measured and estimated rows are bucketed per JSONL-line timestamp (falls back to the previous day / file mtime when missing), so appending to a session never rewrites historical days
  • Unknown models are never priced: unrecognized models are flagged unknown and recorded as zero_pricing โ€” no invented unit prices
  • Idempotent: each session file keeps only its latest snapshot (replaced whole-group by file_path), so re-scans never stack stale rows
  • Estimates can be disabled: the "include estimated rows" toggle live-updates overview / trend / model breakdowns
  • Budget alerts: system notifications, de-duplicated to avoid nagging
  • Scan scope: the cost scan covers every session file under ~/.claude/projects and ~/.codex/sessions (the UI preview shows the 10 most recent)

Desktop behavior

  • Closing the window hides to tray; tray left-click toggles visibility, the tray menu really exits the process
  • Global hotkey Ctrl+Shift+W toggles window visibility (degrades to a warning if the hotkey is taken; startup is never blocked)
  • Logs roll per launch (> 5 MB archives to workbench.log.1), the Logs page reads on demand from the tail
  • Killing PID 0/4 and critical system processes (csrss / lsass / services โ€ฆ) is rejected outright

Getting started

System requirements

Item Requirement
OS Windows 10 / 11 (x64) โ€” the only verified platform
Runtime WebView2 Runtime (preinstalled on Windows 11; recent Windows 10 usually has it)
Disk ~35 MB installed; portable single file ~15 MB
Privileges No admin required; killing a process needs same-or-higher privileges
Network None required. The only optional probe is the local opencode service when you open the AI sessions page

Install from Releases (recommended)

  1. Grab Workbench_<version>_x64-setup.exe from the latest release
  2. If SmartScreen appears: More info โ†’ Run anyway
  3. Launch "Workbench" from the Start menu

Build from source

Requires Node.js โ‰ฅ 20, Rust โ‰ฅ 1.77, WebView2.

npm install

IPC contract types

Types crossing the IPC boundary are not hand-written in src/types.ts; they are generated from the Rust structs:

cd src-tauri
cargo test --test export_bindings   # regenerates src/generated/*.ts

src/types.ts only re-exports; src/generated/ is the committed contract snapshot. After changing a Rust struct you must re-run the command above, otherwise the CI drift gate will reject the PR.

Development

npm run tauri dev      # desktop dev mode (hot reload)
npm run dev            # frontend only, browser demo mode, no Rust needed

Production build

npm run tauri build

Artifacts land in src-tauri/target/release/bundle/.

Tech stack

Layer Choice
Runtime Tauri 2 (Rust + OS webview)
Frontend React 19 + TypeScript (strict) + Vite 8
State Zustand 5 (persist)
Styling Tailwind CSS 4 + dual-theme CSS variables
Charts ECharts 6 (tree-shaken, dark/light themes registered)
Virtualization @tanstack/react-virtual 3 (variable-height expanded rows)
Subscriptions Zustand 5 useShallow selectors + memo page components
IPC Tauri IPC + spawn_blocking
Contracts ts-rs 12 generates src/generated/*.ts from Rust structs, CI drift-gated
Process data sysinfo
Ports netstat parser (POSIX / Windows dialects)
i18n English default, switchable ็ฎ€ไฝ“ไธญๆ–‡ / ๆ—ฅๆœฌ่ชž
Quality gates ESLint 10 + Prettier 3 + vitest 5 + clippy -D warnings

Project structure

workbench/
โ”œโ”€โ”€ src/                    # frontend
โ”‚   โ”œโ”€โ”€ pages/              # 8 feature pages (lazy loaded)
โ”‚   โ”œโ”€โ”€ lib/                # store / api / echarts / chartTheme / i18n / util
โ”‚   โ”œโ”€โ”€ generated/          # ts-rs generated IPC contract types (do not edit)
โ”‚   โ”œโ”€โ”€ ui.tsx              # shared component library
โ”‚   โ”œโ”€โ”€ types.ts            # type re-exports + frontend-only types
โ”‚   โ”œโ”€โ”€ App.tsx             # app shell
โ”‚   โ””โ”€โ”€ styles/global.css   # global styles & theme variables
โ”œโ”€โ”€ src-tauri/              # Rust backend
โ”‚   โ”œโ”€โ”€ capabilities/       # Tauri permission set (minimal)
โ”‚   โ”œโ”€โ”€ icons/              # app icons (generated by scripts/make_icons.py)
โ”‚   โ”œโ”€โ”€ src/
โ”‚   โ”‚   โ”œโ”€โ”€ commands.rs     # IPC command layer
โ”‚   โ”‚   โ”œโ”€โ”€ procs.rs        # process snapshot + kill
โ”‚   โ”‚   โ”œโ”€โ”€ ports.rs        # netstat parsing
โ”‚   โ”‚   โ”œโ”€โ”€ devserver.rs    # dev-framework detection
โ”‚   โ”‚   โ”œโ”€โ”€ ai.rs           # AI session fetching
โ”‚   โ”‚   โ”œโ”€โ”€ pricing.rs      # model price matching
โ”‚   โ”‚   โ”œโ”€โ”€ session_meter.rs# JSONL token cost parsing
โ”‚   โ”‚   โ”œโ”€โ”€ cost_store.rs   # cost data persistence
โ”‚   โ”‚   โ”œโ”€โ”€ ipc_guard.rs    # IPC argument whitelist
โ”‚   โ”‚   โ””โ”€โ”€ lib.rs          # Tauri bootstrap
โ”‚   โ””โ”€โ”€ tests/              # IPC contract export test
โ”œโ”€โ”€ docs/                   # GitHub Pages landing page + screenshots
โ”œโ”€โ”€ scripts/                # icon & screenshot helper scripts
โ””โ”€โ”€ .github/workflows/      # CI / Release / Pages

Development & quality

npm run format:check       # Prettier
npm run lint               # ESLint (zero warnings)
npm run test               # frontend unit tests (vitest, 48 cases)
npm run coverage           # coverage
npm run build              # tsc + vite build

cd src-tauri
cargo test                 # backend tests + IPC contract export
cargo clippy --all-targets -- -D warnings   # zero-warning gate

Pure Rust logic (netstat parsing, framework detection, price matching, token extraction, JSON storage, IPC guard) carries #[cfg(test)] unit tests; the frontend is covered by vitest (util / store / shared components / error boundary). CI runs formatting, lint, type check, build, both test suites, clippy with zero warnings, and verifies src/generated/ matches the Rust structs.

FAQ

How is the cost metering computed? Is it accurate?

It parses the usage fields in local Claude Code / Codex session JSONL files and prices them against 40+ built-in model prices, with three confidence levels:

  • measured โ€” real usage reported by the API, most accurate
  • estimated โ€” no usage, heuristic by character count (can be disabled)
  • zero_pricing โ€” model unrecognized, recorded as free rather than priced with a made-up unit price

Anthropic cache tokens follow the official semantics (read 0.1ร—, write 1.25ร—).

Does it upload my data anywhere?

No. Projects, tasks, the cost ledger and logs all live in the local app data directory. The app only does two local things: read netstat for ports, and read local session files for costs. The only optional network call is probing the local opencode service (default port 4096); on failure it just shows "not detected".

Can killing a process break my system?

No. PID 0/4 and critical system processes (csrss, lsass, servicesโ€ฆ) are rejected by the backend; the frontend asks for confirmation first; and the target identity is re-verified after refresh to avoid PID-reuse mistakes.

Where did the window go after I closed it? How do I quit?

Hiding to the tray is intentional (the app is meant to keep monitoring). Right click the tray icon and choose "Quit"; the hotkey Ctrl+Shift+W toggles visibility anytime.

Windows says "Unknown publisher" โ€” what do I do?

The installer is not code-signed (certificates cost money), so SmartScreen steps in. Choose More info โ†’ Run anyway, or grab the portable exe instead.

Roadmap

Done and planned. Vote or propose new ideas in the Issues.

  • Real-time process / port / dev-server monitoring
  • AI session cost metering with budget alerts
  • Projects & task kanban
  • Dark / light themes, log viewer
  • Multilingual UI (English / ็ฎ€ไฝ“ไธญๆ–‡ / ๆ—ฅๆœฌ่ชž)
  • Cross-platform support (macOS / Linux collection & packaging)
  • Installer code signing
  • UI editor for pricing_overrides.json
  • Sharded cost ledger (100k+ records)
  • Page-level end-to-end tests

Known limitations

  • Windows-only verified: port collection shells out to cmd /c netstat -ano; the POSIX branch in ports.rs is currently never exercised
  • Frontend interaction paths rely on manual verification: vitest covers util / store / shared components / error boundary, but the 8 pages have no E2E tests
  • The cost ledger is a single cost_data.json (writes are serialized); very large histories will make full read/write sluggish
  • pricing_overrides.json is read-only by design for now, no write path
  • The installer is unsigned; first launch may trigger a SmartScreen prompt
  • The tray menu text is currently Chinese only (frontend UI is fully trilingual)

Data storage

File Purpose Location
data.json Projects & tasks app data dir
cost_data.json Cost records + pricing settings app data dir
pricing_overrides.json User price overrides (read-only, drop in manually) app data dir
workbench.log Runtime logs app data dir
*.corrupt-<timestamp> Untouched backup of a data file that failed to parse (never overwritten by the next save) app data dir

On Windows the app data dir is %APPDATA%\com.workbench.desktop.

Contributing

License

MIT ยฉ 2026 x1882

About

Workbench - a local-first desktop workbench (Tauri 2 + React 19): live process / port / dev-server visibility + AI session token cost metering. All data stays on-device. MIT licensed.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

47 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages