Skip to content
Djain912Public

About

Copy buttons after every terminal command: copy the command, its output, or both in one click. PowerShell, bash, zsh, fish; VS Code extension.

Topics

Resources

Contributing

Security policy

Stars

3 stars

Watchers

0 watching

Forks

Repository files navigation

clipcmd

clipcmd

Clipcmd clipcmd - Copy past made easier from terminals | Product Hunt

Copy buttons after every terminal command: the command, its output, or both — in one click.

CI npm VS Code Marketplace Website MIT

clipcmd in 25 seconds: copying a failed build into an AI agent by hand, then one Ctrl+click on [COPY BOTH] and a complete paste
▶ Download the 25-second video with sound (MP4, 6.5 MB)

Step 1: install the clipcmd npm package   Step 2: install the clipcmd VS Code extension

Important

clipcmd comes in two parts — install both:

  1. The clipcmd package from npm — the command, the background daemon and the shell hooks. It puts the buttons under every command, in every terminal: npm install -g clipcmd, then clipcmd init.
  2. The clipcmd extension for VS Code — makes [COPY OUTPUT] and [COPY BOTH] work in VS Code's terminal (without it, VS Code only shows [COPY CMD] and [+]): install from the Marketplace, or search clipcmd in the Extensions view.

Every developer has copied a command and its output into an issue, a chat or a doc by dragging the mouse over the terminal. clipcmd puts clickable buttons under every command instead:

  • [COPY CMD] — the command line
  • [COPY OUTPUT] — what it printed, as clean plain text (no colors, progress bars at their final state, wrapped lines joined)
  • [COPY BOTH] — $ command and its output, ready to paste
  • [+] — collect several commands and their output into one clipboard entry

Works in PowerShell (5.1 and 7), bash (including Git Bash), zsh and fish on Windows, macOS and Linux — in Windows Terminal, VS Code, iTerm2, GNOME Terminal, WezTerm, kitty and any other terminal with clickable links.

Quick start

You need Node.js 20 or newer (node -v tells you which one you have).

Part What it does Install
npm package clipcmd The buttons, in every terminal npm install -g clipcmd, then clipcmd init
VS Code extension djain912.clipcmd [COPY OUTPUT] and [COPY BOTH] in VS Code's terminal Marketplace, or code --install-extension djain912.clipcmd
  1. Install the npm package:

    npm install -g clipcmd
    
  2. Set it up for your shell (run this in the shell you use; once per shell):

    clipcmd init
  3. Install the VS Code extension — any one of:

    • open the clipcmd page on the Marketplace and click Install;

    • in VS Code, open the Extensions view (Ctrl+Shift+X, Cmd+Shift+X on macOS), search clipcmd, and click Install;

    • or run:

      code --install-extension djain912.clipcmd
  4. Open a new terminal window or tab.

  5. Run any command, for example git status. The buttons appear under its output.

  6. Hold Ctrl (Cmd on macOS) and click a button. A small ✓ Copied confirmation appears; paste anywhere.

Something not working? Run clipcmd doctor: it checks everything and says how to fix it.

Learn more

How it works

A small background program (the daemon) listens on 127.0.0.1. A hook in your shell's startup file tells it about each command and prints the buttons when the command finishes. The buttons are links: a Ctrl+click opens a tiny handler registered for your user account, which asks the daemon to copy — no browser, no window — and a "✓ Copied" confirmation appears (a tag next to the pointer on Windows). To know what a command printed, interactive terminals run inside a recorder (clipcmd shell, automatic); in VS Code, the extension reads the output from VS Code's shell integration instead. Nothing leaves your machine.

Details: cli/README.md.

This repository

Directory What Published as
cli/ The clipcmd command, background daemon and shell hooks — full documentation clipcmd on npm
vscode-extension/ Output capture and daemon controls for VS Code's terminal djain912.clipcmd on the VS Code Marketplace
docs/ The website, the launch video and the images in the READMEs djain912.github.io/clipcmd (GitHub Pages)

Contributing

Bug reports and pull requests are welcome — see CONTRIBUTING.md. Security issues: SECURITY.md. Releases: RELEASING.md.

License

MIT © Djain912

About

Copy buttons after every terminal command: copy the command, its output, or both in one click. PowerShell, bash, zsh, fish; VS Code extension.

Topics

Resources

Contributing

Security policy

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages