bar-tool · 吧台
A macOS menu bar toolbox that turns whatever is on your clipboard into what you need next.
🇺🇸 English · 🇨🇳 简体中文
Copy something messy, click the menu bar, pick a transformation. bar-tool rewrites the clipboard
in place, so the next ⌘V is already the shape you wanted — plain text without the styling,
readable JSON, snake_case, a decoded Base64 blob.
> No account, no window to manage, no network call. The panel shows **what the current clipboard
can become**, never a fixed menu of everything the app can do.
Table of contents
| | | | --- | --- | | What it does | Actions | | Shortcuts | How it works | | Privacy | Project layout | | Build from source | Status | | License | |
What it does
One model, 25 tools: clipboard in → transformation → clipboard out.
- A menu bar panel, not a window. Click the tray icon, pick an action, paste. No dock icon, no
- Only the actions that apply. The list is filtered by what is actually on the clipboard right
- Undo is one keystroke. Every action keeps the previous clipboard, so a wrong pick costs a
- Zero runtime dependencies. Only Electron itself; every transformation is hand-written on top
- Offline by construction. Version 1.1 makes no network requests at all.
Actions
Every action is a pure function; the registry decides what to show for the clipboard at hand.
| Group | Actions | | --- | --- | | Clean up | To plain text · Trim whitespace · Collapse blank lines · Join into one line · Strip line numbers | | Case | UPPERCASE · lowercase · Title Case · camelCase · snake_case · kebab-case · CONSTANT_CASE | | Encoding | Base64 encode/decode · URL encode/decode · HTML escape/unescape | | Data | Beautify JSON · Minify JSON · Sort JSON keys | | Lines | Remove duplicate lines · Sort lines | | Time | Timestamp → local time · Date → timestamp |
Adding a tool means adding one file under electron/actions/ — the panel, the tests and the IPC
surface pick it up automatically.
Shortcuts
| Keys | Action |
| --- | --- |
| ⌥⌘V | Show / hide the panel |
| ↑ ↓ | Move through the actions |
| ↵ | Run the selected action |
| ⌥⌘Z | Undo the last action |
| Esc | Close the panel |
How it works
electron/actions/ One file per group of transformations, pure functions
electron/clipboard.cjs
Clipboard read/write for Electron 44+'s async clipboard API
electron/main.cjs Tray, panel window, shortcuts, IPC
src/ Panel renderer: preview, action grid, bilingual copy
Three rules keep it honest:
- Actions never touch Electron. They take
{ kind, text, html }and return{ text }or
{ error }, which is why the whole set is covered by node:test with no dependency.
- The main process owns the clipboard. The renderer only ever sees a preview and a list.
- Writing back is the end of the flow. No drawers, no side files — the result is on the
Privacy
- The clipboard is read only while the panel is on screen.
- Version 1.1 makes no network request: no telemetry, no crash reporting, no update check.
- Nothing is written to disk yet. Clipboard history (text + images, stored locally) is the next
Project layout
electron/ Main process: tray, panel window, clipboard, IPC surface
electron/actions/ The transformation registry and its groups
src/ Renderer: panel markup, styles, i18n, DOM logic
src/styles/ One dark glass theme, no CSS framework
build/ App icon sources (SVG) and the generated icns
scripts/ afterPack hook that ad-hoc signs the bundle
tests/ node:test suites for the actions
The renderer never touches Node: everything goes through a narrow contextBridge with
contextIsolation and sandbox enabled.
Build from source
npm install
npm run dev # Vite + Electron with hot reload
npm test # 44 unit tests, no dependencies
npm run dist:arm64 # dmg for Apple Silicon, output in release/
npm run dist:x64 # dmg for Intel
Status
1.1.0 is in development: the action framework, all 25 text tools, undo and the bilingual panel are
in place. Next up is clipboard history (text + images), then bucket upload for images, then the
official site.
License
Dual-licensed:
- Open source — AGPL-3.0-only. Free to use, modify and self-host. If you distribute
- Commercial — if AGPL does not fit your product (for example, you want to ship a closed-source
The name "吧台 / bar-tool" and the icon are not covered by the open-source grant.