Install
$ agentstack add skill-lyhcode-agent-skills-pbcopy ✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
Verified badge
Passed review? Show it. Paste this badge into your README, it links to the public security report.
Reliability & compatibility
Declared compatibility
Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.
We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.
How agent discovery & health will work →About
Clipboard (pbcopy/pbpaste/osascript)
Automatically copy text, HTML, or images to the macOS clipboard so the user can paste it directly.
When to Use
- The user explicitly asks to copy something to the clipboard
- You generate a snippet (command, code, config, URL, token) that the user said they want to paste elsewhere
- The user asks to copy an image or rich text/HTML to the clipboard
- The user asks you to "put it in my clipboard" or "copy that for me"
Plain Text
# Copy text to clipboard
echo -n 'text to copy' | pbcopy
# Copy multi-line text to clipboard
cat TitleThis is bold' | textutil -stdin -format html -convert rtf -stdout | pbcopy
# From an HTML file
textutil -convert rtf /path/to/page.html -stdout | pbcopy
# Copy raw RTF directly (pbcopy auto-detects RTF header)
cat /tmp/clip.html
Title
Item 1Item 2
EOF
osascript <<'APPLESCRIPT'
use framework "AppKit"
set htmlContent to do shell script "cat /tmp/clip.html"
set pb to current application's NSPasteboard's generalPasteboard()
pb's clearContents()
pb's setString:htmlContent forType:(current application's NSPasteboardTypeHTML)
APPLESCRIPT
rm /tmp/clip.html
Images
pbcopy only handles text/RTF/EPS — images require osascript with NSPasteboard.
# Copy image to clipboard (PNG, JPG, GIF, TIFF, BMP, WebP)
osascript <<APPLESCRIPT
use framework "AppKit"
set img to (current application's NSImage's alloc()'s initWithContentsOfFile:"/path/to/image.png")
set pb to current application's NSPasteboard's generalPasteboard()
pb's clearContents()
pb's writeObjects:{img}
APPLESCRIPT
Reading Clipboard
# Read plain text
pbpaste
# Read as RTF
pbpaste -Prefer rtf
# Check clipboard content types
osascript -e 'the clipboard as record'
# Save clipboard image to file
osascript <<'APPLESCRIPT'
use framework "AppKit"
set pb to current application's NSPasteboard's generalPasteboard()
set imgData to pb's dataForType:(current application's NSPasteboardTypePNG)
if imgData is not missing value then
imgData's writeToFile:"/tmp/clipboard.png" atomically:true
return "Saved to /tmp/clipboard.png"
else
return "No image on clipboard"
end if
APPLESCRIPT
Rules
- Use
echo -n(no trailing newline) for single-line values like URLs, tokens, and one-liners. - Use heredoc with
'EOF'(single-quoted delimiter) for multi-line content to prevent shell expansion. - Always confirm what was copied by telling the user — e.g., "Copied the API key to your clipboard."
- Never silently copy — always inform the user when you put something in their clipboard.
- Sensitive data — warn the user if clipboard content contains secrets, as clipboard contents can be read by other apps.
- Temp files — delete any temp files (
/tmp/clip.html, etc.) after copying to clipboard. - Choose the right method:
- Plain text →
echo | pbcopy - HTML/rich text →
textutil -convert rtf -stdout | pbcopy(preferred) orosascriptfor native HTML type - Images →
osascriptwithNSImage+NSPasteboard(pbcopy cannot handle images)
- macOS only — these commands use macOS APIs. On Linux, suggest
xclip -selection clipboardorxsel --clipboardfor text (rich content requiresxclip -t text/htmlor similar).
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: lyhcode
- Source: lyhcode/agent-skills
- License: MIT
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet, be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.