#14527·cli

[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:

bash
$ gh issue artifact delete --help

Output:

Source & reproduction
bash
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 1560

gh 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: --yes skips 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, --yes is 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:

bash
$ gh issue artifact delete 142 2

Output:

Source & reproduction
bash
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 1360

Input:

bash
$ y

Output:

Source & reproduction
bash
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
Expected effects
  • Artifact 2 no longer exists on the issue

Several artifacts

Input:

bash
$ gh issue artifact delete 142 2 5

Output:

Source & reproduction
bash
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 1360

Input:

bash
$ y

Output:

Source & reproduction
bash
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
Expected effects
  • Artifacts 2 and 5 no longer exist on the issue

Declined

Input:

bash
$ gh issue artifact delete 142 2

Output:

Source & reproduction
bash
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
Expected effects
  • Artifact 2 still exists on the issue

With --yes

Input:

bash
$ gh issue artifact delete 142 2 5 --yes

Output:

Source & reproduction
bash
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
Expected effects
  • Artifacts 2 and 5 no longer exist on the issue

By URL

Input:

bash
$ gh issue artifact delete https://github.com/monalisa/monas-cafe/issues/142/artifacts/2 https://github.com/monalisa/monas-cafe/issues/142/artifacts/5 --yes

Output:

Source & reproduction
bash
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
Expected effects
  • Artifacts 2 and 5 no longer exist on the issue

Error: URLs on different issues

Input:

bash
$ gh issue artifact delete https://github.com/monalisa/monas-cafe/issues/142/artifacts/2 https://github.com/monalisa/monas-cafe/issues/137/artifacts/1 --yes

Output:

Source & reproduction
bash
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
Expected effects
  • No artifact was deleted

Some numbers fail

Input:

bash
$ gh issue artifact delete 142 2 9 --yes

Output:

Source & reproduction
bash
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
Expected effects
  • Artifact 2 no longer exists on the issue

Piped output

Input:

bash
$ set -o pipefail

Input:

bash
$ gh issue artifact delete 142 2 9 --yes | cat

Output:

Source & reproduction
bash
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
Expected effects
  • Artifact 2 no longer exists on the issue

Error: no terminal and no --yes

Input:

bash
$ set -o pipefail

Input:

bash
$ gh issue artifact delete 142 2 | cat

Output:

Source & reproduction
bash
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
Expected effects
  • Artifact 2 still exists on the issue

A missing number, without --yes

Input:

bash
$ gh issue artifact delete 142 2 9

Output:

Source & reproduction
bash
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
Expected effects
  • No prompt was shown
  • Artifact 2 still exists on the issue