sgharms/mclip

A vibe-coded, multi-copy clipboard application that does not leverage X11, Wayland, or any window manager

★ 0Forks 0CGitHub ↗Compare

README

mclip

A terminal-native multiple clipboard. No X11, no Wayland, no GUI — just a fast CLI for storing, browsing, and recalling clipboard history in your terminal.

Install

Dependencies (install via your package manager):

  • pcre2
  • ncurses

macOS (Homebrew):

brew install pcre2 ncurses
make

Linux:

apt install libpcre2-dev libncurses-dev   # Debian/Ubuntu
dnf install pcre2-devel ncurses-devel     # Fedora/RHEL
make

The binary lands at bin/mclip. Copy it anywhere on your $PATH.

Storage

Clips are stored as JSONL (one JSON object per line) at:

  1. $MCLIP_PERSISTENCE_LOCATION if set, or
  2. $HOME/.mclip.jsonl by default

Usage

Save a clip — pipe anything into mclip:

cat file.txt | mclip
echo "some text" | mclip
git diff | mclip

List all clips:

mclip -l

When stdout is a terminal, output includes an index prefix for readability. When piped or redirected, raw content is emitted — suitable for scripting:

mclip -l foo > saved.txt
mclip -l token | pbcopy

Filter clips by regex:

mclip -l pattern
mclip -l TODO
mclip -l 2026-09

Interactive browser:

mclip -i
Key Action
↑ / k Move up
↓ / j Move down
Enter Copy selected clip to clipboard
Backspace Delete selected clip
q / Esc Quit

Clipboard copy uses OSC 52 — works in Ghostty, kitty, iTerm2, alacritty, and tmux (≥ 3.2 with set-clipboard on). On macOS, pbcopy is also invoked as a fallback so the system pasteboard is always set.

Tests

make
bash test/run_tests.sh

Contributors

sgharms

Issues