Trimmy ✂️

August 3, 2026 · View on GitHub

CI Latest release macOS 15+ License Homebrew

Trimmy is a macOS menu-bar app that turns copied multi-line shell snippets into one pasteable command. It watches the clipboard and uses command cues plus configurable sensitivity to avoid rewriting ordinary prose and code.

Trimmy menu showing Paste Trimmed and Paste Original to Ghostty

printf '%s\n' \
  'Trimmy' \
  'is ready'
# clipboard → printf '%s\n' 'Trimmy' 'is ready'

Trimmy rewrites the copy once; your next paste is a single command.

Install

On an Apple silicon Mac running macOS 15 or later:

brew install --cask steipete/tap/trimmy

You can instead download the signed app from GitHub Releases. Sparkle checks for app updates after installation.

Quick start

  1. Open Trimmy. The scissors icon appears in the menu bar.
  2. Copy the three-line printf command above.
  3. Paste into a terminal. Trimmy has changed the clipboard to one line, so the shell runs it once and prints:
Trimmy
is ready

The default sensitivity is Low in general apps and Normal in terminals. Use Paste Original from the menu whenever you need the untouched copy.

Terminal example showing a wrapped command flattened into one line

Choose when Trimmy acts

Trimmy uses separate sensitivity settings for general apps and terminals. It recognizes Terminal, iTerm, Ghostty, Warp, kitty, WezTerm, Hyper, Alacritty, and cmux, and you can exclude specific apps or browser sites from automatic trimming.

LevelBehavior
NoneDisables automatic trimming in general apps.
LowRequires strong cues such as pipes, redirects, or \ continuations.
NormalHandles typical multi-line commands with flags. This is the terminal default.
HighFlattens most command-shaped text. Paste Trimmed always uses this level.

Prompt gutters such as $ and # are removed when they prefix a command, while Markdown headings remain intact. Automatic trimming skips large clipboard blobs as a safety valve.

Paste actions and permissions

Paste Trimmed and Paste Original can be assigned global shortcuts. Their menu previews name the target app and show what trimming removed before sending a paste keystroke.

These paste actions need macOS Accessibility permission. Trimmy prompts for it when necessary and links to System Settings → Privacy & Security → Accessibility. Automatic clipboard rewriting still works without simulated paste access.

Other cleanup actions

The menu can reflow hard-wrapped Markdown while preserving headings, lists, blank lines, and fenced code. A separate action removes URL query parameters while retaining configured identity parameters such as YouTube video IDs, GitHub tabs, and Figma node IDs.

Box-drawing gutters such as and can also be removed from copied terminal output without stripping real shell pipes.

Markdown reformatting example

Headless CLI

TrimmyCLI uses the same trimming engine without the menu-bar app. Run it from the source checkout:

printf '%s\n' 'echo hello \' '  world' | swift run TrimmyCLI --trim --force

The result is echo hello world. The packaged app can install trimmy from Settings → Advanced, and Linux binaries are attached to GitHub Releases.

See the CLI reference for file input, JSON output, all options, and exit codes.

How it works

  • A roughly 150 ms timer watches for pasteboard ownership changes, followed by an 80 ms grace period for promised clipboard data.
  • Clipboard writes carry a com.steipete.trimmy marker so Trimmy does not process its own output.
  • Clipboard content stays local. Trimmy has no telemetry or account system; its network use is Sparkle's update check.

The technical specification covers the detection heuristics, settings, and pasteboard behavior in more detail.

Development

Trimmy requires Swift 6.2 and macOS 15 or later.

swift build
swift test
pnpm check
./Scripts/package_app.sh debug
  • trimmy.app is the project website.
  • Alfred Trimmy is a community Alfred workflow.
  • CodexBar keeps Codex token windows visible in the menu bar.
  • MCPorter is a TypeScript toolkit and CLI for Model Context Protocol servers.
  • Oracle is a multi-model prompt bundler and CLI.

License

MIT — built by Peter Steinberger in Vienna, with help from a small pair of scissors.