跳到正文
Skillpedia
通用编程24k · #10112

upload-photo

它能做什么

它演示如何使用 GitHub 命令行工具,把图片或视频添加到 GitHub 拉取请求或议题中。适合希望在代码审查时分享截图的开发者。

适用场景

  • ✓当你想把截图附加到 GitHub 拉取请求中,让审阅者看到改动时。
  • ✓当你需要在 GitHub 议题评论中显示图片时。
  • ✓当 GitHub 评论中的图片需要替代文字,让使用屏幕阅读器的人能理解内容时。

技能链接

https://github.com/different-ai/openwork/blob/dev/.opencode/skills/upload-photo/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/different-ai/openwork/blob/dev/.opencode/skills/upload-photo/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“请把这张截图附加到我的 GitHub 拉取请求中,让审阅者能看到这次改动。”

每周 5 个新技能,1 分钟读完。

工作原理

该技能运行 GitHub 命令行工具上传文件,并把它放入评论中。运行前会检查该工具的版本是否为 2.99 或更新版本。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Upload Photo

Use GitHub CLI 2.99 or newer. Check and upgrade it if needed:

gh --version
brew upgrade gh

Attach a file to a new comment, putting alt text after #:

gh pr comment <n> --attach './shot.png#Alt text'
gh issue comment <n> --attach './shot.png#Alt text'

gh pr create, gh pr edit, gh issue create, and gh issue edit also accept repeatable --attach flags, with at most 50 files.

To place an image in the body, reference the same path:

printf '![Alt text](./shot.png)\n' | gh pr comment <n> --body-file - --attach './shot.png#Alt text'

GitHub rewrites that Markdown reference to the uploaded asset. Unreferenced attachments are appended to the comment.

There is no standalone “get a URL” command. The asset URL lives in the posted comment; read it back with gh api repos/{owner}/{repo}/issues/comments/<id> --jq .body.

常见问题

这需要专门的工具吗?

需要。你需要 GitHub CLI 2.99 或更新版本。技能会检查版本,并告诉你如何升级。

创建拉取请求时可以添加图片吗?

可以。创建或编辑拉取请求或议题时,也可以添加附件,最多 50 个文件。

上传后如何获取图片链接?

链接在已发布的评论中,技能会展示如何用 GitHub 命令读取。

详情

作者的原始描述

Attach a screenshot/image/video to a PR or issue, or embed an image in a GitHub comment.

repo: different-ai/openwork

热度

GitHub 星标
24k
排名
#10112
许可证
—
更新时间
2026/11/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能