AgentSkillsCN

image-search

在网页上搜索图片(照片、标志、图形),并借助 Typst 嵌入代码将其下载。当用户需要真实场景的图片、公司标志,或为文档选用现有图形时,可使用此功能。

SKILL.md
--- frontmatter
name: image-search
description: Search the web for images (photos, logos, graphics) and download them with Typst embedding code. Use when the user needs real-world images, company logos, or existing graphics for documents.
allowed-tools: Bash
argument-hint: <query> [--logo] [--stock] [--url <url>] [--dir images] [-n 1] [--size large|medium|icon] [--type photo|clipart|face|lineart]

Parse $ARGUMENTS into flags for the bundled script and run it in one Bash call. The script handles search, download, filename generation, and Typst code output.

Flags: query (positional), --logo, --stock, --url <url>, -d dir, -o output, -n count, --size, --type, --width, --caption "..."

Pass --typst when generating images for Typst documents (the typical case). If --output/-o is not given, omit it (script auto-generates from query + dir).

Run exactly one command:

bash
SERPAPI_KEY="$SERPAPI_KEY" uv run --script {baseDir}/scripts/image_search.py "<query>" --typst [other flags...]

If SERPAPI_KEY is empty in this shell, read it from fish: `fish -c 'set fish_greeting; echo $SERPAPI_KEY'` (suppress greeting to avoid ANSI pollution).

For --stock mode, also forward Unsplash/Pexels keys if available:

bash
SERPAPI_KEY="$SERPAPI_KEY" UNSPLASH_ACCESS_KEY="$UNSPLASH_ACCESS_KEY" PEXELS_API_KEY="$PEXELS_API_KEY" uv run --script {baseDir}/scripts/image_search.py "<query>" --stock --typst [other flags...]

Print the script's stdout to the user. Done.

Modes

ModeFlagBehavior
Image search (default)noneSerpAPI -> DuckDuckGo fallback -> download best match
Logo lookup--logoLogo.dev -> image search fallback
Stock photos--stockUnsplash -> Pexels -> image search fallback (license-clear)
Direct URL--url <url>Download image directly from URL

Environment

Zero API keys required — works via DuckDuckGo by default. Each key unlocks a better tier:

KeyPurpose
SERPAPI_KEYGoogle Images (best quality)
UNSPLASH_ACCESS_KEYStock photos via Unsplash
PEXELS_API_KEYStock photos via Pexels