gh-attach
できること
このツールは、画像や文書などのファイルをGitHubにアップロードし、バグ報告やコードレビューの依頼などのディスカッションで使えるようにします。また、GitHubにアップロードされたファイルをダウンロードすることもできます。
使う場面
- ✓バグ報告に画像を追加したいとき。
- ✓コードの変更依頼にファイルを添付したいとき。
- ✓GitHub上で誰かが共有したファイルをダウンロードしたいとき。
スキルのリンク
https://github.com/github/awesome-copilot/blob/main/skills/gh-attach/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
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が決めています。一般的には、画像、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
コメント
- …
このリポジトリの他のスキル
acquire-codebase-knowledge
40kエージェントが、既存のコードプロジェクトを理解してドキュメント化できるよう支援します。新しく参加するメンバーのオンボーディングや、アーキテクチャの全体像の把握に役立ちます。
acreadiness-assess
40kエージェントが、プロジェクトのAI対応状況を評価してレポートを生成できるよう支援します。プロジェクトがAIツールをどの程度活用できる状態にあるかを把握するのに役立ちます。
acreadiness-generate-instructions
40kエージェントが、評価結果をもとにAIツール向けの指示文を作成できるよう支援します。AIがコードとどのようにやり取りするかを改善し、特定された不足点を解消するのに役立ちます。
acreadiness-policy
40kエージェントが、AIプロジェクトの評価ポリシーの策定や適用を支援できるようにします。プロジェクトの評価方法を標準化し、コンプライアンスを確保するのに役立ちます。
似ているスキル
openclaw-update
394k既存のOpenClaw Gatewayを更新するようエージェントを支援します。インストール方法に合った更新方法を選び、セッションを動かし続けます。
diagnose-gateway
394k設定、チャンネル、ポートを確認して、OpenClaw Gatewayが失敗している理由を、何も変更せずに突き止めるようエージェントを支援します。
crabbox-apps
394k一時的なクラウドマシン上でアプリを開いて実行し、そのビューをチャットのサイドパネルに表示するようエージェントを支援します。