Skip to main content

gh-attachments:GitHub 媒体附件

指导使用原生 gh --attach,将本地图片或视频附到 GitHub issue、PR 与评论中。

来源信息

仓库
itsramiel/Software-Engineering
最近来源活动
2026年11月6日 19:20
检测到的 SKILL.md 语言
英语
星标
0
Forks
0

用途

用于创建、编辑或评论 issue/PR 时附上本地截图与录屏,不是任意文件通用上传器。

必要前提

需要原生 GitHub CLI 2.99.0+,并确认具体命令帮助列出 --attach;账号须已鉴权且有仓库 push 权限。官方版本说明支持 GitHub.com 和 GitHub Enterprise Cloud;原生参数不要求另装扩展。

操作说明

提供本地图片或视频路径,以及目标仓库、issue/PR 和操作。先核对 gh 版本与具体命令帮助;支持 gh issue create/edit/comment 和 gh pr create/edit/comment。--attach 上传媒体并在正文插入或替换为 URL。执行发帖或编辑命令前确认目标、内容与可见范围。

限制

文件会发送到 GitHub,并创建或修改外部可见内容。GitHub 文档说明公开仓库附件可免鉴权访问,私有或内部仓库附件仅有仓库访问权限的人可查看。不要推定旧版 gh 或 Enterprise Server 同样支持。CLI 只支持图片与视频,不能把浏览器允许的所有附件类型套用过来。issue create 即使因部分上传失败返回非零,也可能已创建含成功附件的 issue;重试前先检查返回 URL 与结果。

安装方式

默认使用会先检查来源的 Prompt;你也可以切换为直接命令,或下载本地副本。

检查来源文件

决定是否安装前,请先阅读 SKILL.md,以及 SkillsMP 当前展示的配套文件。

正在显示 SKILL.md

SKILL.md
来源说明 · 只读预览
name
gh-attachments
description
Attaches images or videos to GitHub issues, pull requests and comments through `gh`. Use when an issue, PR or comment should include a screenshot or recording, and before concluding that gh can't upload files.
`gh` can upload images and videos with the `--attach` flag, starting in v2.99.0. These commands support it: - `gh issue create`, `gh issue edit`, `gh issue comment` - `gh pr create`, `gh pr edit`, `gh pr comment` Run `gh <command> --help` for the details. If `--attach` isn't in the help output, the installed `gh` is older than v2.99.0 and needs an upgrade.
在 GitHub 查看