← 返回 Skills 市场
534422530

Windows剪贴板管理器

作者 534422530 · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
52
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install laosi-clipboard
功能描述
Windows剪贴板管理器 - 原创技能。管理Windows剪贴板,支持复制、粘贴、历史记录、多条目管理、格式化转换等功能。适用于数据处理、批量操作、跨应用数据交换等场景。
使用说明 (SKILL.md)

⚠️ 发布规则

所有发布到ClawHub的技能必须严格测试,确定没有问题再发布


技能测试验证清单

  • frontmatter格式正确
  • 功能完整
  • 命令清晰
  • 历史管理实用
  • 无语法错误

Clipboard Manager - 剪贴板管理器

原创技能 | 激活词: 剪贴板 / 复制粘贴 / 剪贴板历史

功能概述

功能 说明
读写剪贴板 读取/写入文本、图像、文件
历史记录 保存最近N条剪贴板内容
多条目管理 快速切换不同内容
格式转换 文本↔图片、JSON格式化
搜索过滤 在历史中搜索内容

安装依赖

pip install pyperclip Pillow

核心命令

1. 基本读写

import pyperclip

# 读取文本
text = pyperclip.paste()

# 写入文本
pyperclip.copy("Hello World")

# 清空剪贴板
pyperclip.copy("")

2. 图像操作

from PIL import Image
import io
import pyperclip

# 从剪贴板获取图像
def get_image_from_clipboard():
    try:
        img = Image.open(io.BytesIO(pyperclip.paste()))
        return img
    except:
        return None

# 复制图像到剪贴板
def copy_image_to_clipboard(image_path):
    img = Image.open(image_path)
    output = io.BytesIO()
    img.save(output, format='PNG')
    output.seek(0)
    pyperclip.copy(output.getvalue())

3. 剪贴板历史

class ClipboardHistory:
    def __init__(self, max_items=50):
        self.history = []
        self.max_items = max_items
    
    def add(self, content):
        """添加内容到历史"""
        self.history.insert(0, {
            'content': content,
            'timestamp': datetime.now(),
            'type': 'text' if isinstance(content, str) else 'image'
        })
        if len(self.history) > self.max_items:
            self.history.pop()
    
    def get(self, index):
        """获取历史条目"""
        if 0 \x3C= index \x3C len(self.history):
            return self.history[index]
        return None
    
    def search(self, keyword):
        """搜索历史"""
        return [item for item in self.history 
                if keyword.lower() in str(item['content']).lower()]
    
    def clear(self):
        """清空历史"""
        self.history = []

4. 格式化转换

import json

# JSON格式化
def format_json():
    text = pyperclip.paste()
    try:
        obj = json.loads(text)
        formatted = json.dumps(obj, indent=2, ensure_ascii=False)
        pyperclip.copy(formatted)
        return True
    except:
        return False

# 文本转列表
def text_to_lines():
    """将文本按行转为列表"""
    text = pyperclip.paste()
    lines = text.split('\
')
    pyperclip.copy('\
'.join([f"- {line}" for line in lines if line.strip()]))

# 批量添加引号
def add_quotes():
    """为每行添加引号"""
    text = pyperclip.paste()
    lines = text.split('\
')
    quoted = [f'"{line.strip()}"' for line in lines if line.strip()]
    pyperclip.copy(','.join(quoted))

5. 多剪贴板管理

class MultiClipboard:
    def __init__(self):
        self.slots = {}  # 槽位: 内容
    
    def save(self, slot_id: str):
        """保存当前剪贴板到槽位"""
        self.slots[slot_id] = pyperclip.paste()
        return True
    
    def load(self, slot_id: str):
        """从槽位恢复剪贴板"""
        if slot_id in self.slots:
            pyperclip.copy(self.slots[slot_id])
            return True
        return False
    
    def list_slots(self):
        """列出所有槽位"""
        return list(self.slots.keys())
    
    def delete(self, slot_id: str):
        """删除槽位"""
        if slot_id in self.slots:
            del self.slots[slot_id]
            return True
        return False

使用场景

场景1: 代码片段收集

# 收集多个代码片段
clipboard_manager.save("snippet1")  # 保存到槽位1
# 复制下一个代码片段
clipboard_manager.save("snippet2")  # 保存到槽位2
# ...
clipboard_manager.load("snippet1")  # 恢复第一个片段

场景2: 批量数据处理

# 从Excel复制的数据,批量添加引号
# 原始: item1, item2, item3
# 结果: "item1", "item2", "item3"
add_quotes()

场景3: JSON格式化

# 复制的JSON字符串格式化
format_json()  # 自动格式化并复制回去

场景4: 文本整理

# 将文本转为Markdown列表
# 原始:
# 北京
# 上海
# 广州
# 结果:
# - 北京
# - 上海
# - 广州
text_to_lines()

实用命令集

# 复制文件路径到剪贴板
def copy_file_path(file_path):
    pyperclip.copy(file_path)

# 复制当前时间
def copy_current_time():
    from datetime import datetime
    pyperclip.copy(datetime.now().strftime("%Y-%m-%d %H:%M:%S"))

# 复制当前日期
def copy_current_date():
    from datetime import datetime
    pyperclip.copy(datetime.now().strftime("%Y-%m-%d"))

# 全转大写
def to_uppercase():
    text = pyperclip.paste()
    pyperclip.copy(text.upper())

# 全转小写
def to_lowercase():
    text = pyperclip.paste()
    pyperclip.copy(text.lower())

# 首字母大写
def capitalize():
    text = pyperclip.paste()
    pyperclip.copy(text.title())

# 去重换行
def deduplicate_lines():
    text = pyperclip.paste()
    lines = text.split('\
')
    unique = list(dict.fromkeys(lines))
    pyperclip.copy('\
'.join(unique))

# 反转顺序
def reverse_lines():
    text = pyperclip.paste()
    lines = text.split('\
')
    reversed_lines = lines[::-1]
    pyperclip.copy('\
'.join(reversed_lines))

# 去除空白行
def remove_blank_lines():
    text = pyperclip.paste()
    lines = [line for line in text.split('\
') if line.strip()]
    pyperclip.copy('\
'.join(lines))

剪贴板监控

import time
import threading

class ClipboardMonitor:
    def __init__(self, callback):
        self.callback = callback
        self.running = False
        self.last_content = ""
    
    def start(self):
        self.running = True
        thread = threading.Thread(target=self._monitor)
        thread.daemon = True
        thread.start()
    
    def stop(self):
        self.running = False
    
    def _monitor(self):
        while self.running:
            current = pyperclip.paste()
            if current != self.last_content:
                self.last_content = current
                self.callback(current)
            time.sleep(0.5)

输出格式

## 剪贴板操作报告

### 当前剪贴板
- **类型**: 文本
- **长度**: 156字符
- **预览**: "Hello World..."

### 历史记录
1. [10:30] "Hello World"
2. [10:29] 图片 (123KB)
3. [10:28] "some text"
4. [10:27] "another text"
5. [10:26] JSON数据

### 槽位
- A: "代码片段1"
- B: "代码片段2"
- C: "常用文本"

### 操作
✅ 已复制到剪贴板
✅ 已保存到槽位A
✅ 历史已记录

集成建议

配合技能 效果
windows-app-controller 配合自动化操作
requirement-clarifier 快速复制澄清内容
intent-classifier 识别剪贴板内容类型

原创性声明

本技能为原创,融合了:

  • Pyperclip剪贴板操作
  • PIL图像处理
  • 历史记录管理
  • 文本格式化工具

作者: laosi 创建日期: 2026-04-28

安全使用建议
Before installing, consider these points: - Privacy: this skill continuously reads your clipboard and keeps a history. Anything you copy (passwords, tokens, personal data) could be captured. Only install if you are comfortable with that and trust the runtime environment. - Network risk: the SKILL.md does not send data externally, but if the agent or host has network access, captured clipboard data could be transmitted by other components. Ensure the agent is not allowed to exfiltrate data or audit network activity. - Dependencies & installation: the skill expects pyperclip and Pillow but has no formal install spec. Make sure those packages come from trusted sources (pip from PyPI) and install them in an isolated environment (virtualenv). - Platform correctness: the skill labels itself Windows-specific but doesn't enforce OS restrictions and uses pyperclip for images in a way that may not work. Test in a safe environment first. - Code hygiene: there are minor coding errors (missing imports, questionable image-handling approach). Review and, if necessary, correct the code before running. Consider adding redaction/filtering rules (e.g., skip clipboard contents matching password patterns), limits on history retention, and explicit opt-in for monitoring. - Operational posture: do not enable as always-on in untrusted environments. If you need persistent history, prefer an encrypted, disk-backed store with a clear retention policy and explicit user consent.
功能分析
Type: OpenClaw Skill Name: laosi-clipboard Version: 1.0.0 The skill bundle provides standard clipboard management utilities including text manipulation, history tracking, and multi-slot storage using the 'pyperclip' and 'Pillow' libraries. While the image handling logic appears technically flawed (pyperclip is text-only), there is no evidence of data exfiltration, malicious execution, or prompt injection across SKILL.md or _meta.json.
能力评估
Purpose & Capability
The declared purpose (Windows clipboard manager) matches the provided code and dependencies (pyperclip, Pillow). However: (1) the registry lists no OS restriction even though the skill is Windows-focused; (2) the SKILL.md shows image handling via pyperclip, but pyperclip is primarily text-focused and typically doesn't provide raw image bytes on all platforms—this is a functional mismatch; (3) small coding inconsistencies exist (e.g., datetime used without import). These are technical mismatches rather than clear malicious intent.
Instruction Scope
The instructions direct the agent to read and write the system clipboard and to run a clipboard monitor that samples content every 0.5s and stores history in memory. That behavior is intrinsic to a clipboard manager, but it also means the skill will capture any clipboard content (including passwords, tokens, private data). The SKILL.md does not include any guidance on filtering, redaction, encryption, or limits on what is stored or how long history is kept, increasing privacy risk. There are no steps that transmit clipboard data off-device in the doc, but the captured data could be exposed if the agent or environment has network access.
Install Mechanism
This is an instruction-only skill with no install spec. The frontmatter's metadata notes python dependencies (pyperclip, Pillow) and the SKILL.md suggests installing them with pip, but the registry has no formal install step. That means runtime will rely on the agent environment to already have those packages or will need to pip-install them ad hoc—this can cause failures or hidden runtime installs if not managed explicitly.
Credentials
The skill requests no environment variables or credentials, which is appropriate. However, clipboard contents are often sensitive; the skill's behavior (unrestricted monitoring and history) is disproportionate from a privacy standpoint unless the user explicitly consents and understands the storage/retention policy. No explicit instructions are provided to avoid capturing secrets.
Persistence & Privilege
The skill is not marked always:true and does not request system-wide config changes. Autonomous invocation is allowed (platform default). Combined with the monitoring behavior, autonomous invocation could increase exposure (the skill can run and capture clipboard contents without a user performing every action). The skill does not claim to write persistent files, but the SKILL.md does not specify that history is transient or in-memory-only across restarts.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install laosi-clipboard
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /laosi-clipboard 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
原创技能 - Windows剪贴板管理和格式化工具
元数据
Slug laosi-clipboard
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Windows剪贴板管理器 是什么?

Windows剪贴板管理器 - 原创技能。管理Windows剪贴板,支持复制、粘贴、历史记录、多条目管理、格式化转换等功能。适用于数据处理、批量操作、跨应用数据交换等场景。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 52 次。

如何安装 Windows剪贴板管理器?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install laosi-clipboard」即可一键安装,无需额外配置。

Windows剪贴板管理器 是免费的吗?

是的,Windows剪贴板管理器 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Windows剪贴板管理器 支持哪些平台?

Windows剪贴板管理器 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Windows剪贴板管理器?

由 534422530(@534422530)开发并维护,当前版本 v1.0.0。

💬 留言讨论