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 with clipboard_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-rst makes text/plain an alias of text/rst. Aliases are not used in filter mode πŸ«₯ An alias for text/plain is automatically created if text/plain is not present in the input data, but some other text/* 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-password or fd:integer (a file descriptor number to read the password from) or file:path-to-file (a file from which to read the password). Note that you must also specify a human friendly name using the --human-name flag πŸ‘‘
  • --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 πŸ‘‘


2026, Kovid Goyal


okay that's the whole page, go copy something cute πŸ’…βœ¨

🌈 version 0.49.2, dated Oct 01, 2026 β€” that's the kitten-clipboard(1) energy, mwah πŸ’‹ no cap, that's a wrap πŸŽ€
πŸ“¦ where this page comes from