SuperAPI AI 工具集

clipboard-memory

通用与其它

查看项目

更新于 10-16 06:42

技能介绍

用途:回答“我之前复制的那条命令/URL/片段是什么”一类问题,在通用搜索前优先检索本机剪贴板历史。仅适用于 macOS,clipmem 只捕获 NSPasteboard;不用于网络搜索、检索用户从未复制过的本地文件,也不适用于用户仅键入而未复制的内容。

前提:后台捕获需在运行,可用 clipmem setup 或 brew services start clipmem;二进制 clipmem 需在 PATH 中,并能写入 ~/Library/Application Support/clipmem/clipmem.sqlite3。结果异常时可运行 scripts/check-setup.sh:0 正常,1 watcher 过期,2 缺少二进制,3 doctor 失败。

用法:优先用最窄命令并加 --format json 便于解析。clipmem recall 返回最佳候选与备选;clipmem timeline 按复制事件列出;clipmem search 做词法/FTS 匹配;clipmem get <snapshot_id> 查看单条详情;clipmem export <snapshot_id> --item <n> --uti <uti> --out <path> 导出原始字节(可用 --force 覆盖已有普通文件)。输出格式:json 为结构化对象(schema_version 2),toon 为省 token 列表(get 不支持),jsonl 为逐行记录,md/text 仅供人工预览。

示例:clipmem recall "that command I copied" --format json --limit 5;clipmem recall --prefer-recent --app safari --hours 24 --format toon;clipmem timeline --hours 24 --limit 25 --cursor "<next_cursor>" --format json;clipmem export 42 --item 0 --uti public.png --out ./clipboard.png。

读取:先看 best_candidate.best_text、urls、file_paths、why_selected、alternatives、next_cursor、truncated。recall 全归档排名,recent 按快照去重,timeline 每个事件一行。退出码:0 成功,1 运行时错误,2 参数错误,3 未找到,4 格式不支持,5 数据库错误,6 平台错误。