Skip to content
Back to skills

Clip

ASecurity

Use when copying output, files, or stdin to the system clipboard; not for web pastebin uploads.

  • 2 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added November 14, 2026
toolsshell

Works with

  • terminal
  • cli

Security analysis

A100/100

Pro scans all 4 files and shows the line behind each finding

Scanned November 14, 2026

npx -y skills add anntnzrb/agents --skill clip --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Clip?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Clip
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/anntnzrb-clip/badge)](https://www.skillsdirectory.com/skills/anntnzrb-clip)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: clip
description: "Use when copying output, files, or stdin to the system clipboard; not for web pastebin uploads."
license: AGPL-3.0-or-later
metadata:
  author: anntnzrb
---

# Clipboard copier

Copy a file or stdin to the client clipboard. The script selects a native tool locally and OSC 52 over SSH.

## When to use

- The user asks to copy output, a file, or a snippet to the clipboard.
- The destination is the clipboard on the computer running the terminal client.
- Use this entrypoint without asking the user to select a platform or transport.

## Public entrypoint

```text
uv run --script <skill-dir>/scripts/cli.py [FILE]
```

- `FILE`: optional path to copy. Reads from stdin if omitted.
- Read stderr for the selected transport and errors.
- If stderr reports OSC 52 sent, report that the sequence was sent. Do not claim clipboard acceptance was verified.
- If the command fails, report the error. Do not retry by printing escape sequences into captured output.

## Common calls

```text
# copy a file
uv run --script <skill-dir>/scripts/cli.py ./notes.txt

# copy command output
some-command | uv run --script <skill-dir>/scripts/cli.py

# copy stdin (type or paste, then Ctrl-D)
uv run --script <skill-dir>/scripts/cli.py
```

## Transport selection

- Local macOS uses `pbcopy`. Linux uses `wl-copy` for Wayland or `xclip` or `xsel` for X11 when available.
- Local Windows and WSL use PowerShell `Set-Clipboard` with UTF-8 stdin.
- SSH markers disable native tools so the script does not copy to the server's clipboard.
- If no native tool succeeds, the script tries OSC 52 through `SSH_TTY`, the controlling terminal, an ancestor terminal, or terminal-connected stdout. Windows uses `CONOUT$`.
- Detached agent commands discover ancestor terminals through `ps`. Captured stdout is never a clipboard transport.
- tmux and GNU screen get passthrough framing unless the script writes directly to the outer SSH TTY.
- OSC 52 requires terminal support and clipboard permissions. tmux must allow passthrough. Sending the sequence cannot confirm terminal acceptance.
- Remote execution without SSH markers cannot reliably identify the client clipboard. A detached remote process without an accessible terminal has no clipboard transport.

## Exit codes

- `0`: native tool succeeded, OSC 52 was sent, or empty input was skipped
- `1`: no usable transport, write error, or runtime error
- `2`: usage or file error
- Native tool exit codes are preserved if OSC 52 also fails.

## Empty input

Empty input is a no-op. The script does not emit an empty OSC 52 sequence, so it never clears the host clipboard.

## Validation

```text
uv run --script skills/current/skill-creator/scripts/cli.py gates skills/current/clip --tests
uv run --script skills/current/skill-creator/scripts/cli.py quick-validate skills/current/clip
```

Files in this skill

  • SKILL.md2.8 KB
  • pyproject.toml550 B
  • scripts/cli.py6.5 KB
  • tests/test_cli.py8.3 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in tools →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.