用途:gifgrep 用于按关键词从 GIF 提供商处搜索、下载 GIF,并可从本地 GIF 中提取静帧或雪碧图,适合智能体在命令行或终端中按需查找与处理动图。
主要能力:支持 Tenor、Giphy 两个来源,可用脚本化 CLI 输出或带内联预览的交互式 TUI。输出模式包括默认的人类可读格式、--json(返回含 id、title、url、preview_url、tags、width、height 的对象数组)、--format url(每行一个 URL,便于管道处理)以及 --thumbs(在 Kitty/iTerm2 终端内联显示静帧缩略图)。支持下载并用 --reveal 在 Finder 中显示。
使用方式:安装可用 brew install steipete/tap/gifgrep,或 go install github.com/steipete/gifgrep/cmd/gifgrep@latest。搜索示例:gifgrep cats --max 5;gifgrep cats --format url | head -n 5;gifgrep cats --json | jq '.[0].url';gifgrep "office handshake" --source giphy --max 3 --json。下载示例:gifgrep cats --download --max 1 --format url;gifgrep cats --download --reveal。提取示例:gifgrep still ./clip.gif --at 1.5s -o still.png;gifgrep sheet ./clip.gif --frames 9 --cols 3 -o sheet.png。交互式界面:gifgrep tui "office handshake"。
来源选择:通过 --source 指定,auto 为默认(设置了 GIPHY_API_KEY 时优先用 Giphy,否则用 Tenor);tenor 在未设置 TENOR_API_KEY 时使用公共演示密钥;giphy 需要 GIPHY_API_KEY。环境变量:TENOR_API_KEY 可选,GIPHY_API_KEY 在使用 --source giphy 时必需。
限制:未提供收费、定价、平台支持范围、配额与速率限制等信息;使用 Giphy 需自行提供 API Key,Tenor 在无 Key 时依赖公共演示密钥。