gh-image
Fungsinya
Alat ini mengunggah gambar dari komputer Anda ke GitHub dan membuat tautan agar gambar tersebut bisa dilihat di mana saja. Alat ini berguna untuk menambahkan screenshot atau gambar ke proyek di GitHub.
Kapan dipakai
- βSaat Anda ingin menambahkan gambar ke pull request (PR) di GitHub.
- βUntuk menyertakan gambar dalam issue atau komentar di GitHub.
- βUntuk menampilkan tampilan sebelum dan sesudah perubahan di file README.
Link skill
https://github.com/sickn33/agentic-awesome-skills/blob/main/skills/gh-image/SKILL.mdSalin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.
Cara pakai
Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.
Pesan siap tempel
Untuk Claude Code, Codex, atau Cursor: jalankan di folder proyek, lalu skill langsung terpasang.
Unduh SKILL.md lalu taruh di folder skill agen Anda.
Contoh permintaan ke AI
βLampirkan screenshot ini ke PR saya.β
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
Alat ini mengunggah gambar ke GitHub dan mengembalikan tautan khusus. Tautan ini kemudian dimasukkan ke tempat yang Anda inginkan, misalnya deskripsi PR atau komentar.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.
Upload images to GitHub (gh-image)
GitHub has no public API for image uploads β the web UI uses an internal
endpoint that mints user-attachments URLs scoped to the repo's visibility.
gh-image (MIT, Β© drogers0) replicates
that flow as a gh CLI extension, so an agent can upload a local image from the
terminal and get a ready-to-embed Markdown image line back.
Overview
This skill drives gh-image to turn a local image file into a hosted GitHub
user-attachments URL, then embeds that URL into a pull request, issue, or
comment. It is the missing "attach a screenshot" capability for terminal agents.
When to Use This Skill
Use this skill when asked to:
- "Attach a screenshot to the PR" or "add an image to the PR description"
- "Put this image in the issue" / "comment with these screenshots"
- "Show the test results / before-and-after in the PR"
- Embed any local image into GitHub Markdown without leaving the terminal
How It Works
Step 1: Verify prerequisites
gh auth status # gh installed & authenticated
gh extension list | grep -q 'drogers0/gh-image' \
|| gh extension install drogers0/gh-image # review/pin the extension source first
gh-image does not use the gh token for the upload (that endpoint rejects
tokens). It needs a GitHub user_session cookie, resolved in this order:
--token <value> flag β GH_SESSION_TOKEN env var (use in CI/headless) β a
logged-in browser's cookie store (default for local use).
Step 2: Upload
# Use an absolute path; --repo is optional inside a repo working dir.
gh image "/abs/path/screenshot.png" --repo <owner>/<repo>
gh image prints Markdown to stdout, one line per image:

Capture that output β it is the embeddable reference.
Step 3: Embed into the PR / issue / comment
MD="$(gh image "/abs/path/shot.png" --repo owner/repo)"
BODY="$(gh pr view <pr> --repo owner/repo --json body -q .body)"
printf '%s\n\n## Screenshots\n\n%s\n' "$BODY" "$MD" \
| gh pr edit <pr> --repo owner/repo --body-file -
Use gh pr comment, gh issue edit, or gh issue comment with --body-file -
for other targets. Always pass --body-file - (not inline --body) so multi-line
bodies and special characters can't break shell quoting.
Step 4: Verify
gh pr view <pr> --repo owner/repo --json body -q .body # confirm URL present
Examples
- Attach a CleanShot screenshot to PR #42: upload the file, append it under a
## Screenshotsheading in the PR body. - Embed before/after images in a README: upload both, paste the two Markdown lines into the README at the relevant section.
Best Practices
- Resolve globs to absolute paths first; quote paths with spaces/Unicode.
- For display sizing, embed an HTML tag instead of bare Markdown:
<img width="800" src="https://github.com/user-attachments/assets/<uuid>" />. - In CI, set
GH_SESSION_TOKENfrom a dedicated bot account.
Limitations
- Session cookie required. A
user_sessioncookie grants full account access (not scoped like a PAT) β treat it like a password; use a bot account in CI. - Write access to the target repo is required; orgs that enforce SAML SSO need
the session authorized at
https://github.com/orgs/<org>/ssofirst. - Private-repo images stay private: the
user-attachmentsURL inherits repo visibility, so an anonymous fetch on a private repo returns 404/403 by design. - Windows + Chrome 127+ cannot read cookies (library limitation) β use another
browser or
GH_SESSION_TOKEN. - The skill embeds the Markdown itself;
gh-imageonly prints the URL.
Pertanyaan umum
Apakah saya perlu memasang GitHub di komputer saya?
Ya, Anda perlu memasang alat 'gh' dan mengaturnya agar bisa menggunakan GitHub dari terminal.
Bagaimana alat ini tahu gambar mana yang harus diunggah?
Anda memberikan path file gambar yang tepat di komputer Anda saat membuat permintaan.
Di mana gambar-gambar ini disimpan?
Gambar diunggah ke GitHub dan mengikuti visibilitas repository Anda.
Detail
Deskripsi asli dari pembuat
Upload local images to GitHub and get canonical user-attachments embed URLs; use when asked to attach a screenshot to a PR, issue, or comment, or to embed before/after images in a README.
Popularitas
- Bintang GitHub
- 48k
- Peringkat
- #6277
- Lisensi
- MIT
- Diperbarui
- 15/10/2026
Komentar
- β¦
Skill lain dari repositori ini
00-andruia-consultant
48kMembantu agent Anda memulai atau meningkatkan proyek AI. Agent menganalisis kode, menyarankan tools, dan membuat rencana aksi dalam bahasa Spanyol.
007
48kMemungkinkan agent Anda melakukan audit keamanan dan threat modeling. Berguna untuk melindungi proyek dari serangan dan celah keamanan.
10-andruia-skill-smith
48kMembantu agent Anda membuat atau meningkatkan tools AI. Agent mendefinisikan cara kerja tools, menulis dokumentasi, dan memvalidasi strukturnya.
20-andruia-niche-intelligence
48kMemungkinkan agent Anda membuat ringkasan industri tertentu. Berguna untuk memahami konteks, aturan, pola penggunaan, dan risiko proyek dengan sumber terpercaya.
Skill serupa
gifgrep
394kMemungkinkan agent Anda mencari GIF, melihat pratinjau hasil, mengunduh GIF, dan mengambil satu bingkai diam atau lembar kontak darinya.
meme-maker
394kMemungkinkan agent Anda memilih templat meme, menambahkan teks sendiri, dan membuat meme sebagai gambar SVG atau PNG.
ios-icon-gen
280kMemungkinkan agent Anda membuat ikon untuk aplikasi iOS. Menggunakan simbol Apple atau ikon dari sumber lain untuk membuat file yang tepat.