upload-photo · diff

git:20260704.5cd7a86 to git:20260904.25c1014

16 added, 34 removed. Audit A to A.

---
name: upload-photo
- description: upload a photo/image/screenshot, host an image, get a public image URL, put images on Vercel Blob, embed images in a PR/comment/doc. Upload local images to Vercel Blob and print public URLs.
+ description: Attach a screenshot/image/video to a PR or issue, or embed an image in a GitHub comment.
---
- # Skill: upload-photo
-
- Upload local image files to Vercel Blob and return public URLs for sharing.
-
- ## When to use
-
- Use whenever an image or screenshot needs a public URL, including PR comments, docs, and sharing.
-
- ## Requires
+ # Upload Photo
- `BLOB_READ_WRITE_TOKEN` must be set in the environment. If it is missing, use the `get-env-var` skill to fetch it from Infisical:
+ Use GitHub CLI 2.99 or newer. Check and upgrade it if needed:
- ```bash
- export BLOB_READ_WRITE_TOKEN="$(infisical secrets get BLOB_READ_WRITE_TOKEN --plain --silent)"
+ ```sh
+ gh --version
+ brew upgrade gh
```
- ## Upload
-
- Run the bundled script from the repo root:
+ Attach a file to a new comment, putting alt text after `#`:
- ```bash
- node .opencode/skills/upload-photo/scripts/upload.mjs <file.png> [more files...] [--prefix <path/prefix>] [--stable]
+ ```sh
+ gh pr comment <n> --attach './shot.png#Alt text'
+ gh issue comment <n> --attach './shot.png#Alt text'
```
- It prints one public URL per line (`https://<store>.public.blob.vercel-storage.com/...`). `--prefix` defaults to `uploads/<YYYY-MM-DD>`. By default Vercel Blob appends a random suffix to the pathname for collision safety; `--stable` disables that (`x-add-random-suffix: 0`) for deterministic URLs, so overwrites are possible.
-
- ## Embed
-
- Use Markdown:
-
- ```markdown
- ![alt](url)
- ```
+ `gh pr create`, `gh pr edit`, `gh issue create`, and `gh issue edit` also accept repeatable `--attach` flags, with at most 50 files.
- Or HTML for size control in GitHub comments:
+ To place an image in the body, reference the same path:
- ```html
- <img src="url" width="700">
+ ```sh
+ printf '![Alt text](./shot.png)\n' | gh pr comment <n> --body-file - --attach './shot.png#Alt text'
```
- ## Rules
+ GitHub rewrites that Markdown reference to the uploaded asset. Unreferenced attachments are appended to the comment.
- - Never log `BLOB_READ_WRITE_TOKEN`.
- - The store is public; do not upload anything sensitive.
- - Prefer PNG, JPEG, or WebP images.
+ There is no standalone “get a URL” command. The asset URL lives in the posted comment; read it back with `gh api repos/{owner}/{repo}/issues/comments/<id> --jq .body`.