kitten-clipboard(1)
π kitten-clipboard β copy/paste with the system clipboard, even over SSH π
okay bestie, welcome to the kitten-clipboard page from the kitty manual set β¨ this one is short and honestly kind of iconic, so let's get into it π«Ά
πΈ Name πΈ
kitten-clipboard β Copy/paste with the system clipboard, even over SSH. yes, even over SSH. it's giving main character energy fr fr π
β¨ Overview β¨
So the whole point: copy/paste to the system clipboard from shell scripts π
The clipboard kitten lets you read from or write to the system clipboard straight from the shell. And it literally works over SSH. Using it is as simple as:
echo hooray | kitten clipboard
Everything you pipe in on STDIN gets copied to the clipboard. slay π
Wanna go the other way and pull text out of the clipboard?
kitten clipboard --get-clipboard
The text lands on STDOUT π but heads up: by default kitty asks for permission whenever a program tries to read the clipboard π you can control that with clipboard_control <#opt-kitty.clipboard_control>.
β¨ Added in version 0.27.0: support for copying arbitrary data types. not just vibes β actual data types π
π¦ more than just plain text π¦
The clipboard kitten can send and receive way more than plain text from the system clipboard. You can transfer arbitrary data types. Honestly best illustrated with some examples, so here:
# Copy an image to the clipboard:
kitten clipboard picture.png
# Copy an image and some text to the clipboard:
kitten clipboard picture.jpg text.txt
# Copy text from STDIN and an image to the clipboard:
echo hello | kitten clipboard picture.png /dev/stdin
# Copy any raster image available on the clipboard to a PNG file:
kitten clipboard -g picture.png
# Copy an image to a file and text to STDOUT:
kitten clipboard -g picture.png /dev/stdout
# List the formats available on the system clipboard
kitten clipboard -g -m . /dev/stdout
Normally the kitten guesses MIME types based on the file names. Wanna control the MIME types precisely? use the --mime option π«
This kitten runs on a new protocol developed by kitty, so it can function. for the details, see Copying all data types to the clipboard <> π
π§ Source code for clipboard π§
The source code for this kitten lives on GitHub: <https://github.com/kovidgoyal/kitty/tree/master/kittens/clipboard> π
π Command line interface π
kitten clipboard [options] [files to copy to/from]
Read or write to the system clipboard. that's the whole gig π
This kitten operates most simply in filter mode. To set the clipboard text, pipe the new text in on STDIN. Use the --get-clipboard option to instead output the current clipboard text content to STDOUT. Note that copying from the clipboard will cause a permission popup β see clipboard_control <#opt-kitty.clipboard_control> for the details π
Want more control? specify filename arguments, and then different MIME types can be copied to/from the clipboard. Some examples:
# Copy an image to the clipboard:
kitten clipboard picture.png
# Copy an image and some text to the clipboard:
kitten clipboard picture.jpg text.txt
# Copy text from STDIN and an image to the clipboard:
echo hello | kitten clipboard picture.png /dev/stdin
# Copy any raster image available on the clipboard to a PNG file:
kitten clipboard -g picture.png
# Copy an image to a file and text to STDOUT:
kitten clipboard -g picture.png /dev/stdout
# List the formats available on the system clipboard
kitten clipboard -g -m . /dev/stdout
β Options β
--get-clipboard [=no],-g [=no]β Output the current contents of the clipboard to STDOUT π note that by default kitty will prompt for permission to access the clipboard, and you can control that withclipboard_control <#opt-kitty.clipboard_control>.--use-primary [=no],-p [=no]β Use the primary selection instead of the clipboard, on systems that support it (like Linux) π§β¨--mime <MIME>,-m <MIME>β The mimetype of the specified file. Super useful when the auto-detected mimetype is likely to be wrong, or when the filename has no extension and therefore no mimetype can be detected π If you specify more than one file, this option should be specified multiple times β once for each specified file. When copying data from the clipboard you can use wildcards to match MIME types. For example:--mime 'text/*'will match any textual MIME type available on the clipboard, and usually the first matching MIME type is copied. The special MIME type.will return the list of available MIME types currently on the system clipboard π--alias <ALIAS>,-a <ALIAS>β Specify aliases for MIME types. Aliased MIME types are considered equivalent π― When copying to the clipboard, both the original and the alias are made available on the clipboard. When copying from the clipboard, if the original isn't found, the alias is used as a fallback. Can be specified multiple times to create multiple aliases. For example:--alias text/plain=text/x-rstmakestext/plainan alias oftext/rst. Aliases are not used in filter mode π«₯ An alias fortext/plainis automatically created iftext/plainis not present in the input data, but some othertext/*MIME is present.--wait-for-completion [=no]β Wait till the copy to clipboard is complete before exiting. Useful if you're running the kitten in a dedicated, ephemeral window πͺ Only needed in filter mode.--password <PASSWORD>β A password to use when accessing the clipboard. If the user chooses to accept the password, future invocations of the kitten will not have a permission prompt in this tty session π Does not work in filter mode. Must be of the form:text:actual-passwordorfd:integer(a file descriptor number to read the password from) orfile:path-to-file(a file from which to read the password). Note that you must also specify a human friendly name using the--human-nameflag π--human-name <HUMAN_NAME>β A human friendly name to show the user when asking for permission to access the clipboard π«Ά be nice, it's literally the name they'll see.
π Author π
Kovid Goyal π
π Copyright π
2026, Kovid Goyal
okay that's the whole page, go copy something cute π β¨
π version0.49.2, dated Oct 01, 2026 β that's thekitten-clipboard(1)energy, mwah π no cap, that's a wrap π
π¦ where this page comes from
- arch rolling: kitty 0.49.2-1 Β· GPL-3.0-only
- nixpkgs unstable: kitty-bin 0.49.2
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms