Table of Contents

Command line for scripts and AI agents

bclip lets terminals, scripts and AI coding agents (Claude Code, Codex, Copilot CLI, …) work with your history: list, search and grep it, read any item exactly as it was copied, put something back on the clipboard, or wait for your next copy. It ships next to the app and asks the running BetterClipboard — it never opens the encrypted history itself — and starts BetterClipboard in the background if needed.

Important

It is off by default. Turn it on in Settings › Command line (bclip) and click Add bclip to PATH (or install with -AddToPath). While it is on, any program running as you can read your clipboard history through it — the same trust you already give those programs with your files. Other Windows accounts and the network cannot connect, and each command is logged by name only, never with content.

Command What it does
bclip list [-n 20] [-f FILTER] [-s 2h] Recent items: id (* = pinned), kind, age, source app, first line. FILTER is pinned, text, images, links or files (copied paths included, as kind path), or a tab: sharex, snipping, notepad++, run, pwsh, cmd, claude, codex, everything
bclip search <words…> Items containing all the words (substring, any language)
bclip grep [-i] <regex> Matching lines as id:line: text, like grep -n
bclip get [ID \| -r N] [--format text\|html\|rtf\|files\|png] [-o FILE] An item's content, byte for byte (default: the latest); images need -o file.png
bclip copy [ID] [--plain] Put an item back on the clipboard, like picking it in the panel
bclip put <text> or … \| bclip put Copy text (or standard input) to the clipboard and the history
bclip pin [ID] · unpin [ID] · delete ID Keep an item forever, release it, or delete it
bclip forget ID Forget forever: delete the item and never record its content again (undo only in Settings)
bclip wait [-t 60] Block until you copy something, then print it
bclip prompts [words…] [-a claude\|codex] [--all] Your archived Claude Code and Codex prompts, newest first, one row per text (--all: one row per send); words search them
bclip prompt ID [-o FILE] One archived prompt, exactly as you sent it
bclip status Version, item counts, archived prompts, capture statistics

With the pwsh, cmd, claude, codex and everything filters, bclip list shows what you pasted, copied or kept from those tabs. The prompts themselves are in bclip prompts.

Add --json to any command for structured output (ids, kinds, times, source app, formats, grep matches, and a picture's file: path, name, format, size and dates). Exit codes: 0 ok · 1 nothing found or timed out · 2 bad usage · 3 BetterClipboard unreachable or the command line is off · 4 other error. bclip help <command> shows every option. bclip always answers in English, whatever the app's or Windows' language: scripts and agents rely on its output.

bclip get                                 # what did I just copy?
bclip grep -i "exception|error" -s 1h     # errors copied in the last hour, as id:line: text
bclip search invoice --json               # structured results for an agent
bclip get 42 -o shot.png                  # an image, as a PNG file an agent can open
bclip wait -t 120                         # "copy the stack trace and I'll read it"
git diff | bclip put                      # hand text back to you on the clipboard
bclip list -f run -n 5                    # the last five Win+R commands
bclip prompts migration -a claude         # what did I ask Claude Code about the migration?

In this section