You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Feature request: cli/cli#13256 (gh-image is mentioned in that thread) — closed as completed 2026-08-25
Implementation: cli/cli#14186 — 12 PRs, all merged 2026-08-25
Status as of 2026-09-08: released.--attach shipped in gh v2.99.0 on 2026-09-01, announced the same day as GitHub CLI: Media in issues, pull requests, and comments and described there as generally available on all plans. The roadmap item picked up a GA label on 2026-08-21 and is still open with no milestone. v2.100.0 (2026-09-03) added only attachment telemetry (cli/cli#14327).
This issue is tracking/awareness only. It exists so the overlap with gh-image is visible and scope, positioning, and README framing can be settled before the release lands.
What upstream --attach does
A repeatable --attach flag on six commands, wired in pkg/cmd/{issue,pr}/{create,edit,comment}:
Placement: if the body contains a markdown reference to an attached local path, that reference is rewritten to the uploaded asset URL; otherwise the asset is appended to the end of the body. Images render as ; videos render as a bare URL on its own line, or [name](url) when the reference sits inline.
Alt text handling: supplied after #, defaulting to the filename with its extension stripped and remaining dots replaced by spaces, mirroring the web uploader. Alt text is escaped, and refused outright when it cannot be rendered safely. Videos take no alt text.
Constraints as released (internal/attachments at v2.99.0, verified 2026-09-08 — unchanged from the merge)
allowlist of gho_ (OAuth), ghp_ (classic PAT), github_pat_ (fine-grained). Everything else → unsupported authentication type, which covers ghs_ (Actions GITHUB_TOKEN, app installation) and ghu_ (user-to-server)
Permission
allowlist of ADMIN, MAINTAIN, WRITE, measured against their upload endpoint — the code notes READ and TRIAGE get a 404 there
Hosts
GitHub.com and GHEC data-residency tenants (.ghe.com). On-prem GHES is refused: attaching files is not supported on GitHub Enterprise Server
Standalone upload
none — the flag exists only inline on those six commands
Download
not implemented
Other validation, all client-side: an empty --attach value, stdin, directories, non-regular files, zero-byte files, and the same file attached twice are each rejected before any upload.
Non-image/video attachments are not in scope; that ask became cli/cli#14194, which is open, unassigned, and carries the standard backlog reply — "we are not committing to implementing this feature at this time."
Where gh-image still differs
Upstream now covers the common case: a user with write access on GitHub.com attaching a PNG or MP4 to an issue or PR they are creating or commenting on. The README should stop implying the official CLI cannot do this.
Read-only contributors. Upstream requires ADMIN/MAINTAIN/WRITE. Our browser-session path does not: Write-access requirement is overstated, and invalid sessions fall into the wrong error branch #41 records a successful end-to-end upload against a public repo where the account held pull only, which is why the write-access wording was removed from token.go and the README. The two tools use different endpoints — upstream posts to uploads.github.com/user-attachments/assets with a bearer token and a numeric repository id, while we obtain an uploadToken from the repo page and go through upload/policies/assets → S3 → finalize — so their permission floor does not apply to us. Scope of the test: public repo, read-only. Private-repo read-only and TRIAGE are untested.
Standalone upload. We return a URL and markdown usable in any body, commit message, gist, or non-gh tool. There is no attachment command upstream, and the package documentation is explicit that the flag only exists inline and the caller must write the returned markdown to a resource. A standalone primitive was requested in #13256 and not built.
CI and automation tokens. Upstream rejects ghs_ and ghu_, so a workflow attaching a screenshot needs a PAT. This is a platform limit rather than a CLI decision, and it binds our bearer path too: cli/cli#14309 reports the endpoint returning 404 for an installation token with write access, where the same request with gho_ succeeds. What remains on our side is the session-cookie path driven by GH_SESSION_TOKEN, which does run in CI but ties automation to a human session.
No longer a difference
Enterprise. Upstream refuses on-prem GHES but works on GHEC data-residency tenants. Our on-prem support is still an open request (Github Enterprise Support #37), so their host coverage is currently the broader of the two.
Output formatting. Both emit plain markdown —  for images, a bare URL for videos, [name](url) for other files. We have no width or HTML flags, and upstream additionally ships alt-text syntax with escaping.
Also worth noting: cli/cli#14261 documents attachment support in the gh Agent Skill. We ship a skill of our own, and it should be reviewed against theirs.
#48 found that gh auth token works as a Bearer against https://uploads.github.com/user-attachments/assets, and that the token path accepts images and video but rejects other content types. The upstream implementation matches that from the other direction: same endpoint, same images/video scope, same requirement for elevated repository permission. The browser-session path remains the broader one for both file types and permissions.
Community datapoint from the #13256 thread (@labilio, Windows, 2026-08-11): released v1.2.0 failed because the browser user_session cookie could not be decrypted in that environment (#4), and a build from main@d59ac2bb with the token-first path uploaded successfully using the existing gh OAuth token. The token path is doing real work for the users the cookie path loses.
What to watch
The PR stack merges — 2026-08-25
Roadmap item marked GA — label applied 2026-08-21
--attach appears in a stable gh release — v2.99.0, 2026-09-01
Summary
The official CLI now has native image/video attachment.
gh-imageis mentioned in that thread) — closed as completed 2026-08-25Status as of 2026-09-08: released.
--attachshipped inghv2.99.0 on 2026-09-01, announced the same day as GitHub CLI: Media in issues, pull requests, and comments and described there as generally available on all plans. The roadmap item picked up aGAlabel on 2026-08-21 and is still open with no milestone. v2.100.0 (2026-09-03) added only attachment telemetry (cli/cli#14327).This issue is tracking/awareness only. It exists so the overlap with
gh-imageis visible and scope, positioning, and README framing can be settled before the release lands.What upstream
--attachdoesA repeatable
--attachflag on six commands, wired inpkg/cmd/{issue,pr}/{create,edit,comment}:gh issue create,gh issue edit,gh issue comment,gh pr create,gh pr edit,gh pr commentPlacement: if the body contains a markdown reference to an attached local path, that reference is rewritten to the uploaded asset URL; otherwise the asset is appended to the end of the body. Images render as
; videos render as a bare URL on its own line, or[name](url)when the reference sits inline.Alt text handling: supplied after
#, defaulting to the filename with its extension stripped and remaining dots replaced by spaces, mirroring the web uploader. Alt text is escaped, and refused outright when it cannot be rendered safely. Videos take no alt text.Constraints as released (
internal/attachmentsat v2.99.0, verified 2026-09-08 — unchanged from the merge)gh --attach.png.jpg.jpeg.gif.webp.svg.mp4.mov.webmgho_(OAuth),ghp_(classic PAT),github_pat_(fine-grained). Everything else →unsupported authentication type, which coversghs_(ActionsGITHUB_TOKEN, app installation) andghu_(user-to-server)ADMIN,MAINTAIN,WRITE, measured against their upload endpoint — the code notes READ and TRIAGE get a 404 there.ghe.com). On-prem GHES is refused:attaching files is not supported on GitHub Enterprise ServerOther validation, all client-side: an empty
--attachvalue, stdin, directories, non-regular files, zero-byte files, and the same file attached twice are each rejected before any upload.Non-image/video attachments are not in scope; that ask became cli/cli#14194, which is open, unassigned, and carries the standard backlog reply — "we are not committing to implementing this feature at this time."
Where
gh-imagestill differsUpstream now covers the common case: a user with write access on GitHub.com attaching a PNG or MP4 to an issue or PR they are creating or commenting on. The README should stop implying the official CLI cannot do this.
Confirmed gaps
ADMIN/MAINTAIN/WRITE. Our browser-session path does not: Write-access requirement is overstated, and invalid sessions fall into the wrong error branch #41 records a successful end-to-end upload against a public repo where the account heldpullonly, which is why the write-access wording was removed fromtoken.goand the README. The two tools use different endpoints — upstream posts touploads.github.com/user-attachments/assetswith a bearer token and a numeric repository id, while we obtain anuploadTokenfrom the repo page and go throughupload/policies/assets→ S3 → finalize — so their permission floor does not apply to us. Scope of the test: public repo, read-only. Private-repo read-only and TRIAGE are untested.ghtool. There is noattachmentcommand upstream, and the package documentation is explicit that the flag only exists inline and the caller must write the returned markdown to a resource. A standalone primitive was requested in #13256 and not built.blockedandextension-idea, with maintainers stating the platform lacks an attachments API and directing requests to GitHub support rather than the CLI repo. cli/cli#11584 was closed as not planned, with the same explanation: no public API exists for attachment upload or download. Demand there is the same agent-driven use case Support downloading attachments from issues/PRs #42 was opened for.Mostly not a difference
ghs_andghu_, so a workflow attaching a screenshot needs a PAT. This is a platform limit rather than a CLI decision, and it binds our bearer path too: cli/cli#14309 reports the endpoint returning404for an installation token with write access, where the same request withgho_succeeds. What remains on our side is the session-cookie path driven byGH_SESSION_TOKEN, which does run in CI but ties automation to a human session.No longer a difference
for images, a bare URL for videos,[name](url)for other files. We have no width or HTML flags, and upstream additionally ships alt-text syntax with escaping.Also worth noting: cli/cli#14261 documents attachment support in the
ghAgent Skill. We ship a skill of our own, and it should be reviewed against theirs.Related: bearer-token upload (#48)
#48 found that
gh auth tokenworks as aBeareragainsthttps://uploads.github.com/user-attachments/assets, and that the token path accepts images and video but rejects other content types. The upstream implementation matches that from the other direction: same endpoint, same images/video scope, same requirement for elevated repository permission. The browser-session path remains the broader one for both file types and permissions.Community datapoint from the #13256 thread (
@labilio, Windows, 2026-08-11): releasedv1.2.0failed because the browseruser_sessioncookie could not be decrypted in that environment (#4), and a build frommain@d59ac2bbwith the token-first path uploaded successfully using the existingghOAuth token. The token path is doing real work for the users the cookie path loses.What to watch
GA— label applied 2026-08-21--attachappears in a stableghrelease — v2.99.0, 2026-09-01