gh issue artifact create
Table of Contents
help
gh issue artifact create
help
What is changing
- Help: Help for
gh issue artifact create
create
Input:
$ gh issue artifact create --help
Output:

Source & reproduction
printf 'Create one artifact for each file or URL. A text file becomes a document
named after the file; add `#<name>` to choose a different name. A URL, or a
`.url` Internet Shortcut file, becomes a link; a URL is named after its host.
Artifact names can'\''t contain some characters, such as parentheses. When a
file'\''s name has them, gh drops them: `plan (1).md` is named `plan 1.md`.
Use `--body` to create a single document from text, or `--body-file` to create
one artifact from a file (`-` reads standard input). `--name` sets its name.
Documents are saved as `generic` unless `--type plan` is given. A plan
currently behaves the same as a generic document.
\033[0;1;39mUSAGE\033[0m
gh issue artifact create {<issue-number> | <issue-url>} [<file>[#<name>] | <url>]... [flags]
\033[0;1;39mALIASES\033[0m
gh issue artifact add, gh issue artifact new
\033[0;1;39mFLAGS\033[0m
--attach file Attach an image or video file, in '\''<file>#<image alt text>'\'' format
-b, --body string Content for a single document
-F, --body-file file Read content for a single artifact from file (use "-" to read from standard input)
--name string Name for a single artifact
--type string Type for documents: {generic|plan}
\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
# Create a document from a file
$ gh issue artifact create 142 signin-plan.md
# Create documents from two files, naming the first
$ gh issue artifact create 142 '\''docs/signin-plan.md#Sign-in plan'\'' oauth-research.md
# Create a link
$ gh issue artifact create 142 https://github.com/monalisa/monas-cafe/wiki/OAuth-runbook --name '\''Staging OAuth runbook'\''
# Create a document from standard input
$ cat order-sync.log | gh issue artifact create 142 --body-file - --name '\''Order sync log'\''
# Upload a screenshot that the document references
$ gh issue artifact create 142 signin-plan.md --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-create.ans
freeze help-create.ans --output help-create.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 create
What is changing
- Files: Create an artifact from a file, named after the file
- Files: Name an artifact with the text after
#, parsed like --attach alt text
- Files: A
# inside a file name works, because the longest existing path wins
- Files: Characters an artifact name can't contain are removed from names taken from file names
- Files: Create one artifact per file
- No file: Create an artifact from standard input, which requires
--name
- No file: Create an artifact from inline text
- Files:
--type plan saves a document as a plan; files still default to generic
- Links: A URL argument creates a link artifact, named by
--name
- Links: A URL without
--name is named after its host
- Links: A
.url Internet Shortcut file creates a link artifact
- Attachments: Upload images with
--attach, rewrite references to them, and append the rest
- Attachments: A file's Markdown references resolve against that file's directory
- Attachments: A reference that matches nothing next to its file falls back to the working directory
- Attachments: With several files, each attachment replaces its references in whichever files use it
- Errors: With several files, an attachment no file references is an error, and nothing is uploaded or created
- Scripting: When piped, each artifact gets a
<status>\t<number>\t<name>\t<source>\t<reason> line on stdout, in argument order
- Scripting: When piped, failures are also lines on stdout, with an empty number and a reason, and the command exits 1
- Errors: Content without a file name needs
--name
- Errors: With no file, URL,
--body or --body-file, create fails with a usage error and never reads stdin implicitly
- Errors:
--name only applies when creating one artifact
- Errors: Files cannot be combined with
--body or --body-file
- Errors:
--type only applies to documents, since links come from URLs and .url files
- Errors: A
.url file without a usable URL is rejected before anything is created
- Errors: Binary files are rejected before anything is created, like
gh gist create
- Errors: An empty or whitespace-only file is rejected before anything is created, like
gh gist create
- Errors: Size limits are the server's; an oversized file fails on its own line while the others are created
- Errors: Without permission to write artifacts, the API's 404 message is the reason
- Files: A symlinked file is read like any other file, and named by the path as typed
From a file
Input:
$ gh issue artifact create 142 signin-plan.md
Output:

Source & reproduction
printf '\033[0;32m✓\033[0m Created artifact {{number:6}} ({{artifact_name:signin-plan.md}}) on {{repo_ref:monalisa/monas-cafe#142}}
' > create-from-file.ans
freeze create-from-file.ans --output create-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
Expected effects
- A new generic artifact named "signin-plan.md" exists on the issue
- The artifact body is exactly the contents of signin-plan.md
From a file, with #<name>
Input:
$ gh issue artifact create 142 'docs/signin-plan.md#Sign-in plan'
Output:

Source & reproduction
printf '\033[0;32m✓\033[0m Created artifact {{number:6}} ({{artifact_name:Sign-in plan}}) on {{repo_ref:monalisa/monas-cafe#142}}
' > create-named-from-file.ans
freeze create-named-from-file.ans --output create-named-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
Expected effects
- A new generic artifact named "Sign-in plan" exists on the issue
- The artifact body is exactly the contents of docs/signin-plan.md
A file name containing #
Input:
$ printf '# Barista notes\n\nRound 2 feedback.\n' > 'barista-notes#2.md'
Input:
$ gh issue artifact create 142 'barista-notes#2.md#Barista notes round 2'
Output:

Source & reproduction
printf '\033[0;32m✓\033[0m Created artifact {{number:6}} ({{artifact_name:Barista notes round 2}}) on {{repo_ref:monalisa/monas-cafe#142}}
' > create-file-name-with-hash.ans
freeze create-file-name-with-hash.ans --output create-file-name-with-hash.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 new generic artifact named "Barista notes round 2" exists on the issue
- The artifact body is exactly the contents of barista-notes#2.md
A file name the server wouldn't accept
Input:
$ printf '# Sign-in plan\n' > 'signin-plan (1).md'
Input:
$ gh issue artifact create 142 'signin-plan (1).md'
Output:

Source & reproduction
printf '\033[0;32m✓\033[0m Created artifact {{number:6}} ({{artifact_name:signin-plan 1.md}}) on {{repo_ref:monalisa/monas-cafe#142}}
' > create-name-cleaned-up.ans
freeze create-name-cleaned-up.ans --output create-name-cleaned-up.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 new generic artifact named "signin-plan 1.md" exists on the issue
From several files
Input:
$ gh issue artifact create 142 signin-plan.md oauth-research.md
Output:

Source & reproduction
printf '\033[0;32m✓\033[0m Created artifact {{number:6}} ({{artifact_name:signin-plan.md}}) on {{repo_ref:monalisa/monas-cafe#142}}
\033[0;32m✓\033[0m Created artifact {{number:7}} ({{artifact_name:oauth-research.md}}) on {{repo_ref:monalisa/monas-cafe#142}}
' > create-multiple-files.ans
freeze create-multiple-files.ans --output create-multiple-files.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
- Two new generic artifacts named "signin-plan.md" and "oauth-research.md" exist on the issue
From standard input
Input:
$ cat oauth-research.md | gh issue artifact create 142 --name 'OAuth research notes' --body-file -
Output:

Source & reproduction
printf '\033[0;32m✓\033[0m Created artifact {{number:6}} ({{artifact_name:OAuth research notes}}) on {{repo_ref:monalisa/monas-cafe#142}}
' > create-from-stdin.ans
freeze create-from-stdin.ans --output create-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
Expected effects
- A new generic artifact named "OAuth research notes" exists with the piped content as its body
From --body
Input:
$ gh issue artifact create 142 --name 'Root cause' --body 'The order sync skipped decaf orders.'
Output:

Source & reproduction
printf '\033[0;32m✓\033[0m Created artifact {{number:6}} ({{artifact_name:Root cause}}) on {{repo_ref:monalisa/monas-cafe#142}}
' > create-from-body.ans
freeze create-from-body.ans --output create-from-body.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 new generic artifact named "Root cause" exists with the given text as its body
A plan, with --type plan
Input:
$ gh issue artifact create 142 signin-plan.md --type plan
Output:

Source & reproduction
printf '\033[0;32m✓\033[0m Created artifact {{number:6}} ({{artifact_name:signin-plan.md}}) on {{repo_ref:monalisa/monas-cafe#142}}
' > create-plan.ans
freeze create-plan.ans --output create-plan.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 new artifact of type "plan" named "signin-plan.md" exists on the issue
From a URL
Input:
$ gh issue artifact create 142 https://github.com/monalisa/monas-cafe/wiki/OAuth-runbook --name 'Staging OAuth runbook'
Output:

Source & reproduction
printf '\033[0;32m✓\033[0m Created artifact {{number:6}} ({{artifact_name:Staging OAuth runbook}}) on {{repo_ref:monalisa/monas-cafe#142}}
' > create-link-from-url.ans
freeze create-link-from-url.ans --output create-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
Expected effects
From a URL, without --name
Input:
$ gh issue artifact create 142 https://github.com/monalisa/monas-cafe/wiki/OAuth-runbook
Output:

Source & reproduction
printf '\033[0;32m✓\033[0m Created artifact {{number:6}} ({{artifact_name:github.com}}) on {{repo_ref:monalisa/monas-cafe#142}}
' > create-link-default-name.ans
freeze create-link-default-name.ans --output create-link-default-name.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
From a .url file
Input:
$ printf '[InternetShortcut]\r\nURL=https://github.com/monalisa/monas-cafe/wiki/OAuth-runbook\r\n' > oauth-runbook.url
Input:
$ gh issue artifact create 142 oauth-runbook.url
Output:

Source & reproduction
printf '\033[0;32m✓\033[0m Created artifact {{number:6}} ({{artifact_name:oauth-runbook.url}}) on {{repo_ref:monalisa/monas-cafe#142}}
' > create-link-from-url-file.ans
freeze create-link-from-url-file.ans --output create-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
Expected effects
With --attach
Input:
$ printf '# Sign-in plan\n\n\n' > signin-plan.md
Input:
$ gh issue artifact create 142 signin-plan.md --attach signin-flow.png --attach landing-page.png
Output:

Source & reproduction
printf '\033[0;32m✓\033[0m Created artifact {{number:6}} ({{artifact_name:signin-plan.md}}) on {{repo_ref:monalisa/monas-cafe#142}}
' > create-with-attach.ans
freeze create-with-attach.ans --output create-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
Expected effects
- The artifact body references an uploaded https://github.com/user-attachments/assets/ URL instead of ./signin-flow.png
- The uploaded landing-page.png is appended to the end of the artifact body
- The local signin-plan.md is unchanged
File in another directory
Input:
$ printf '\n' > docs/signin-plan.md
Input:
$ gh issue artifact create 142 docs/signin-plan.md --attach docs/signin-flow.png
Output:

Source & reproduction
printf '\033[0;32m✓\033[0m Created artifact {{number:6}} ({{artifact_name:signin-plan.md}}) on {{repo_ref:monalisa/monas-cafe#142}}
' > create-attach-from-subdirectory.ans
freeze create-attach-from-subdirectory.ans --output create-attach-from-subdirectory.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
- The artifact body references the uploaded sign-in flow image in place of ./signin-flow.png
- Nothing is appended to the body
Working directory fallback
Input:
$ printf '\n' > /tmp/barista-notes.md
Input:
$ gh issue artifact create 142 /tmp/barista-notes.md --attach ./menu-photo.png
Output:

Source & reproduction
printf '\033[0;32m✓\033[0m Created artifact {{number:6}} ({{artifact_name:barista-notes.md}}) on {{repo_ref:monalisa/monas-cafe#142}}
' > create-attach-cwd-fallback.ans
freeze create-attach-cwd-fallback.ans --output create-attach-cwd-fallback.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
- The artifact body references the uploaded menu-photo.png in place of ./menu-photo.png
- Nothing is appended to the body
Several files with --attach
Input:
$ gh issue artifact create 142 signin-plan.md barista-notes.md --attach signin-flow.png
Output:

Source & reproduction
printf '\033[0;32m✓\033[0m Created artifact {{number:6}} ({{artifact_name:signin-plan.md}}) on {{repo_ref:monalisa/monas-cafe#142}}
\033[0;32m✓\033[0m Created artifact {{number:7}} ({{artifact_name:barista-notes.md}}) on {{repo_ref:monalisa/monas-cafe#142}}
' > create-multiple-with-attach.ans
freeze create-multiple-with-attach.ans --output create-multiple-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
Expected effects
- Both artifact bodies reference the uploaded signin-flow.png instead of ./signin-flow.png
- Nothing is appended to either body
Error: unreferenced attachment
Input:
$ gh issue artifact create 142 signin-plan.md barista-notes.md --attach signin-flow.png --attach latte-art.png
Output:

Source & reproduction
printf 'no file references latte-art.png; reference it in a file, or attach it when creating a single artifact
' > create-error-unreferenced-attachment.ans
freeze create-error-unreferenced-attachment.ans --output create-error-unreferenced-attachment.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 asset was uploaded and no artifact was created
Piped output
Input:
$ gh issue artifact create 142 docs/signin-plan.md oauth-research.md | cat
Output:

Source & reproduction
printf 'created\t{{number:6}}\t{{artifact_name:signin-plan.md}}\t{{file_name:docs/signin-plan.md}}\t
created\t{{number:7}}\t{{artifact_name:oauth-research.md}}\t{{file_name:oauth-research.md}}\t
' > create-piped-output.ans
freeze create-piped-output.ans --output create-piped-output.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
- Two new generic artifacts exist on the issue, 6 "signin-plan.md" (from docs/signin-plan.md) and 7 "oauth-research.md"
Piped output with a failure
Input:
Input:
$ gh issue artifact create 142 signin-plan.md oauth-research.md | cat
Output:

Source & reproduction
printf 'created\t{{number:6}}\t{{artifact_name:signin-plan.md}}\t{{file_name:signin-plan.md}}\t
failed\t\t{{artifact_name:oauth-research.md}}\t{{file_name:oauth-research.md}}\tArtifact storage is temporarily unavailable
' > create-piped-partial-failure.ans
freeze create-piped-partial-failure.ans --output create-piped-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
- Only the "signin-plan.md" artifact was created
Error: --name required
Input:
$ cat oauth-research.md | gh issue artifact create 142 --body-file -
Output:

Source & reproduction
printf '--name is required when the content has no file name
' > create-error-name-required.ans
freeze create-error-name-required.ans --output create-error-name-required.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: nothing to create
Input:
$ gh issue artifact create 142
Output:

Source & reproduction
printf 'specify a file or URL, or use `--body` or `--body-file`
' > create-error-no-content.ans
freeze create-error-no-content.ans --output create-error-no-content.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
Error: --name with several files
Input:
$ gh issue artifact create 142 signin-plan.md oauth-research.md --name Plan
Output:

Source & reproduction
printf '--name can only be used when creating one artifact
' > create-error-name-with-several-files.ans
freeze create-error-name-with-several-files.ans --output create-error-name-with-several-files.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: files and --body together
Input:
$ gh issue artifact create 142 signin-plan.md --name Plan --body 'More text'
Output:

Source & reproduction
printf 'specify files or one of --body and --body-file, not both
' > create-error-files-and-body.ans
freeze create-error-files-and-body.ans --output create-error-files-and-body.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: --type with a link
Input:
$ gh issue artifact create 142 https://github.com/monalisa/monas-cafe/wiki/OAuth-runbook --type plan
Output:

Source & reproduction
printf '--type only applies to documents; links are created from URLs and .url files
' > create-error-type-with-link.ans
freeze create-error-type-with-link.ans --output create-error-type-with-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
Error: unreadable .url file
Input:
$ printf 'https://github.com/monalisa/monas-cafe/wiki/OAuth-runbook\n' > broken.url
Input:
$ gh issue artifact create 142 broken.url
Output:

Source & reproduction
printf 'broken.url: no [InternetShortcut] section; pass the URL as an argument instead
' > create-error-invalid-url-file.ans
freeze create-error-invalid-url-file.ans --output create-error-invalid-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
Expected effects
Error: binary file
Input:
$ gh issue artifact create 142 signin-plan.md signin-flow.png
Output:

Source & reproduction
printf 'failed to create artifact from signin-flow.png: binary file not supported
' > create-error-binary-file.ans
freeze create-error-binary-file.ans --output create-error-binary-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
Expected effects
- No artifact was created, including one for signin-plan.md
Error: empty file
Input:
$ printf '\n \n' > empty.md && gh issue artifact create 142 signin-plan.md empty.md
Output:

Source & reproduction
printf 'failed to create artifact from empty.md: file is empty
' > create-error-empty-file.ans
freeze create-error-empty-file.ans --output create-error-empty-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
Expected effects
- No artifact was created, including one for signin-plan.md
A file over the server's size limit
Input:
$ gh issue artifact create 142 signin-plan.md order-sync.log
Output:

Source & reproduction
printf '\033[0;32m✓\033[0m Created artifact {{number:6}} ({{artifact_name:signin-plan.md}}) on {{repo_ref:monalisa/monas-cafe#142}}
\033[0;31mX\033[0m Failed to create artifact from {{file_name:order-sync.log}}: {{body_text:artifact body exceeds the size limit}}
' > create-too-large.ans
freeze create-too-large.ans --output create-too-large.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
- The "signin-plan.md" artifact was created, and no artifact exists for order-sync.log
Error: no write access
Input:
$ gh issue artifact create 142 signin-plan.md
Output:

Source & reproduction
printf '\033[0;31mX\033[0m Failed to create artifact from {{file_name:signin-plan.md}}: Not Found
' > create-error-no-write-access.ans
freeze create-error-no-write-access.ans --output create-error-no-write-access.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 symlinked file
Input:
$ mkdir -p docs && printf '# Sign-in plan\n' > outside.md && ln -sf ../outside.md docs/signin-plan.md
Input:
$ gh issue artifact create 142 docs/signin-plan.md
Output:

Source & reproduction
printf '\033[0;32m✓\033[0m Created artifact {{number:6}} ({{artifact_name:signin-plan.md}}) on {{repo_ref:monalisa/monas-cafe#142}}
' > create-from-symlink.ans
freeze create-from-symlink.ans --output create-from-symlink.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 new generic artifact named "signin-plan.md" exists on the issue
- The artifact body is exactly the contents of outside.md
gh issue artifact createTable of Contents
helpcreategh issue artifact create#<name>#--body--type plan--name.urlfile--attach--attach--namerequired--namewith several files--bodytogether--typewith a link.urlfilehelpWhat is changing
gh issue artifact createcreateInput:
Output:
Source & reproduction
gh issue artifact createWhat is changing
#, parsed like--attachalt text#inside a file name works, because the longest existing path wins--name--type plansaves a document as a plan; files still default togeneric--name--nameis named after its host.urlInternet Shortcut file creates a link artifact--attach, rewrite references to them, and append the rest<status>\t<number>\t<name>\t<source>\t<reason>line on stdout, in argument order--name--bodyor--body-file, create fails with a usage error and never reads stdin implicitly--nameonly applies when creating one artifact--bodyor--body-file--typeonly applies to documents, since links come from URLs and.urlfiles.urlfile without a usable URL is rejected before anything is createdgh gist creategh gist createFrom a file
Input:
Output:
Source & reproduction
Expected effects
From a file, with
#<name>Input:
$ gh issue artifact create 142 'docs/signin-plan.md#Sign-in plan'Output:
Source & reproduction
Expected effects
A file name containing
#Input:
Input:
$ gh issue artifact create 142 'barista-notes#2.md#Barista notes round 2'Output:
Source & reproduction
Expected effects
A file name the server wouldn't accept
Input:
Input:
$ gh issue artifact create 142 'signin-plan (1).md'Output:
Source & reproduction
Expected effects
From several files
Input:
Output:
Source & reproduction
Expected effects
From standard input
Input:
Output:
Source & reproduction
Expected effects
From
--bodyInput:
Output:
Source & reproduction
Expected effects
A plan, with
--type planInput:
Output:
Source & reproduction
Expected effects
From a URL
Input:
$ gh issue artifact create 142 https://github.com/monalisa/monas-cafe/wiki/OAuth-runbook --name 'Staging OAuth runbook'Output:
Source & reproduction
Expected effects
From a URL, without
--nameInput:
Output:
Source & reproduction
Expected effects
From a
.urlfileInput:
Input:
Output:
Source & reproduction
Expected effects
With
--attachInput:
Input:
Output:
Source & reproduction
Expected effects
File in another directory
Input:
Input:
Output:
Source & reproduction
Expected effects
Working directory fallback
Input:
Input:
Output:
Source & reproduction
Expected effects
Several files with
--attachInput:
Output:
Source & reproduction
Expected effects
Error: unreferenced attachment
Input:
Output:
Source & reproduction
Expected effects
Piped output
Input:
$ gh issue artifact create 142 docs/signin-plan.md oauth-research.md | catOutput:
Source & reproduction
Expected effects
Piped output with a failure
Input:
$ set -o pipefailInput:
$ gh issue artifact create 142 signin-plan.md oauth-research.md | catOutput:
Source & reproduction
Expected effects
Error:
--namerequiredInput:
$ cat oauth-research.md | gh issue artifact create 142 --body-file -Output:
Source & reproduction
Error: nothing to create
Input:
Output:
Source & reproduction
Expected effects
Error:
--namewith several filesInput:
Output:
Source & reproduction
Error: files and
--bodytogetherInput:
$ gh issue artifact create 142 signin-plan.md --name Plan --body 'More text'Output:
Source & reproduction
Error:
--typewith a linkInput:
Output:
Source & reproduction
Expected effects
Error: unreadable
.urlfileInput:
Input:
Output:
Source & reproduction
Expected effects
Error: binary file
Input:
Output:
Source & reproduction
Expected effects
Error: empty file
Input:
Output:
Source & reproduction
Expected effects
A file over the server's size limit
Input:
Output:
Source & reproduction
Expected effects
Error: no write access
Input:
Output:
Source & reproduction
Expected effects
A symlinked file
Input:
Input:
Output:
Source & reproduction
Expected effects