Paste, once. Run, once.
The cut, demonstrated.
A four-line kubectl | jq snippet on the
clipboard. Trimmy strikes the backslash continuations, drops the newlines,
and rewrites the clipboard in place.
$ kubectl get pods \
-n kube-system \
--selector='app=ingress' \
-o json | jq '.items[].metadata.name'
$ kubectl get pods -n kube-system --selector='app=ingress' -o json | jq '.items[].metadata.name'▍
What it does, exactly.
Six small ideas, executed carefully. Settable per-context, so the eagerness inside Ghostty or iTerm doesn't follow you into Notes.
-
i.
Watches the clipboard, quietly.
A 150 ms timer with an 80 ms grace window so promised pasteboard data lands before Trimmy decides what to do.
-
ii.
Knows when it's a command.
Pipes, redirects, backslash continuations,
$/#prompt gutters — all read as command cues. Markdown headings stay intact. -
iii.
Four levels of aggression.
None, Low, Normal, High. Set per-context: gentler for general apps, eager inside Terminal, iTerm, Ghostty, Warp, kitty, WezTerm.
-
iv.
Paste Trimmed & Paste Original.
Two global hotkeys. The trimmed paste shows the target app and strikes through removed characters in the preview before you commit.
-
v.
Reflows wrapped Markdown.
An optional menu action collapses hard-wrapped paragraphs while preserving fenced code blocks, headings, and intentional blank lines.
-
vi.
Stays on your Mac.
No telemetry, no auth, no network requests except Sparkle's update check. MIT licensed; readable Swift on GitHub.
The menu, in situ.
Trimmy lives left of the system clock. Two clicks, two hotkeys, one toggle. The preview shows the target app and strikes out what you'll lose.
Headless, for scripts.
There's a CLI in the bundle if you'd rather pipe than click. Same trimmer, no UI.
NAME
trimmy — flatten multi-line shell snippets
SYNOPSIS
trimmy --trim <path | -> [--aggressiveness low|normal|high]
[--preserve-blank-lines] [--remove-box-drawing]
[--force] [--json]
EXAMPLES
$ pbpaste | swift run TrimmyCLI --trim - --force
$ swift run TrimmyCLI --trim ~/snippet.sh --json
EXIT 0 success 1 no input / error 2 no transformation 3 json error