# GitHub CLI 2.99.0 支援重複 --attach，issue、PR、留言都能附圖或影片

> 📖 本站完整內容索引（documentation index）：[llms.txt](/llms.txt)

> 原作者：GitHub (@github) · 策展與摘要：EasyVibeCoding · 平台：X (Twitter) · 熱度：🔥🔥🔥 · 日期：2026-09-02

> 原始來源：https://x.com/github/status/2094891879959539773

## 證據與延伸閱讀

- [GitHub CLI 2.99.0 支援重複 `--attach`，issue、PR、留言都能附圖或影片。](https://github.blog/changelog/2026-09-01-github-cli-media-in-issues-pull-requests-and-comments) — 官方文件 · 最後核對：2026-09-02 · 支持主張：The changelog and gh issue create documentation describe supported commands and formats, in-place Markdown rewriting, alt-text syntax, token and write-access requirements, a 50-file-per-command cap, partial-upload behavior, plan-specific size limits, and the lack of GitHub Enterprise Server support.
- [GitHub CLI --attach media uploads — cli.github.com](https://cli.github.com/manual/gh_issue_create) — 官方文件 · 最後核對：2026-09-02 · 支持主張：The changelog and gh issue create documentation describe supported commands and formats, in-place Markdown rewriting, alt-text syntax, token and write-access requirements, a 50-file-per-command cap, partial-upload behavior, plan-specific size limits, and the lack of GitHub Enterprise Server support.
- [GitHub CLI 2.99.0 新增可重複使用的 --attach](https://github.blog/changelog/2026-09-01-github-cli-media-in-issues-pull-requests-and-comments/) — 官方文件

## 中文摘要

GitHub CLI 2.99.0 支援重複 `--attach`，issue、PR、留言都能附圖或影片。

GitHub 已正式推出 GitHub CLI 的媒體附件功能。升級到 `gh` 2.99.0 後，`gh issue create`、`gh issue edit`、`gh issue comment`、`gh pr create`、`gh pr edit` 與 `gh pr comment` 都能重複帶入 `--attach`，一次附加多個本機檔案。這項功能已向 GitHub 各方案使用者全面開放，不經 preview 階段；GitHub Enterprise Server 目前不支援。

<video src="https://pub-75d4fe1e4e80421b9ecb1245a7ae0d1a.r2.dev/curated/1788363329007-cy8utf03.mp4" poster="https://pub-75d4fe1e4e80421b9ecb1245a7ae0d1a.r2.dev/curated/341106acfc6166a9.jpg" controls playsinline preload="metadata" style="max-width:100%;height:auto;display:block;margin:1rem 0"></video>
> 使用 GitHub CLI 執行 `gh issue create` 指令並透過 `--attach` 參數附加本機檔案的終端機畫面

![](https://pub-75d4fe1e4e80421b9ecb1245a7ae0d1a.r2.dev/curated/341106acfc6166a9.jpg)
> 終端機畫面示範使用 gh issue create 指令並透過 --attach 參數上傳本地圖片 ./customer-feedback-mobile.png 建立 GitHub issue，執行成功後於命令列回傳 issue 的遠端 URL。

## 不只上傳，還會改寫 Markdown

如果正文原本寫了 `![alt](./login.png)`，CLI 會在上傳後把本機路徑改寫成 GitHub 資產網址，同時保留原有 alt text；只有附加、但沒有在正文引用的檔案，則會被加到內容尾端。也可以在路徑後加上 `#` 指定圖片替代文字，例如官方手冊的格式 `--attach './login.png#The login error state'`。影片沒有 alt text。

官方手冊列出的重複參數用法如下：

```bash
gh issue create --attach './login.png#The login error state'
gh issue create --attach ./before.png --attach ./after.png
```

## 格式、權限與限制

支援格式包括 PNG、JPEG、GIF、WebP、SVG、MP4、MOV 與 WebM，每個命令最多 50 個檔案。圖片與 GIF 上限為 10 MB；Free 方案的影片上限為 10 MB，付費方案影片可到 100 MB。上傳沿用 `gh auth login` 的 OAuth token 或 classic personal access token，而且必須擁有該 repository 的寫入權限。

自動化流程還要留意一個邊界：建立 issue 時，若部分附件成功、部分失敗，GitHub 仍會用成功的附件建立 issue，印出新 issue URL，但命令會以非零狀態結束。腳本不能只看 exit code 就假定「什麼都沒建立」，應同時讀取 stdout 並處理部分成功結果。

Coding agent 因此能用一個可重複的命令描述 UI 問題，並一併提交截圖或錄影，不必切到瀏覽器拖放檔案再貼回連結。完整能力與邊界可查閱 [GitHub changelog](https://github.blog/changelog/2026-09-01-github-cli-media-in-issues-pull-requests-and-comments/) 與 [`gh issue create` 手冊](https://cli.github.com/manual/gh_issue_create)。

## 媒體內容

**使用 GitHub CLI 執行 `gh issue create` 指令並透過 `--attach` 參數附加本機檔案的終端機畫面**

**影片中的 Prompt 與操作**

Prompt（00:01）：

```
gh issue create \
  --title "Mobile category nav overflow/ cramped product layout" \
  --body "See screenshot below" \
  --attach ./customer-feedback-mobile.png
```

操作步驟：

1. （00:00）ls
2. （00:01）gh issue create \
3. -title "Mobile category nav overflow/ cramped product layout" \
4. -body "See screenshot below" \
5. -attach ./customer-feedback-mobile.png

## 標籤

功能更新, CLI, GitHub
