[Design] `gh issue artifact delete`
Author: BagToadCreated Sep 25, 2026Updated Sep 28, 2026
Labelsenhancementgh-issue
gh issue artifact delete
Table of Contents
help
| Category | Scenario |
|---|---|
| Help | delete |
gh issue artifact delete
| Category | Scenario |
|---|---|
| Confirmation | One artifact |
| Confirmation | Several artifacts |
| Confirmation | Declined |
| Scripting | With --yes |
| Scripting | By URL |
| Errors | Error: URLs on different issues |
| Errors | Some numbers fail |
| Scripting | Piped output |
| Errors | Error: no terminal and no --yes |
| Confirmation | A missing number, without --yes |
help
What is changing- Help: Help for
gh issue artifact delete
delete
Input:
$ gh issue artifact delete --helpOutput:
printf 'Delete artifacts from an issue. A deleted artifact can'\''t be restored.
Name artifacts by their issue and numbers, or by their URLs, which must all be
on one issue. `<issue>` is an issue number or URL.
In a terminal, gh asks for confirmation first. `--yes` skips the prompt, and it
is required when gh can'\''t prompt.
\033[0;1;39mUSAGE\033[0m
gh issue artifact delete {<issue> <artifact-number>... | <artifact-url>...} [flags]
\033[0;1;39mFLAGS\033[0m
--yes Confirm deletion without prompting
\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
# Delete artifact 2 from issue 142
$ gh issue artifact delete 142 2
# Delete two artifacts without a prompt
$ gh issue artifact delete 142 2 5 --yes
\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-delete.ans
freeze help-delete.ans --output help-delete.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 delete
What is changing- Confirmation: Deleting asks for confirmation in a terminal
- Confirmation: One prompt lists every artifact being deleted
- Confirmation: Declining the prompt deletes nothing and exits 2
- Scripting:
--yesskips the confirmation - Scripting: Artifact URLs can replace the issue and numbers
- Errors: Artifact URLs on different issues fail before any request
- Errors: Every number is attempted, failures are reported, and the command exits 1
- Scripting: When piped, each artifact gets a
<status>\t<number>\t<name>\t<source>\t<reason>line on stdout, with an empty source - Errors: Without a terminal,
--yesis required - Confirmation: In a terminal, a number that can't be found stops the command before the prompt, and gh says nothing was deleted
One artifact
Input:
$ gh issue artifact delete 142 2Output:
printf '\033[0;33m!\033[0m Deleted artifacts cannot be recovered.
\033[1;92m?\033[0m \033[1mDelete artifact 2 (OAuth callback plan) from monalisa/monas-cafe#142?\033[0m \033[0;37m(y/N)\033[0m
' > delete-confirm-step1.ans
freeze delete-confirm-step1.ans --output delete-confirm-step1.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 1360Input:
$ yOutput:
printf '\033[0;33m!\033[0m Deleted artifacts cannot be recovered.
\033[1;92m?\033[0m \033[1mDelete artifact 2 (OAuth callback plan) from monalisa/monas-cafe#142?\033[0m \033[0;36mYes\033[0m
\033[0;31m✓\033[0m Deleted artifact {{number:2}} ({{artifact_name:OAuth callback plan}}) from {{repo_ref:monalisa/monas-cafe#142}}
' > delete-confirm-step2.ans
freeze delete-confirm-step2.ans --output delete-confirm-step2.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 no longer exists on the issue
Several artifacts
Input:
$ gh issue artifact delete 142 2 5Output:
printf '\033[0;33m!\033[0m Deleted artifacts cannot be recovered.
\033[1;92m?\033[0m \033[1mDelete artifacts 2 (OAuth callback plan) and 5 (Barista feedback notes) from monalisa/monas-cafe#142?\033[0m \033[0;37m(y/N)\033[0m
' > delete-multiple-confirm-step1.ans
freeze delete-multiple-confirm-step1.ans --output delete-multiple-confirm-step1.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 1360Input:
$ yOutput:
printf '\033[0;31m✓\033[0m Deleted artifact {{number:2}} ({{artifact_name:OAuth callback plan}}) from {{repo_ref:monalisa/monas-cafe#142}}
\033[0;31m✓\033[0m Deleted artifact {{number:5}} ({{artifact_name:Barista feedback notes}}) from {{repo_ref:monalisa/monas-cafe#142}}
' > delete-multiple-confirm-step2.ans
freeze delete-multiple-confirm-step2.ans --output delete-multiple-confirm-step2.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- Artifacts 2 and 5 no longer exist on the issue
Declined
Input:
$ gh issue artifact delete 142 2Output:
printf '\033[0;33m!\033[0m Deleted artifacts cannot be recovered.
\033[1;92m?\033[0m \033[1mDelete artifact 2 (OAuth callback plan) from monalisa/monas-cafe#142?\033[0m \033[0;36mNo\033[0m
' > delete-declined.ans
freeze delete-declined.ans --output delete-declined.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 still exists on the issue
With --yes
Input:
$ gh issue artifact delete 142 2 5 --yesOutput:
printf '\033[0;31m✓\033[0m Deleted artifact {{number:2}} ({{artifact_name:OAuth callback plan}}) from {{repo_ref:monalisa/monas-cafe#142}}
\033[0;31m✓\033[0m Deleted artifact {{number:5}} ({{artifact_name:Barista feedback notes}}) from {{repo_ref:monalisa/monas-cafe#142}}
' > delete-yes.ans
freeze delete-yes.ans --output delete-yes.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- Artifacts 2 and 5 no longer exist on the issue
By URL
Input:
$ gh issue artifact delete https://github.com/monalisa/monas-cafe/issues/142/artifacts/2 https://github.com/monalisa/monas-cafe/issues/142/artifacts/5 --yesOutput:
printf '\033[0;31m✓\033[0m Deleted artifact {{number:2}} ({{artifact_name:OAuth callback plan}}) from {{repo_ref:monalisa/monas-cafe#142}}
\033[0;31m✓\033[0m Deleted artifact {{number:5}} ({{artifact_name:Barista feedback notes}}) from {{repo_ref:monalisa/monas-cafe#142}}
' > delete-by-url.ans
freeze delete-by-url.ans --output delete-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- Artifacts 2 and 5 no longer exist on the issue
Error: URLs on different issues
Input:
$ gh issue artifact delete https://github.com/monalisa/monas-cafe/issues/142/artifacts/2 https://github.com/monalisa/monas-cafe/issues/137/artifacts/1 --yesOutput:
printf 'artifact URLs must all be on the same issue
' > delete-error-urls-on-different-issues.ans
freeze delete-error-urls-on-different-issues.ans --output delete-error-urls-on-different-issues.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- No artifact was deleted
Some numbers fail
Input:
$ gh issue artifact delete 142 2 9 --yesOutput:
printf '\033[0;31m✓\033[0m Deleted artifact {{number:2}} ({{artifact_name:OAuth callback plan}}) from {{repo_ref:monalisa/monas-cafe#142}}
\033[0;31mX\033[0m Failed to delete artifact {{number:9}}: Not Found
' > delete-partial-failure.ans
freeze delete-partial-failure.ans --output delete-partial-failure.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 no longer exists on the issue
Piped output
Input:
$ set -o pipefailInput:
$ gh issue artifact delete 142 2 9 --yes | catOutput:
printf 'deleted\t{{number:2}}\t{{artifact_name:OAuth callback plan}}\t\t
failed\t{{number:9}}\t\t\tNot Found
' > delete-piped.ans
freeze delete-piped.ans --output delete-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 no longer exists on the issue
Error: no terminal and no --yes
Input:
$ set -o pipefailInput:
$ gh issue artifact delete 142 2 | catOutput:
printf '--yes required when not running interactively
' > delete-error-non-interactive.ans
freeze delete-error-non-interactive.ans --output delete-error-non-interactive.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 still exists on the issue
A missing number, without --yes
Input:
$ gh issue artifact delete 142 2 9Output:
printf '\033[0;31mX\033[0m Failed to delete artifact {{number:9}}: Not Found
No artifacts were deleted.
' > delete-missing-before-prompt.ans
freeze delete-missing-before-prompt.ans --output delete-missing-before-prompt.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- No prompt was shown
- Artifact 2 still exists on the issue
Source: cli/cli