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.