Find the Perfect GIF in Seconds with the Gifgrep Skill
Find the Perfect GIF in Seconds with the Gifgrep Skill
Ever wanted your AI assistant to respond with the perfect GIF? Whether you're building a chatbot that needs personality, creating content, or just want to add some fun to your workflows, the gifgrep skill lets you search, preview, download, and even extract frames from GIFs鈥攁ll from the command line.
What is Gifgrep?
Gifgrep is a powerful CLI tool that searches GIF providers like Tenor and Giphy, lets you browse results in a terminal UI (TUI), download GIFs, and extract stills or contact sheets. It's perfect for:
- Chat bots: Add personality with contextual GIF reactions
- Content creators: Quickly find and download reaction GIFs
- Documentation: Create frame sheets for tutorials or reviews
- Developers: Integrate GIF search into your workflows
Installation
Install gifgrep via Homebrew (macOS/Linux) or Go:
```bash
Via Homebrew (recommended)
brew install steipete/tap/gifgrep
Or via Go
go install github.com/steipete/gifgrep/cmd/gifgrep@latest ```
Verify the installation:
```bash gifgrep --version ```
Quick Search Examples
Basic Search
Find GIFs with a simple query:
```bash
Search for "cats" and get top 5 results
gifgrep cats --max 5
Get just the URLs (pipe-friendly)
gifgrep "thumbs up" --format url | head -n 3
JSON output for scripting
gifgrep search --json "office handshake" | jq '.[0].url' ```
Interactive TUI Mode
Want to browse visually? Launch the terminal UI:
```bash gifgrep tui "happy dance" ```
This opens an interactive browser where you can preview GIFs, navigate with arrow keys, and select the perfect one.
Downloading GIFs
Save GIFs directly to your Downloads folder:
```bash
Download the top result
gifgrep "mind blown" --download --max 1
Download and open in Finder
gifgrep "celebration" --download --reveal ```
The --reveal flag automatically opens the file in Finder (macOS) after downloading.
Extract Stills and Contact Sheets
One of gifgrep's killer features is frame extraction. Need a specific moment or a visual overview?
Single Frame Extraction
```bash
Get frame at 1.5 seconds
gifgrep still ./funny.gif --at 1.5s -o still.png
Get frame at 50% through the GIF
gifgrep still ./reaction.gif --at 50% -o midpoint.png ```
Contact Sheets
Create a grid of sampled frames鈥攇reat for documentation, PRs, or quick reviews:
```bash
9-frame sheet in a 3-column grid
gifgrep sheet ./clip.gif --frames 9 --cols 3 -o sheet.png
More frames with padding
gifgrep sheet ./animation.gif --frames 16 --cols 4 --padding 10 -o overview.png ```
Configuration Tips
Provider Selection
By default, gifgrep uses Tenor. To use Giphy instead (requires API key):
```bash
Use Giphy
export GIPHY_API_KEY="your_key_here" gifgrep "excited" --source giphy
Explicit Tenor
gifgrep "excited" --source tenor ```
Terminal Preview Settings
For terminals with image support (Kitty, Ghostty):
```bash
Enable thumbnail previews
gifgrep cats --thumbs
Tweak preview geometry
export GIFGREP_CELL_ASPECT=0.5 ```
Practical Use Case: Chat Bot Reactions
Here's how you might use gifgrep in a Clawdbot workflow:
```bash
Search and get the top GIF URL
GIF_URL=$(gifgrep "thank you" --format url --max 1 | head -n 1)
Download it for sharing
gifgrep "thank you" --download --max 1 --format url ```
The downloaded file can then be attached to messages using Clawdbot's MEDIA: directive.
Pro Tips
- Use specific queries: "person nodding approval" works better than "yes"
- JSON for automation: The
--jsonflag gives you full metadata including dimensions, tags, and preview URLs - Sheet for documentation: Contact sheets are perfect for showing animation sequences in static docs
- Combine with fzf: Pipe URL output to fzf for fuzzy selection
Conclusion
The gifgrep skill transforms GIF discovery from a browser-based chore into a fast, scriptable workflow. Whether you're adding personality to your AI assistant or building content workflows, it's a fun and practical addition to your Clawdbot toolkit.
Links:
Happy GIF hunting! 馃幀
Comments (0)
No comments yet. Be the first to comment!