Back to browse
GitHub Repository

Fix multi-line shell commands before they hit your terminal

5 starsShell

SmartClip – fix multi-line shell commands before they hit your terminal

by akshaydeshraj·Mar 12, 2026·2 points·0 comments

AI Analysis

●●SolidSolve My ProblemCozy

Fixes malformed paste content that bracketed paste mode doesn't actually solve.

Strengths
  • Hooks paste widget directly — no daemon, no background process, no new keybindings.
  • Validates with bash -n before inserting, passes through unchanged if invalid.
  • ~150 lines of bash with zero dependencies, installable via brew or npm.
Weaknesses
  • Narrow utility — only helps with one specific terminal annoyance.
  • Heuristic detection could miss edge cases or false positives on prose.
Target Audience

Terminal users who copy commands from READMEs and ChatGPT

Similar To

shell-plugin · thefuck

Post Description

I kept copying multi-line commands from ChatGPT/Claude/READMEs and getting `command not found` errors when pasting into my terminal. Bracketed paste mode doesn't help — it prevents line-by-line execution, but the content itself still arrives broken (stray `$` prompts, split continuations, operators across lines).

SmartClip hooks into your shell's paste widget (zsh, bash, fish) and silently fixes multi-line commands before the shell sees them. You paste with Cmd+V as usual — no new keybindings, no daemon, no background process.

It uses score-based heuristics to detect shell commands (so it won't mangle your JSON or prose), joins lines intelligently (backslash continuations, pipes, `&&`), strips prompt characters, and validates everything with `bash -n` before inserting. If it's not confident or the fix has invalid syntax, it passes through unchanged.

~150 lines of bash. Zero dependencies.

`brew install akshaydeshraj/smartclip` or `npm install -g smartclip-cli`

Similar Projects

Developer Tools●●●Banger

Fix

zsh wrapper that auto-corrects typos and runs Claude Code—no shell config changes.

SlickSolve My ProblemShip It
devolt
103mo ago