본문으로 건너뛰기
Skillpedia
배포 및 클라우드 (DevOps)40k · #7221

gh-attach

하는 일

이 도구는 이미지나 문서 같은 파일을 GitHub에 올려 버그 보고나 코드 리뷰 요청 같은 토론에서 쓸 수 있도록 돕습니다. 또한 GitHub에 올라온 파일을 내려받을 수도 있습니다.

사용하는 경우

  • ✓버그 보고서에 이미지를 추가해야 할 때.
  • ✓코드 변경 요청에 파일을 포함할 때.
  • ✓GitHub에서 누군가 공유한 파일을 내려받고 싶을 때.

스킬 링크

https://github.com/github/awesome-copilot/blob/main/skills/gh-attach/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/github/awesome-copilot/blob/main/skills/gh-attach/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“이 스크린샷을 제 버그 보고서에 첨부해 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

내부에서는 도구가 특별한 GitHub 명령을 사용해 파일을 보냅니다. 그런 다음 GitHub이 자동으로 이해하고 표시하는 링크를 줍니다. 내려받을 때는 같은 링크와 사용자의 GitHub 로그인을 사용해 파일을 가져옵니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

gh-attach

gh attach uploads a file to GitHub's internal user-attachments endpoint (no public API exists) and prints the URL, which GitHub auto-renders (image/video/file) wherever it's pasted. The URL inherits the repo's visibility, so private-repo uploads stay private.

Prerequisites

gh extension list | grep -q 'gh attach' || gh extension install sudosubin/gh-attach

Uploads use a GitHub browser session cookie, not the gh token. By default, gh must be authenticated so gh-attach can select the matching browser account. If the wrong account is selected, add --browser <name> --profile <name>. For headless use, set GH_ATTACH_SESSION_TOKEN to the bare user_session cookie value. Treat it as a full account credential.

Steps

1. Upload: Use an absolute quoted path. -R is optional inside a repository. For GHES, use -R host/owner/repo. The command prints the URL on one line. GitHub auto-renders it (image/video/file), so use it as-is:

URL=$(gh attach "$FILE" -R <owner>/<repo>)

2. Embed (always --body-file -, e.g. gh pr comment/edit, gh issue comment/edit):

printf '## Screenshots\n\n%s\n' "$URL" | gh pr comment <pr> -R <owner>/<repo> --body-file -

3. Download: Specify the destination explicitly. Private attachments use the active gh token, with browser cookies as an authorization fallback:

gh attach download "$URL" -O "$FILE"

Notes

  • Private repo: URL renders only for authorized viewers. An anonymous fetch is expected to return 404 or 403.
  • Sizing: embed <img width="800" src="$URL"> instead of the bare URL.
  • GitHub Cloud and GHES decide which file extensions and content types they accept.
자주 묻는 질문

파일이 비공개 저장소에서 온 것이라면 어떻게 되나요?

비공개 프로젝트에 올린 파일이라면, 그 프로젝트를 볼 권한이 있는 사람만 링크로 파일을 볼 수 있습니다.

토론에 이미지를 넣을 때 크기를 바꿀 수 있나요?

네, 간단한 HTML 코드로 이미지 크기를 지정할 수 있습니다. 예를 들어 `<img width="800" src="FILE_URL">`처럼 씁니다.

어떤 종류의 파일을 올릴 수 있나요?

GitHub이 허용하는 파일 형식과 콘텐츠 유형은 GitHub이 결정합니다. 일반적으로 이미지, PDF, 동영상, zip 파일이 지원됩니다.

상세 정보

작성자의 원본 설명

Uploads a local file (screenshot, image, PDF, zip, video) to GitHub user-attachments, downloads GitHub user-attachments, and embeds local files in a PR, issue, or comment. Use when asked to "attach a screenshot to the PR", "add an image to the issue", "embed before/after screenshots", "attach this file", or "download this GitHub attachment". Powered by `gh-attach`.

repo: github/awesome-copilot

인기도

GitHub 스타
40k
순위
#7221
라이선스
MIT
업데이트
2026. 10. 15.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬