Unbreak — Reparador de Comandos Shell do Clipboard
bart-turczynski/unbreak
Repara comandos shell envolvidos de agents grid-renderer antes de colar
Ver no GitHubAgent Swift que conserta comandos shell copiados de CLIs com grid-renderer (Claude Code, Gemini CLI, Codex CLI), removendo quebras de linha forçadas e espaçamento que corrompem a sintaxe. Funciona como daemon sempre-ativo no macOS, reparando automaticamente ao copiar ou via CLI one-shot.
Instalação
npx convez-ai bart-turczynski/unbreak1 comando no terminal: detecta o formato do repositório (marketplace ou plugin avulso) e instala via Claude Code. Requer Node 18+ e o Claude Code instalado.
Métricas
Casos de uso
- Copiar comandos shell de Claude Code e Gemini CLI sem garbling de quebras
- Daemon automático que conserta clipboard em tempo real no macOS
- Reparação one-shot de fragments via CLI quando watcher não é necessário
Veredito

Solução cirúrgica e bem-engineered para problema real de UX em workflows com agentes. Implementação em Swift com CLI polish, testes sólidos e instalação via Homebrew—bom fit para desenvolvedores macOS que usam agentes iterativamente.
README
A tradução para o português deste README ainda está na fila.
unbreak
Repairs terminal-wrapped clipboard commands from grid-renderer agent CLIs (Claude Code, Gemini CLI, Codex CLI) so they paste as clean, runnable shell commands. macOS only.
See docs/PRDv2.md for the full product spec; docs/PRD.md
is the prior draft. Earlier prototypes live in archive/.
Why
TUI agents render through a fixed character grid and insert real newlines plus a left-margin gutter into long lines. Copying a wrapped shell command carries hard breaks and leading spaces, so pasting garbles or prematurely runs it. This tool repairs exactly the copied fragment. (Background: PRD v2 §1.)
Quick start (teams)
Have the Xcode Command Line Tools installed first (xcode-select --install) —
the formula builds from source, so without them the install fails. Then:
brew install bart-turczynski/tap/unbreak # puts the CLI on PATH
unbreak setup # detect your terminals, write config, enable the watcher
brew install alone does not start the always-on behavior — it only installs
the CLI. unbreak setup is the step that detects which terminals you use, writes
the allowlist config, and offers to turn on the login watcher. If Homebrew warns
about an untrusted tap, run brew tap bart-turczynski/tap first.
Just want a one-shot repair without any background watcher? That works straight
after brew install, no setup needed:
pbpaste | unbreak - # repair clipboard text, print to stdout
Install
Primary path is a Homebrew tap (builds from source — needs the Xcode Command Line
Tools). The tap lives at bart-turczynski/homebrew-tap (§9).
brew install bart-turczynski/tap/unbreak
brew install only puts the unbreak CLI on your PATH. The clipboard watcher is
off until you opt in — enable it at login with brew services start unbreak, or
run the guided unbreak setup.
No Homebrew? Use the fallback installer (builds from source the same way):
curl -fsSL https://raw.githubusercontent.com/bart-turczynski/unbreak/main/install.sh | bash
See docs/RELEASING.md for the tap setup and release flow.
Uninstall
unbreak uninstall tears down everything unbreak writes to your machine — the login
watcher, logs, the undo socket, and the config file (pass --keep-config to keep
the latter). It then prints how to remove the binary itself:
unbreak uninstall # remove all unbreak state
unbreak uninstall --keep-config # …but leave the config in place
To also remove the binary, follow the printed instruction for your install
method — brew uninstall unbreak for the Homebrew tap, or for the curl install:
curl -fsSL https://raw.githubusercontent.com/bart-turczynski/unbreak/main/uninstall.sh | bash
(The curl uninstaller runs unbreak uninstall for you and then deletes the binary.)
Layout
Sources/UnbreakCore pure, deterministic repair pipeline (PRD v2 §6)
Sources/unbreak thin CLI shell (PRD v2 §8.1)
Sources/Watch opt-in fix-on-copy daemon + gates (PRD v2 §7)
Sources/Setup setup wizard + per-user LaunchAgent (PRD v2 §8.2)
Tests/ swift-testing unit + property + corpus tests (§6.8, §13)
Formula/unbreak.rb Homebrew formula (PRD v2 §9)
install.sh curl|bash fallback installer (PRD v2 §9)
uninstall.sh curl|bash uninstaller — state teardown + binary (PRD v2 §9)
docs/ PRDs + release flow
archive/ reference Python implementation + original plist/README
Develop
Requires the Swift toolchain (Xcode Command Line Tools).
make build # swift build
make test # swift test (+ swift-testing framework paths)
make fmt # format in place (needs swift-format)
make lint # static analysis (needs swiftlint)
Use
make test, not bareswift test: on the standalone Command Line Tools (no full Xcode) the swift-testing framework needs its search/runtime paths passed explicitly, which the Makefile derives fromxcode-select -p.
Optional tools:
brew install swift-format swiftlint
Try it
pbpaste | swift run unbreak - # repair clipboard text, print to stdout
swift run unbreak --help
Status
Feature-complete for v1. The repair pipeline (normalize, de-gutter, wrap-rejoin, heredoc protection, opt-in merge-split — §6.1–6.5, §6.8), the six-gate watch-mode daemon with in-memory undo (§7), the CLI (§8.1), config + env overrides (§8.3), the setup wizard / LaunchAgent (§8.2), and distribution (§9) are all in place. The §13 fixture corpus enforces zero watch-mode mutations on normal copies.
Deferred to v2 (§12): Gemini CLI / Codex CLI wrap profiles (§6.6), bottles, and a homebrew-core submission.