Visitar URL original
[Design] `gh issue artifact view` · Issue #14524 · cli/cli · GitHub
Skip to content

[Design] gh issue artifact view #14524

Description

@BagToad

gh issue artifact view

Table of Contents

help

Category Scenario
Help view

gh issue artifact view

Category Scenario
Terminal A document
Terminal A link
Terminal By URL
Versions With --version
Scripting Piped output
Scripting Piped output with --version
Browser A link with --web
Browser A document with --web
JSON output With --json
JSON output An earlier version's body
Errors Error: artifact not found
Errors Error: version not found
Errors Error: invalid version
Errors Error: --version with --json

help

What is changing
  • Help: Help for gh issue artifact view

view

Input:

$ gh issue artifact view --help

Output:

Source & reproduction
printf 'Display an issue artifact'\''s name, type, authors, content, and edit history. A
link shows its URL.

Name the artifact by its issue and number, or by its URL. `<issue>` is an
issue number or URL.

By default, the current version is shown. Use `--version` to show an earlier
version from the edit history.

With `--web`, open a document'\''s page on GitHub, or a link'\''s URL.

For more information about output formatting flags, see `gh help formatting`.

\033[0;1;39mUSAGE\033[0m
  gh issue artifact view {<issue> <artifact-number> | <artifact-url>} [flags]

\033[0;1;39mFLAGS\033[0m
  -q, --jq expression     Filter JSON output using a jq expression
      --json fields       Output JSON with the specified fields
  -t, --template string   Format JSON output using a Go template; see "gh help formatting"
      --version number    Show the version with this number from the edit history
  -w, --web               Open a document'\''s page on GitHub, or a link'\''s URL

\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;39mJSON FIELDS\033[0m
  body, bodyHtml, createdAt, creator, description, id, name, number, type,
  updatedAt, updatedByActor, url, versions

\033[0;1;39mEXAMPLES\033[0m
  # View artifact 2 on issue 142
  $ gh issue artifact view 142 2

  # View an earlier version
  $ gh issue artifact view 142 2 --version 5

  # View an artifact by its URL
  $ gh issue artifact view https://github.com/monalisa/monas-cafe/issues/142/artifacts/3

  # Open a link artifact in the browser
  $ gh issue artifact view 142 3 --web

  # Print an artifact'\''s body
  $ gh issue artifact view 142 2 --json body --jq .body

\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-view.ans
freeze help-view.ans --output help-view.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 view

What is changing
  • Terminal: View an artifact like gh issue view, with its body rendered as Markdown and its edit history
  • Terminal: A link shows its URL where the body would be
  • Terminal: An artifact URL can replace the issue and number
  • Versions: --version shows an earlier version, marked Viewing in the edit history
  • Scripting: When piped, view prints key: lines in a fixed order, --, then the body
  • Scripting: When piped with --version, the name, version, editor and body come from that version
  • Browser: --web opens a link artifact's URL in the browser
  • Browser: --web opens a document's page on GitHub
  • JSON output: view takes the same --json fields as list, plus versions
  • JSON output: --json versions has every version the API returns, including each version's body
  • Errors: A missing artifact number shows the API's 404, as returned
  • Errors: A version the API didn't return fails
  • Errors: --version must be at least 1
  • Errors: --version can't be combined with --json or --web

A document

Input:

$ gh issue artifact view 142 2

Output:

Source & reproduction
printf '\033[1m{{artifact_name:OAuth callback plan}}\033[0m {{repo_ref:monalisa/monas-cafe#142}}
\033[38;5;242mArtifact {{number:2}} • generic • {{author:Copilot}} created {{time_ago:about 3 days ago}} • {{author:monalisa}} updated {{time_ago:about 2 hours ago}}\033[0m


  \033[1;38;5;228;48;5;63m {{heading:OAuth callback plan}}\033[0m

  \033[38;5;252m{{body_text:1. Register the callback URL.}}\033[0m
  \033[38;5;252m{{body_text:2. Wire up }}\033[38;5;203;48;5;236m order-history \033[0;38;5;252m sync.\033[0m


\033[1mEdit history\033[0m
12  {{author:monalisa}}  \033[38;5;242m{{time_ago:about 2 hours ago}}\033[0m  \033[0;1;36mCurrent\033[0m
11  {{author:Copilot}}   \033[38;5;242m{{time_ago:about 5 hours ago}}\033[0m
10  {{author:Copilot}}   \033[38;5;242m{{time_ago:about 7 hours ago}}\033[0m
9   {{author:monalisa}}  \033[38;5;242m{{time_ago:about 1 day ago}}\033[0m
8   {{author:Copilot}}   \033[38;5;242m{{time_ago:about 1 day ago}}\033[0m
7   {{author:Copilot}}   \033[38;5;242m{{time_ago:about 1 day ago}}\033[0m
6   {{author:Copilot}}   \033[38;5;242m{{time_ago:about 2 days ago}}\033[0m
5   {{author:monalisa}}  \033[38;5;242m{{time_ago:about 2 days ago}}\033[0m
4   {{author:Copilot}}   \033[38;5;242m{{time_ago:about 2 days ago}}\033[0m
3   {{author:Copilot}}   \033[38;5;242m{{time_ago:about 3 days ago}}\033[0m
2   {{author:Copilot}}   \033[38;5;242m{{time_ago:about 3 days ago}}\033[0m
1   {{author:Copilot}}   \033[38;5;242m{{time_ago:about 3 days ago}}\033[0m

\033[38;5;242mView this artifact on GitHub: {{url:https://github.com/monalisa/monas-cafe/issues/142/artifacts/2}}\033[0m
' > view-document.ans
freeze view-document.ans --output view-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

A link

Input:

$ gh issue artifact view 142 3

Output:

Source & reproduction
printf '\033[1m{{artifact_name:Staging OAuth runbook}}\033[0m {{repo_ref:monalisa/monas-cafe#142}}
\033[38;5;242mArtifact {{number:3}} • link • {{author:Copilot}} created {{time_ago:about 1 day ago}}\033[0m

  {{link_url:https://github.com/monalisa/monas-cafe/wiki/OAuth-runbook}}

\033[1mEdit history\033[0m
1  {{author:Copilot}}  \033[38;5;242m{{time_ago:about 1 day ago}}\033[0m  \033[0;1;36mCurrent\033[0m

\033[38;5;242mView this artifact on GitHub: {{url:https://github.com/monalisa/monas-cafe/issues/142/artifacts/3}}\033[0m
' > view-link.ans
freeze view-link.ans --output view-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

By URL

Input:

$ gh issue artifact view https://github.com/monalisa/monas-cafe/issues/142/artifacts/3

Output:

Source & reproduction
printf '\033[1m{{artifact_name:Staging OAuth runbook}}\033[0m {{repo_ref:monalisa/monas-cafe#142}}
\033[38;5;242mArtifact {{number:3}} • link • {{author:Copilot}} created {{time_ago:about 1 day ago}}\033[0m

  {{link_url:https://github.com/monalisa/monas-cafe/wiki/OAuth-runbook}}

\033[1mEdit history\033[0m
1  {{author:Copilot}}  \033[38;5;242m{{time_ago:about 1 day ago}}\033[0m  \033[0;1;36mCurrent\033[0m

\033[38;5;242mView this artifact on GitHub: {{url:https://github.com/monalisa/monas-cafe/issues/142/artifacts/3}}\033[0m
' > view-by-url.ans
freeze view-by-url.ans --output view-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

With --version

Input:

$ gh issue artifact view 142 2 --version 5

Output:

Source & reproduction
printf '\033[1m{{artifact_name:OAuth plan}}\033[0m {{repo_ref:monalisa/monas-cafe#142}}
\033[38;5;242mArtifact {{number:2}} • generic • Version 5 • {{author:monalisa}} updated {{time_ago:about 2 days ago}}\033[0m


  \033[1;38;5;228;48;5;63m {{heading:OAuth plan}}\033[0m

  \033[38;5;252m{{body_text:1. Register the callback URL.}}\033[0m


\033[1mEdit history\033[0m
12  {{author:monalisa}}  \033[38;5;242m{{time_ago:about 2 hours ago}}\033[0m  \033[0;1;36mCurrent\033[0m
11  {{author:Copilot}}   \033[38;5;242m{{time_ago:about 5 hours ago}}\033[0m
10  {{author:Copilot}}   \033[38;5;242m{{time_ago:about 7 hours ago}}\033[0m
9   {{author:monalisa}}  \033[38;5;242m{{time_ago:about 1 day ago}}\033[0m
8   {{author:Copilot}}   \033[38;5;242m{{time_ago:about 1 day ago}}\033[0m
7   {{author:Copilot}}   \033[38;5;242m{{time_ago:about 1 day ago}}\033[0m
6   {{author:Copilot}}   \033[38;5;242m{{time_ago:about 2 days ago}}\033[0m
5   {{author:monalisa}}  \033[38;5;242m{{time_ago:about 2 days ago}}\033[0m   \033[0;1;36mViewing\033[0m
4   {{author:Copilot}}   \033[38;5;242m{{time_ago:about 2 days ago}}\033[0m
3   {{author:Copilot}}   \033[38;5;242m{{time_ago:about 3 days ago}}\033[0m
2   {{author:Copilot}}   \033[38;5;242m{{time_ago:about 3 days ago}}\033[0m
1   {{author:Copilot}}   \033[38;5;242m{{time_ago:about 3 days ago}}\033[0m

\033[38;5;242mView this artifact on GitHub: {{url:https://github.com/monalisa/monas-cafe/issues/142/artifacts/2}}\033[0m
' > view-version.ans
freeze view-version.ans --output view-version.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

Piped output

Input:

$ gh issue artifact view 142 2 | cat

Output:

Source & reproduction
printf 'name:\t{{artifact_name:OAuth callback plan}}
number:\t{{number:2}}
version:\t12
type:\tgeneric
creator:\t{{author:Copilot}}
created:\t{{timestamp:2026-09-21T23:00:00Z}}
updated-by:\t{{author:monalisa}}
updated:\t{{timestamp:2026-09-24T21:00:00Z}}
url:\t{{url:https://github.com/monalisa/monas-cafe/issues/142/artifacts/2}}
--
# {{heading:OAuth callback plan}}

{{body_text:1. Register the callback URL.}}
{{body_text:2. Wire up `order-history` sync.}}
' > view-piped.ans
freeze view-piped.ans --output view-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

Piped output with --version

Input:

$ gh issue artifact view 142 2 --version 5 | cat

Output:

Source & reproduction
printf 'name:\t{{artifact_name:OAuth plan}}
number:\t{{number:2}}
version:\t5
type:\tgeneric
creator:\t{{author:Copilot}}
created:\t{{timestamp:2026-09-21T23:00:00Z}}
updated-by:\t{{author:monalisa}}
updated:\t{{timestamp:2026-09-22T20:00:00Z}}
url:\t{{url:https://github.com/monalisa/monas-cafe/issues/142/artifacts/2}}
--
# {{heading:OAuth plan}}

{{body_text:1. Register the callback URL.}}
' > view-piped-version.ans
freeze view-piped-version.ans --output view-piped-version.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

A link with --web

Input:

$ gh issue artifact view 142 3 --web

Output:

Source & reproduction
printf 'Opening {{link_url:https://github.com/monalisa/monas-cafe/wiki/OAuth-runbook}} in your browser.
' > view-web-link.ans
freeze view-web-link.ans --output view-web-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
Expected effects

A document with --web

Input:

$ gh issue artifact view 142 2 --web

Output:

Source & reproduction
printf 'Opening {{url:https://github.com/monalisa/monas-cafe/issues/142/artifacts/2}} in your browser.
' > view-web-document.ans
freeze view-web-document.ans --output view-web-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
Expected effects

With --json

Input:

$ gh issue artifact view 142 2 --json number,name,type

Output:

Source & reproduction
printf '\033[1;37m{\033[0m
  \033[1;34m"name"\033[1;37m:\033[0m \033[32m"{{artifact_name:OAuth callback plan}}"\033[1;37m,\033[0m
  \033[1;34m"number"\033[1;37m:\033[0m {{number:2}}\033[1;37m,\033[0m
  \033[1;34m"type"\033[1;37m:\033[0m \033[32m"generic"\033[0m
\033[1;37m}\033[0m
' > view-json.ans
freeze view-json.ans --output view-json.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

An earlier version's body

Input:

$ gh issue artifact view 142 2 --json versions --jq '.versions[] | select(.version == 5) | .body'

Output:

Source & reproduction
printf '# {{heading:OAuth plan}}

{{body_text:1. Register the callback URL.}}
' > view-json-versions.ans
freeze view-json-versions.ans --output view-json-versions.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

Error: artifact not found

Input:

$ gh issue artifact view 142 9

Output:

Source & reproduction
printf 'HTTP 404: Not Found ({{url:https://api.github.com/repos/monalisa/monas-cafe/issues/142/artifacts/9}})
' > view-error-not-found.ans
freeze view-error-not-found.ans --output view-error-not-found.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

Error: version not found

Input:

$ gh issue artifact view 142 2 --version 99

Output:

Source & reproduction
printf 'version 99 not found for artifact 2
' > view-error-version-not-found.ans
freeze view-error-version-not-found.ans --output view-error-version-not-found.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

Error: invalid version

Input:

$ gh issue artifact view 142 2 --version 0

Output:

Source & reproduction
printf 'invalid version: 0
' > view-error-invalid-version.ans
freeze view-error-invalid-version.ans --output view-error-invalid-version.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

Error: --version with --json

Input:

$ gh issue artifact view 142 2 --version 5 --json body

Output:

Source & reproduction
printf 'specify only one of `--version` or `--json`
' > view-error-version-with-json.ans
freeze view-error-version-with-json.ans --output view-error-version-with-json.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

Activity

  1. github-actions commented on Sep 25, 2026

    @github-actions
  2. cli-triage commented on Sep 25, 2026

    @cli-triage

    This is a detailed design proposal for gh issue artifact view (part of the gh issue artifact command family alongside #14523 list, #14525 create, and #14526 edit), authored by a maintainer with concrete terminal mockups, JSON field definitions, and error-case scenarios for each subcommand. It is not a duplicate of #6532 (a broader, older request about workflow-run artifacts, a different feature area), or of its sibling design issues, since each covers a distinct subcommand. The issue already carries the correct enhancement and gh-issue labels, so no additional label changes are suggested.

    Generated by Issue Triage (skills-driven) for #14524 · copilot · auto · 23.8 AIC · ⌖ 2.17 AIC · ⊞ 9.5K · ◷

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementa request to improve CLIgh-issuerelating to the gh issue command

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions