When CopyQ Commands Beat Any Shelf
CopyQ is a clipboard manager with a scripting interface. Its command system lets the user write JavaScript-like scripts that run on every copy, transform the clipboard's contents, route copies into named tabs based on the source application, ignore certain formats, and chain transformations across multiple commands. No shelf-style clipboard tool — including Win+V, Edge-Drop, and the OS clipboard itself — offers this level of automation. When the workflow needs the clipboard to do something automatically, CopyQ is the only mainstream tool that does it well. This guide covers the specific use cases where CopyQ's commands beat any shelf, and is honest about the cost: CopyQ is not a shelf, and a shelf is not CopyQ.
For neighbouring topics, see AI coding assistants and the clipboard, clipboard tools on multi-monitor Windows setups, and best clipboard habits for developers in 2026. For the comparison side, see Edge-Drop vs CopyQ: drag shelf vs scriptable clipboard.
What CopyQ commands are
A CopyQ command is a script that runs when the clipboard changes. The script can:
- Inspect the clipboard's contents — read the text, the HTML, the image, the source application.
- Modify the clipboard's contents — replace the text, strip formatting, redact secrets.
- Route the clipboard's contents — move the item to a named tab, ignore it entirely, or copy it to multiple tabs.
- Trigger external actions — run a shell command, write to a file, send a notification.
Commands are written in CopyQ's scripting language, which is JavaScript-like with extensions for clipboard access. The commands are stored in CopyQ's configuration and run automatically on every copy.
A simple example: a command that strips formatting from any copy originating from a web browser.
copyq:
if (copy() && source().startsWith("chrome.exe")) {
var text = str(input())
copy(text)
}
This command checks if the source is Chrome, reads the input as plain text, and replaces the clipboard with the plain-text version. The user's next paste produces plain text, not the rich text the browser would have produced.
Use case 1: auto-redact secrets
The most valuable CopyQ command for developers is auto-redaction of secrets. A command can scan every copied text for token-shaped strings and replace them with placeholders before the text enters history.
copyq:
var text = str(input())
var redacted = text
.replace(/AKIA[0-9A-Z]{16}/g, "AKIA[REDACTED]")
.replace(/sk_live_[0-9a-zA-Z]{24,}/g, "sk_live_[REDACTED]")
.replace(/-----BEGIN [A-Z ]*PRIVATE KEY-----[\s\S]*?-----END [A-Z ]*PRIVATE KEY-----/g, "[REDACTED PRIVATE KEY]")
.replace(/Bearer [A-Za-z0-9\-\._~+\/=]+/g, "Bearer [REDACTED]")
copy(redacted)
This command, on every copy, replaces AWS access keys, Stripe live keys, PEM private key blocks, and Bearer tokens with placeholders. The redacted version is what enters history. The original is on the clipboard for the brief moment between the copy and the command's execution, but it does not persist.
The limitation: the redaction patterns have to be maintained. New secret formats — a new vendor's API key, a new token format — require a new pattern. The command is a living document, updated as the developer encounters new secret types.
For the broader redaction habit, see stack traces, tokens, and the clipboard and how to stop clipboard managers from saving secrets.
Use case 2: route by source application
CopyQ can route copies into named tabs based on the source application. A developer who works across VS Code, the browser, and the terminal can have:
- A
codetab for copies from VS Code. - A
webtab for copies from the browser. - A
terminaltab for copies from Windows Terminal.
The command:
copyq:
var src = source()
if (src.startsWith("Code.exe")) {
copyq("tab", "code", "add", input())
} else if (src.startsWith("chrome.exe")) {
copyq("tab", "web", "add", input())
} else if (src.startsWith("WindowsTerminal.exe")) {
copyq("tab", "terminal", "add", input())
}
Each tab accumulates copies from its source application. The developer can browse the code tab to find a snippet they copied earlier without wading through browser copies. The tabs are independent histories.
A shelf cannot do this. A shelf shows all items in one view; it does not separate by source. Win+V's filter (All / Text / Links / Images / Files) is by format, not by source application.
Use case 3: ignore certain formats
Some applications place formats on the clipboard that the developer does not want in history. Password managers, for example, place a concealed format that should not be captured. Some IDEs place a "private format" that is only meaningful to the IDE.
CopyQ can ignore these formats:
copyq:
if (data("application/x-1password")) {
copy()
abort()
}
This command checks if the clipboard contains 1Password's concealed format. If it does, the command clears the clipboard and aborts, preventing the password from entering history.
Win+V and most shelves have built-in exclusion for password-manager formats, but the exclusion is hardcoded. CopyQ's exclusion is configurable, which means the developer can add exclusions for any application that places a sensitive format on the clipboard.
For more on what sensitive formats monitors should ignore, see what sensitive formats should monitors ignore.
Use case 4: transform formats
CopyQ can transform the clipboard's format on the fly. A common use case: convert a copied HTML table to Markdown.
copyq:
if (data(mimeHtml)) {
var html = str(data(mimeHtml))
var markdown = htmlToMarkdown(html)
copy(markdown)
}
This command, on every copy that includes HTML, converts the HTML to Markdown and replaces the clipboard with the Markdown. The user's next paste produces Markdown, ready for a .md file or a GitHub comment.
The htmlToMarkdown function is not built into CopyQ; it has to be implemented or imported. The point is that CopyQ's command system allows this kind of transformation, where a shelf does not.
Use case 5: chain commands
CopyQ commands can be chained. A copy can run multiple commands in sequence: first redact secrets, then route by source, then transform formats. The chain is configured in CopyQ's command list, with each command running in order.
A developer who wants all of the above — auto-redact, route by source, transform HTML to Markdown — configures three commands and lets them run in sequence on every copy. The result is a clipboard that is automatically cleaned, organised, and transformed, with no manual intervention.
This is the level of automation that no shelf can match. A shelf is a visual tool: it shows what is on the clipboard and lets the user drag it out. CopyQ is an automation tool: it transforms what is on the clipboard before the user sees it.
What CopyQ is not
CopyQ is not a shelf. It does not provide:
- Spatial access. CopyQ lives in the system tray and opens a window on demand. It does not anchor to a screen edge.
- Drag-out. CopyQ's items are pasted, not dragged. Drag-out from CopyQ into Photoshop or Explorer is not the primary interaction.
- Hover activation. CopyQ requires a hotkey or a tray click to open.
A developer who wants spatial access and drag-out should use a shelf. A developer who wants automation should use CopyQ. The two tools solve different problems and can be run side by side, although running two clipboard managers has its own complications — see can you run two clipboard tools at once.
The cost of CopyQ
CopyQ's power comes at a cost: configuration complexity. The command system is not intuitive. Writing a command requires reading CopyQ's scripting documentation, understanding the clipboard's data model, and testing the command against real copies. An afternoon of setup is typical for the first useful command; a week is typical for a full automation suite.
CopyQ is also a native Qt application on Windows, which means it does not have the modern UI polish of an Electron app. The interface is functional but not pretty. The configuration dialogs are dense.
For developers who do not want to configure anything, CopyQ is the wrong tool. Win+V or a shelf is the right tool — they work out of the box, with no configuration. For developers who want to automate the clipboard and are willing to invest in configuration, CopyQ is the only mainstream tool that delivers.
When to choose CopyQ over a shelf
The decision table:
| Need | Right tool |
|---|---|
| Auto-redact secrets on every copy | CopyQ |
| Route copies into tabs by source app | CopyQ |
| Transform HTML to Markdown on copy | CopyQ |
| Ignore certain clipboard formats | CopyQ |
| Spatial access from a screen edge | A shelf |
| Drag-out into Photoshop, Word, Explorer | A shelf |
| No configuration, works out of the box | Win+V or a shelf |
| Visual browsing of recent copies | Win+V or a shelf |
The two columns are not mutually exclusive. A developer who needs both automation and spatial access can run CopyQ for the automation and a shelf for the access, with the understanding that the two tools will interact (each will see the other's writes to the clipboard).
For more on this coexistence pattern, see can you run two clipboard tools at once and clipboard tools on multi-monitor Windows setups.
A short checklist
- Use CopyQ when the clipboard needs to do something automatically (redact, route, transform, ignore).
- Use a shelf when the clipboard needs spatial access or drag-out.
- Write redaction commands for the secret types the developer encounters (AWS keys, Stripe keys, Bearer tokens, PEM blocks).
- Maintain the command list over time; new secret types require new patterns.
- Accept the configuration cost. CopyQ rewards an afternoon of setup with years of automated hygiene.
- Do not expect a shelf to do what CopyQ does. They are different tools.
Related reading
- Best Clipboard Habits for Developers in 2026
- Clipboard Tools on Multi-Monitor Windows Setups
- How to Enable Clipboard History in Windows 11
- Best Clipboard Managers for Windows in 2026
Sources
- CopyQ — GitHub README — official CopyQ repository, including the scripting documentation and command examples
- CopyQ — Documentation — official CopyQ documentation, covering the command system, scripting language, and configuration
- CopyQ — Wiki: Command examples — community-maintained wiki with copy-paste command examples for common automation tasks
- Microsoft Learn — Clipboard formats (Win32) — official reference for the clipboard formats that CopyQ commands inspect and transform
- OWASP — Sensitive data exposure cheat sheet — reference for the secret patterns that a CopyQ redaction command should match
Deepender Yadav is a B.Tech Computer Science Engineering student and software developer interested in building practical software and open-source projects.
GitHub · LinkedInCopy. Stack. Drop.
Transform your clipboard into an interactive edge shelf. Stack, pin, and drag assets into any app with zero friction.
Download for Windows Get from Microsoft Store
How to Install Guide · First 10 Minutes Guide · Drag & Drop Guide · Edge-Drop vs Win+V · Support
Free · Lightweight · Privacy First