Get the FREE Ultimate OpenClaw Setup Guide →

txt-copy

npx machina-cli add skill umputun/cc-thingz/txt-copy --openclaw
Files (1)
SKILL.md
1.4 KB

Copy Text to Clipboard

Copy generated text content to clipboard via a timestamped temp file.

Activation Triggers

  • "copy this", "copy to clipboard", "save to clipboard"
  • "copy the email", "copy the message", "copy the letter"
  • After generating text content when user indicates they want to use it
  • "I need to paste this", "put it in clipboard"

Workflow

  1. Identify the text content to copy (from recent generation or user-specified)

  2. Write to timestamped temp file:

tmpfile="/tmp/claude-txt-copy-$(date +%s).txt"
cat > "$tmpfile" << 'EOF'
<content here>
EOF
  1. Copy to clipboard and remove temp file:
if [[ "$OSTYPE" == "darwin"* ]]; then
    pbcopy < "$tmpfile"
elif command -v xclip &> /dev/null; then
    xclip -selection clipboard < "$tmpfile"
elif command -v xsel &> /dev/null; then
    xsel --clipboard --input < "$tmpfile"
else
    echo "No clipboard tool found" >&2
fi
rm -f "$tmpfile"
  1. Confirm to user: "Copied to clipboard (N characters)"

Notes

  • Use cat with heredoc and single-quoted EOF to preserve exact content
  • Temp file uses timestamp to avoid collisions across invocations
  • Temp file is removed after clipboard copy

Source

git clone https://github.com/umputun/cc-thingz/blob/master/plugins/workflow/skills/txt-copy/SKILL.mdView on GitHub

Overview

txt-copy copies generated text content to the system clipboard. It writes the content to a timestamped temp file, then uses macOS pbcopy or Linux xclip/xsel to place the text in the clipboard, and finally deletes the temp file. This enables quick sharing of emails, messages, letters, or any generated text.

How This Skill Works

The skill identifies the target text from recent output or user input, writes it to a timestamped temp file, then invokes the appropriate clipboard tool to copy the content. After a successful copy, it removes the temp file and confirms the action to the user.

When to Use It

  • Copy the latest email draft to paste into your email client
  • Copy a generated message or letter to share in a chat or document
  • Respond to a user request like copy this or copy to clipboard
  • Save any generated text block for quick pasting elsewhere
  • Share notes or content snippets by placing them in the clipboard

Quick Start

  1. Step 1: Identify the text to copy (recent output or user supplied)
  2. Step 2: Write the content to a timestamped temp file in /tmp
  3. Step 3: Copy to clipboard using the available tool and remove the temp file; receive a confirmation

Best Practices

  • Verify the exact content before copying to the clipboard
  • Use a timestamped temp file to avoid collisions across invocations
  • Preserve content exactly with a heredoc and a single quoted EOF
  • Rely on macOS pbcopy or Linux xclip/xsel for cross platform copying
  • Delete the temp file after copying and provide a confirmation

Example Use Cases

  • Copy the latest email draft from the chat to paste into an email client
  • Copy a generated message to paste into a messaging app
  • Copy a formal letter draft to share with a colleague
  • Copy a code snippet produced in the chat to your editor
  • Copy a notes block to paste into a document or note app

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers