Pyperclip

There's a Python package called pyperclip that comes with just two features: copy and paste. It's a simple package that allows you to copy and paste text to the clipboard. Here's the uv-compatible Python script.

# /// script
# dependencies = ["pyperclip"]
# ///

import pyperclip as pc 

text = "This is going to show up in the clipboard!"
pc.copy(text) 

# You can also paste stuff if you want
pasted = pc.paste() 
print(pasted) 

After the script is done running you should be able to paste the text into any text field to see the effect.

It feels useful for a bunch of things, like copying URLs, but it mainly seems useful when the user is running something from the terminal directly. On MacOS it uses the pbcopy and pbpaste commands, so it may not work if you are not interacting through the terminal directly.