AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified MIT Self-run

Pbcopy

skill-lyhcode-agent-skills-pbcopy · by lyhcode

>

No reviews yet
0 installs
33 views
0.0% view→install

Install

$ agentstack add skill-lyhcode-agent-skills-pbcopy

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No 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.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-lyhcode-agent-skills-pbcopy)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
5mo ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

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 →
Are you the author of Pbcopy? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

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

  1. Use echo -n (no trailing newline) for single-line values like URLs, tokens, and one-liners.
  2. Use heredoc with 'EOF' (single-quoted delimiter) for multi-line content to prevent shell expansion.
  3. Always confirm what was copied by telling the user — e.g., "Copied the API key to your clipboard."
  4. Never silently copy — always inform the user when you put something in their clipboard.
  5. Sensitive data — warn the user if clipboard content contains secrets, as clipboard contents can be read by other apps.
  6. Temp files — delete any temp files (/tmp/clip.html, etc.) after copying to clipboard.
  7. Choose the right method:
  • Plain text → echo | pbcopy
  • HTML/rich text → textutil -convert rtf -stdout | pbcopy (preferred) or osascript for native HTML type
  • Images → osascript with NSImage + NSPasteboard (pbcopy cannot handle images)
  1. macOS only — these commands use macOS APIs. On Linux, suggest xclip -selection clipboard or xsel --clipboard for text (rich content requires xclip -t text/html or similar).

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.