gifgrep
Search GIF providers, download results, extract stills.
SKILL.mdoptional-skills/media/gifgrep/SKILL.md
GitHubgifgrep Skill
Search GIF providers (Tenor and Giphy) with the gifgrep CLI or its TUI, download results, and extract stills or contact sheets. Requires the gifgrep binary. API keys are optional for Tenor and required for Giphy.
When to Use
- User asks for a GIF for a reaction, a chat reply, docs, or a PR
- Searching Tenor or Giphy by query, previewing results, and downloading one
- Extracting a still frame or a contact sheet from a GIF file
Prerequisites
- Install
gifgrep:brew install steipete/tap/gifgrep, orgo install github.com/steipete/gifgrep/cmd/gifgrep@latest GIPHY_API_KEYis required for--source giphy;TENOR_API_KEYis optional (a Tenor demo key is used if unset). Keys live in the Hermes.env(secrets only); never print them.- Run commands with the
terminaltool. Still previews with--thumbswork in Kitty and Ghostty only.
How to Run
- Search with the
terminaltool, preview the results, then download the chosen one. - Use
--format urlor--jsonfor pipe-friendly output; use the TUI for browsing. - Extract stills or sheets from a downloaded file with
gifgrep still/gifgrep sheet.
Quick Reference
gifgrep cats --max 5
gifgrep cats --format url
gifgrep search --json cats
gifgrep tui "office handshake"
gifgrep cats --download --max 1 --format url
Stills and sheets:
gifgrep still ./clip.gif --at 1.5s -o still.png
gifgrep sheet ./clip.gif --frames 9 --cols 3 -o sheet.png
Providers:
gifgrep cats --source auto
gifgrep cats --source tenor
gifgrep cats --source giphy
--download saves to ~/Downloads; --reveal shows the last download in Finder. --json prints an array of results (id, title, url, preview_url, tags, width, height). Sheets are a single PNG grid of sampled frames; tune with --frames (count), --cols (grid width), and --padding (spacing).
Procedure
- Search:
gifgrep <query> --max 5, orgifgrep search --json <query>for structured results. Pick the source with--source auto|tenor|giphywhen the user names one. - Preview: use the TUI (
gifgrep tui "query") for browsing, or--thumbsfor CLI still previews in Kitty/Ghostty. - Download:
gifgrep <query> --download --max 1 --format urlfor the top result, or download a specific result from the JSON output. - Verify the asset before recommending or using it (see GIF asset hygiene below).
- Extract:
gifgrep still <file> --at <time> -o <png>for one frame,gifgrep sheet <file> --frames <n> --cols <n> -o <png>for a grid. - Report the local file path and the source URL with attribution.
GIF asset hygiene
- Before recommending or using an animated GIF URL, verify it resolves successfully, has
Content-Type: image/gif, and is actually animated (multiple frames or loop metadata; inspect withfile,identify, or a small script). - Record attribution, license, and source URL alongside the asset.
- Do not hotlink when a local asset is needed: download or copy it into the project and reference the local file.
Pitfalls
- Giphy search fails without
GIPHY_API_KEY. Tenor works without a key on the demo key; if Tenor results look wrong, check whether a key is set. --downloadsaves to~/Downloads, not the working directory. Say where the file landed.- A URL that no longer resolves, or that serves a still image instead of an animated GIF, is not usable as a GIF. Verify before sending it on.
- TUI mode is interactive and cannot run headless. In a non-interactive run, use the CLI flags and
--jsoninstead.
Verification
- After a download, confirm the file exists in
~/Downloads(or the--outpath) andfilereports it as a GIF. - After a still or sheet extraction, confirm the PNG exists and view it with
vision_analyzewhen the user asks what it shows. - Before sharing a GIF URL, confirm it resolves and serves
Content-Type: image/gif.