[Design] `gh issue artifact edit`
Author: BagToadCreated Sep 25, 2026Updated Sep 28, 2026
Labelsenhancementgh-issue
gh issue artifact edit
Table of Contents
help
| Category | Scenario |
|---|---|
| Help | edit |
gh issue artifact edit
| Category | Scenario |
|---|---|
| Content | From a file |
| Links | From a .url file |
| Attachments | With --attach |
| Content | With --name |
| Content | By URL |
| Content | From standard input |
| Attachments | Only --attach |
| Errors | Error: nothing to change |
| Links | With a URL |
| Errors | Error: text file for a link |
| Errors | Error: .url file for a document |
| Errors | Error: --attach on a link |
| Errors | Error: --body with --body-file |
| Scripting | Piped output |
help
What is changing- Help: Help for
gh issue artifact edit
edit
Input:
$ gh issue artifact edit --helpOutput:
printf 'Rename an issue artifact or replace its content. The type never changes, so a
link'\''s new content must be an http(s) URL or a `.url` Internet Shortcut file.
Name the artifact by its issue and number, or by its URL. `<issue>` is an
issue number or URL.
With only `--attach`, the attachments are appended to the current content.
\033[0;1;39mUSAGE\033[0m
gh issue artifact edit {<issue> <artifact-number> | <artifact-url>} [flags]
\033[0;1;39mFLAGS\033[0m
--attach file Attach an image or video file, in '\''<file>#<image alt text>'\'' format
-b, --body string New content; for a link, a URL
-F, --body-file file Read new content from file (use "-" to read from standard input)
--name string New name
\033[0;1;39mINHERITED FLAGS\033[0m
--help Show help for command
-R, --repo [HOST/]OWNER/REPO Select another repository using the [HOST/]OWNER/REPO format
\033[0;1;39mEXAMPLES\033[0m
# Rename an artifact
$ gh issue artifact edit 142 2 --name '\''OAuth callback plan v2'\''
# Replace a document'\''s content with a file
$ gh issue artifact edit 142 2 --body-file 2-OAuth-callback-plan.md
# Point a link at a new URL
$ gh issue artifact edit 142 3 --body https://github.com/monalisa/monas-cafe/wiki/OAuth-runbook-v2
# Append a screenshot to a document
$ gh issue artifact edit 142 2 --attach ./signin-flow.png
\033[0;1;39mLEARN MORE\033[0m
Use `gh <command> <subcommand> --help` for more information about a command.
Read the manual at https://cli.github.com/manual
Learn about exit codes using `gh help exit-codes`
Learn about accessibility experiences using `gh help accessibility`
' > help-edit.ans
freeze help-edit.ans --output help-edit.png --language ansi --font.family 'JetBrains Mono,SF Mono,Menlo,monospace' --font.size 12 --line-height 1.4 --window --padding '20,40,20,20' --background '#2b3037' --margin 20 --shadow.blur 6 --border.radius 8 --width 1560gh issue artifact edit
What is changing- Content: Replace an artifact's body with a file's contents
- Links: Update a link artifact from a
.urlfile - Attachments:
--attachalso works when editing, and appends unreferenced attachments - Content: Rename an artifact with
--name, keeping its body - Content: An artifact URL can replace the issue and number
- Content: Replace an artifact's body from standard input
- Attachments:
--attachon its own appends to the artifact's current body - Errors: Editing needs at least one of
--name,--body,--body-fileor--attach - Links: Update a link artifact's URL with
--body - Errors: A link only takes an http(s) URL, from any source, or a
.urlfile, so a text file is rejected - Errors: A
.urlfile can only update a link - Errors:
--attachcan't be used with a link, because a link has no Markdown body - Errors:
--bodyand--body-fileare mutually exclusive - Scripting: When piped, edit prints one
<status>\t<number>\t<name>\t<source>\t<reason>line, likecreateanddelete
From a file
Input:
$ gh issue artifact edit 142 2 --body-file 2-OAuth-callback-plan.mdOutput:
printf '\033[0;32m✓\033[0m Updated artifact {{number:2}} ({{artifact_name:OAuth callback plan}}) on {{repo_ref:monalisa/monas-cafe#142}}
' > edit-body-from-file.ans
freeze edit-body-from-file.ans --output edit-body-from-file.png --language ansi --font.family 'JetBrains Mono,SF Mono,Menlo,monospace' --font.size 12 --line-height 1.4 --window --padding '20,40,20,20' --background '#2b3037' --margin 20 --shadow.blur 6 --border.radius 8 --width 1360- Artifact 2's body is exactly the contents of 2-OAuth-callback-plan.md
- Artifact 2's number, name and type are unchanged
From a .url file
Input:
$ gh issue artifact edit 142 3 --body-file 3-Staging-OAuth-runbook.urlOutput:
printf '\033[0;32m✓\033[0m Updated artifact {{number:3}} ({{artifact_name:Staging OAuth runbook}}) on {{repo_ref:monalisa/monas-cafe#142}}
' > edit-link-from-url-file.ans
freeze edit-link-from-url-file.ans --output edit-link-from-url-file.png --language ansi --font.family 'JetBrains Mono,SF Mono,Menlo,monospace' --font.size 12 --line-height 1.4 --window --padding '20,40,20,20' --background '#2b3037' --margin 20 --shadow.blur 6 --border.radius 8 --width 1360- Artifact 3's body is the URL from the file's URL= line, not the file's raw text
- Artifact 3 is still a link
With --attach
Input:
$ gh issue artifact edit 142 2 --body-file 2-OAuth-callback-plan.md --attach signin-flow.pngOutput:
printf '\033[0;32m✓\033[0m Updated artifact {{number:2}} ({{artifact_name:OAuth callback plan}}) on {{repo_ref:monalisa/monas-cafe#142}}
' > edit-with-attach.ans
freeze edit-with-attach.ans --output edit-with-attach.png --language ansi --font.family 'JetBrains Mono,SF Mono,Menlo,monospace' --font.size 12 --line-height 1.4 --window --padding '20,40,20,20' --background '#2b3037' --margin 20 --shadow.blur 6 --border.radius 8 --width 1360- References to ./signin-flow.png in the new body point to the uploaded asset, or it is appended when unreferenced
With --name
Input:
$ gh issue artifact edit 142 2 --name 'OAuth callback plan v2'Output:
printf '\033[0;32m✓\033[0m Updated artifact {{number:2}} ({{artifact_name:OAuth callback plan v2}}) on {{repo_ref:monalisa/monas-cafe#142}}
' > edit-rename.ans
freeze edit-rename.ans --output edit-rename.png --language ansi --font.family 'JetBrains Mono,SF Mono,Menlo,monospace' --font.size 12 --line-height 1.4 --window --padding '20,40,20,20' --background '#2b3037' --margin 20 --shadow.blur 6 --border.radius 8 --width 1360- Artifact 2 is named "OAuth callback plan v2", and its body, number and type are unchanged
By URL
Input:
$ gh issue artifact edit https://github.com/monalisa/monas-cafe/issues/142/artifacts/2 --name 'OAuth callback plan v2'Output:
printf '\033[0;32m✓\033[0m Updated artifact {{number:2}} ({{artifact_name:OAuth callback plan v2}}) on {{repo_ref:monalisa/monas-cafe#142}}
' > edit-by-url.ans
freeze edit-by-url.ans --output edit-by-url.png --language ansi --font.family 'JetBrains Mono,SF Mono,Menlo,monospace' --font.size 12 --line-height 1.4 --window --padding '20,40,20,20' --background '#2b3037' --margin 20 --shadow.blur 6 --border.radius 8 --width 1360- Artifact 2 is named "OAuth callback plan v2"
From standard input
Input:
$ cat signin-plan-v2.md | gh issue artifact edit 142 2 --body-file -Output:
printf '\033[0;32m✓\033[0m Updated artifact {{number:2}} ({{artifact_name:OAuth callback plan}}) on {{repo_ref:monalisa/monas-cafe#142}}
' > edit-body-from-stdin.ans
freeze edit-body-from-stdin.ans --output edit-body-from-stdin.png --language ansi --font.family 'JetBrains Mono,SF Mono,Menlo,monospace' --font.size 12 --line-height 1.4 --window --padding '20,40,20,20' --background '#2b3037' --margin 20 --shadow.blur 6 --border.radius 8 --width 1360- Artifact 2's body is exactly the piped content, and its name is unchanged
Only --attach
Input:
$ gh issue artifact edit 142 2 --attach signin-flow.pngOutput:
printf '\033[0;32m✓\033[0m Updated artifact {{number:2}} ({{artifact_name:OAuth callback plan}}) on {{repo_ref:monalisa/monas-cafe#142}}
' > edit-attach-only.ans
freeze edit-attach-only.ans --output edit-attach-only.png --language ansi --font.family 'JetBrains Mono,SF Mono,Menlo,monospace' --font.size 12 --line-height 1.4 --window --padding '20,40,20,20' --background '#2b3037' --margin 20 --shadow.blur 6 --border.radius 8 --width 1360- The uploaded signin-flow.png is appended to artifact 2's existing body, and the rest of the body is unchanged
Error: nothing to change
Input:
$ gh issue artifact edit 142 2Output:
printf 'specify at least one of `--name`, `--body`, `--body-file` or `--attach`
' > edit-error-nothing-to-change.ans
freeze edit-error-nothing-to-change.ans --output edit-error-nothing-to-change.png --language ansi --font.family 'JetBrains Mono,SF Mono,Menlo,monospace' --font.size 12 --line-height 1.4 --window --padding '20,40,20,20' --background '#2b3037' --margin 20 --shadow.blur 6 --border.radius 8 --width 1360With a URL
Input:
$ gh issue artifact edit 142 3 --body https://github.com/monalisa/monas-cafe/wiki/OAuth-runbook-v2Output:
printf '\033[0;32m✓\033[0m Updated artifact {{number:3}} ({{artifact_name:Staging OAuth runbook}}) on {{repo_ref:monalisa/monas-cafe#142}}
' > edit-link-from-url.ans
freeze edit-link-from-url.ans --output edit-link-from-url.png --language ansi --font.family 'JetBrains Mono,SF Mono,Menlo,monospace' --font.size 12 --line-height 1.4 --window --padding '20,40,20,20' --background '#2b3037' --margin 20 --shadow.blur 6 --border.radius 8 --width 1360- Artifact 3's body is "https://github.com/monalisa/monas-cafe/wiki/OAuth-runbook-v2", and it is still a link
Error: text file for a link
Input:
$ gh issue artifact edit 142 3 --body-file barista-notes.mdOutput:
printf 'artifact 3 is a link; its new content must be an http(s) URL or a .url file
' > edit-error-link-with-text.ans
freeze edit-error-link-with-text.ans --output edit-error-link-with-text.png --language ansi --font.family 'JetBrains Mono,SF Mono,Menlo,monospace' --font.size 12 --line-height 1.4 --window --padding '20,40,20,20' --background '#2b3037' --margin 20 --shadow.blur 6 --border.radius 8 --width 1360- Artifact 3 is unchanged
Error: .url file for a document
Input:
$ gh issue artifact edit 142 2 --body-file oauth-runbook.urlOutput:
printf 'artifact 2 is not a link; .url files can only update link artifacts
' > edit-error-url-file-for-document.ans
freeze edit-error-url-file-for-document.ans --output edit-error-url-file-for-document.png --language ansi --font.family 'JetBrains Mono,SF Mono,Menlo,monospace' --font.size 12 --line-height 1.4 --window --padding '20,40,20,20' --background '#2b3037' --margin 20 --shadow.blur 6 --border.radius 8 --width 1360- Artifact 2 is unchanged
Error: --attach on a link
Input:
$ gh issue artifact edit 142 3 --attach signin-flow.pngOutput:
printf 'artifact 3 is a link; --attach can'\''t be used with link artifacts
' > edit-error-attach-on-link.ans
freeze edit-error-attach-on-link.ans --output edit-error-attach-on-link.png --language ansi --font.family 'JetBrains Mono,SF Mono,Menlo,monospace' --font.size 12 --line-height 1.4 --window --padding '20,40,20,20' --background '#2b3037' --margin 20 --shadow.blur 6 --border.radius 8 --width 1360- Nothing was uploaded, and artifact 3 is unchanged
Error: --body with --body-file
Input:
$ gh issue artifact edit 142 2 --body 'Text' --body-file signin-plan.mdOutput:
printf 'specify only one of `--body` or `--body-file`
' > edit-error-body-and-body-file.ans
freeze edit-error-body-and-body-file.ans --output edit-error-body-and-body-file.png --language ansi --font.family 'JetBrains Mono,SF Mono,Menlo,monospace' --font.size 12 --line-height 1.4 --window --padding '20,40,20,20' --background '#2b3037' --margin 20 --shadow.blur 6 --border.radius 8 --width 1360Piped output
Input:
$ gh issue artifact edit 142 2 --name 'OAuth callback plan v2' | catOutput:
printf 'updated\t{{number:2}}\t{{artifact_name:OAuth callback plan v2}}\t\t
' > edit-piped.ans
freeze edit-piped.ans --output edit-piped.png --language ansi --font.family 'JetBrains Mono,SF Mono,Menlo,monospace' --font.size 12 --line-height 1.4 --window --padding '20,40,20,20' --background '#2b3037' --margin 20 --shadow.blur 6 --border.radius 8 --width 1360- Artifact 2 is named "OAuth callback plan v2"
Source: cli/cli