ClaudeMods
☰
ZH-CN
● 0 人在线 · 浏览 0 次
赞助提交作品
GitHub 仓库 · 发布者 0xGondarxyz

snap

一个 Claude Code mod。输入 `/snap`,在屏幕上拖出一个框,截图就会进入下一条消息。

0xGondarxyz@0xGondarxyz

0xGondarxyz/claude-code-mods/tree/main/snap

已翻译

关于这个 mod

snap

一个 Claude Code mod。输入 /snap,在屏幕上拖出一个框,截图就会进入下一条消息。

工作方式

  1. /snap 以区域模式运行 Spectacle:spectacle --region --background --nonotify --output <file>。
  2. 文件会写入 ~/.cache/claude-snaps/snap-<YYYYMMDD-HHMMSS>.png。
  3. mod 会在提示框的光标处插入 @<path> 。Claude Code 会读取通过 @ 提及的图像文件。
  4. 按 Escape、没有文件或退出码非零时,会显示提示消息 Snap cancelled,并且不做任何更改。找不到 Spectacle 时会显示 Snap needs Spectacle (KDE)。

外挂无法直接把图像附加到草稿中(这些类型只描述已经发送的提示所附的内容),因此这个 mod 使用 @path 文本。

你有 2 分钟拖出选框。

要求

带 Spectacle 的 KDE(/usr/bin/spectacle)。

开发

claude plugin validate .
tsc -p .
claude plugin test .

安装

请先查看作者 README 确认 marketplace 和插件名称;命令可能随仓库结构改变。

claude plugin marketplace add 0xGondarxyz/claude-code-mods
claude plugin install snap
原文 / README

snap

A Claude Code mod. Type /snap, drag a box on the screen, and the screenshot goes into your next message.

How it works

  1. /snap runs Spectacle in region mode: spectacle --region --background --nonotify --output <file>.
  2. The file lands in ~/.cache/claude-snaps/snap-<YYYYMMDD-HHMMSS>.png.
  3. The mod inserts @<path> at the cursor in your prompt box. Claude Code reads an @-mentioned image file.
  4. Escape, no file, or a non-zero exit shows the toast Snap cancelled and changes nothing. A missing Spectacle shows Snap needs Spectacle (KDE).

A plugin cannot attach an image to the draft itself (the types only describe attachments of a prompt already sent), so the mod uses the @path text.

You have 2 minutes to drag the box.

Requirements

KDE with Spectacle (/usr/bin/spectacle).

Develop

claude plugin validate .
tsc -p .
claude plugin test .

更多类似作品