Free & open source · PowerShell · bash · zsh · fish

clipcmd Copy terminal output in one click.

clipcmd puts copy buttons under every command you run. Ctrl+click [COPY BOTH] and paste the exact command and its full output into your AI agent, an issue or a chat. No selecting, no scrolling, no missed lines.

$ npm install -g clipcmd

Then run clipcmd init and open a new terminal. Using VS Code? Also install the extension.

In your own terminal you hold Ctrl (Cmd on macOS) while you click.

Debugging with an AI agent shouldn't start with a copy-paste dance.

Without clipcmd

  1. Drag-select the error
  2. Scroll, lose the selection
  3. Select again
  4. Copy, paste
  5. …and the agent still misses a line

With clipcmd

  1. Ctrl+click [COPY BOTH]
  2. Paste

The agent gets $ command and the complete output, exactly as the terminal showed it.

The whole idea in 25 seconds.

From a failed build to a complete paste in your AI agent's prompt.

Two parts. Install both.

You need Node.js 20 or newer (node -v tells you). The npm package works in every terminal; the extension adds output capture in VS Code's terminal.

Step 1

The npm package clipcmd

The command, the background daemon and the shell hooks. It puts the buttons under every command, in every terminal.

$ npm install -g clipcmd
$ clipcmd init

Run clipcmd init in each shell you use. It detects the shell; name it to choose: bash, zsh, fish, powershell or pwsh.

clipcmd on npm
Step 2

The VS Code extension

Makes [COPY OUTPUT] and [COPY BOTH] work in VS Code's terminal. Without it, VS Code only shows [COPY CMD] and [+].

$ code --install-extension djain912.clipcmd

Or open the Extensions view (Ctrl+Shift+X), search clipcmd and click Install.

Open the Marketplace
  1. Open a new terminal window or tab. The daemon starts by itself.
  2. Run any command, for example git status. The buttons appear under it.
  3. Hold Ctrl (Cmd on macOS) and click a button. A small ✓ Copied confirmation appears; paste anywhere.

Something not working? clipcmd doctor checks the whole setup and says how to fix it.

Four buttons. Exactly what you need.

[COPY CMD]

The command line

npm run build
[COPY OUTPUT]

The output, as clean text

Found 1 error in src/cart.ts:42
[COPY BOTH]

$ command + output, ready to paste

$ npm run build
> tsc -p .
[+]

Several commands, one paste

$ git status
$ npm test
$ npm run build

Clean plain text

Colors and cursor movement are resolved, progress bars keep their final state, and long lines that wrapped are joined back into one. What you paste is what the command displayed.

✓ Copied, right where you clicked

A small tag next to the mouse pointer confirms every copy on Windows. It never takes focus and shows even with Do Not Disturb on. macOS and Linux show a short notification.

Works in your terminal

Windows Terminal, VS Code, iTerm2, WezTerm, kitty, GNOME Terminal, Konsole, Alacritty, and any terminal with clickable links. Your prompt, $? and exit codes stay intact.

Private by design

Everything stays on your machine: the daemon listens only on 127.0.0.1 and keeps your last 200 commands in memory. No accounts, no telemetry.

Starts by itself

The daemon starts with your first terminal, also after a reboot. clipcmd stop keeps it off until clipcmd start.

Fix it with one command

clipcmd doctor checks Node.js, the hooks, the daemon, the link handler and the VS Code extension, and tells you how to fix what is missing.

How it works, behind the scenes.

  1. 1

    A hook in your shell

    clipcmd init adds a small hook to your shell's startup file. It tells the daemon when each command starts and ends.

  2. 2

    A daemon on 127.0.0.1

    A tiny background program remembers your recent commands and their output, and builds the buttons.

  3. 3

    Buttons are links

    Each button is a terminal hyperlink. A Ctrl+click runs a handler registered for your user account, with no browser and no window.

  4. 4

    Straight to your clipboard

    The daemon copies exactly what you asked for, and the ✓ Copied tag confirms it.

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. Read the details.

Works where you work.

Shells

  • Windows PowerShell 5.1
  • PowerShell 7
  • bash
  • Git Bash
  • zsh
  • fish

Terminals

  • Windows Terminal
  • VS Code
  • iTerm2
  • WezTerm
  • kitty
  • GNOME Terminal
  • Konsole
  • Alacritty

Systems

  • Windows
  • macOS
  • Linux

macOS Terminal.app and the classic Windows console have no clickable links; cmd.exe cannot run hooks. tmux needs set -ga terminal-features "*:hyperlinks".

Questions, answered.

What is clipcmd?

clipcmd is a free, open-source command-line tool for developers, installed from npm with npm install -g clipcmd. It puts [COPY CMD] [COPY OUTPUT] [COPY BOTH] [+] buttons under every command in PowerShell, bash, zsh and fish, so you can copy a command, its output, or both with one click and paste it into an AI agent, an issue or a chat. A companion VS Code extension adds output capture in VS Code's terminal. clipcmd is made by Darshan Jain (Djain912).

How do I copy terminal output to the clipboard?

Install clipcmd with npm install -g clipcmd, run clipcmd init, and open a new terminal. Every command then gets [COPY CMD] [COPY OUTPUT] [COPY BOTH] [+] buttons; hold Ctrl (Cmd on macOS) and click one. The output is copied as plain text, without colors.

How do I paste a terminal error into ChatGPT, Claude or another AI agent?

Ctrl+click [COPY BOTH] under the failed command, then paste into the agent's prompt. You get the line $ command followed by its complete output, so the agent sees exactly what ran and everything it printed.

Does clipcmd work in PowerShell, bash, zsh and fish?

Yes: Windows PowerShell 5.1, PowerShell 7, bash (including Git Bash), zsh and fish, on Windows, macOS and Linux, in terminals with clickable links such as Windows Terminal, VS Code, iTerm2, WezTerm, kitty, GNOME Terminal, Konsole and Alacritty.

Do I need the clipcmd VS Code extension?

In VS Code's terminal, yes, for [COPY OUTPUT] and [COPY BOTH]: the extension reads each command's output from VS Code's shell integration. Without it, VS Code shows only [COPY CMD] and [+]. In other terminals the npm package alone is enough.

Why do I have to hold Ctrl when I click a button?

The buttons are terminal hyperlinks, and terminals open links only on Ctrl+click (Cmd+click on macOS). A plain click, for example to select text, never copies anything by accident.

Is my terminal output sent anywhere?

No. A small background daemon listens only on 127.0.0.1 and keeps your last 200 commands in memory. Nothing is sent over the network and there is no telemetry.

Does clipcmd work in cmd.exe?

No. cmd.exe has no way to run code before and after each command. Use PowerShell, which is installed on every Windows PC, or bash.

How do I uninstall clipcmd?

Run clipcmd uninstall --all, then npm uninstall -g clipcmd. This removes the shell hooks, the link handler and the Windows Terminal setting, and stops the daemon. In VS Code, uninstall the clipcmd extension from the Extensions view.

Is clipcmd free?

Yes. clipcmd is free and open source under the MIT license. Bug reports, ideas and pull requests are welcome on GitHub.

Stop drag-selecting your terminal.

$ npm install -g clipcmd