unsplash-image — скилл для Claude Code: поиск и скачивание фото
Ищет стоковые фото на Unsplash, скачивает их и по желанию накладывает заголовок с подзаголовком. Пригодится, когда нужна картинка для статьи или обложки.
npx skills add OpenClaudia/openclaudia-skills --skill unsplash-image -a claude-code
npx skills add OpenClaudia/openclaudia-skills --skill stock-images -a claude-codeЧто делает unsplash-image
Скилл оборачивает скрипт ~/.agents/tools/unsplash-search.py: агент вызывает его с поисковым запросом и получает файл на диске. Есть фильтры по ориентации (landscape, portrait, squarish) и цвету, выбор случайного или первого результата, а также режим --list, когда скачивать не нужно, а хочется посмотреть, что нашлось.
Наложение текста включается флагом --title, подзаголовок добавляется через --subtitle. Скрипт рисует полупрозрачную тёмную плашку в нижней части кадра, белый заголовок с тенью и серый подзаголовок, сам переносит слова и подбирает размер шрифта. Для этого нужен Pillow, поэтому заранее поставьте зависимости: pip install requests Pillow. Без --title Pillow не требуется.
Ключ UNSPLASH_CLIENT_ID скрипт берёт из ~/.agents/tools/.env — без него запросы к API не пройдут, это первое, что стоит проверить. Картинки скачиваются в качестве «regular» шириной 1080px; за более высоким разрешением придётся править скрипт на urls.full или urls.raw. Скрипт печатает ссылку на фото, имя фотографа и путь к сохранённому файлу, а также отмечает скачивание в API Unsplash — атрибуция по их правилам обязательна.
Какие задачи решает
- найти стоковое фото по описанию и сохранить его в проект
- сделать обложку для поста с заголовком поверх картинки
- отфильтровать результаты по ориентации под горизонтальный баннер
- посмотреть список найденных фото, ничего не скачивая
- подставить картинку в вёрстку без похода в браузер
Примеры запросов агенту
- найди фото с кофейней и сохрани в ./coffee.jpg
- сделай обложку: картинка про технологии, заголовок «Мой пост», подзаголовок «Короткое описание»
- покажи список результатов по запросу sunset, скачивать не надо
Как установить unsplash-image
1Через Skills CLI (Vercel)
npx skills add OpenClaudia/openclaudia-skills --skill unsplash-image -a claude-codenpx skills add OpenClaudia/openclaudia-skills --skill stock-images -a claude-code2Вручную: положить файлы
~/.claude/skills/stock-images/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/stock-images/
1Через Skills CLI (Vercel)
npx skills add OpenClaudia/openclaudia-skills --skill stock-images -a codex2Вручную: положить файлы
.agents/skills/stock-images/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add OpenClaudia/openclaudia-skills --skill stock-images -a cursor2Вручную: положить файлы
.cursor/skills/stock-images/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install OpenClaudia/openclaudia-skills stock-images2Вручную: положить файлы
.github/skills/stock-images/SKILL.md1Через Skills CLI (Vercel)
npx skills add OpenClaudia/openclaudia-skills --skill stock-images -a gemini-cli2Командой платформы
gemini skills install https://github.com/OpenClaudia/openclaudia-skills --path skills/stock-imagesВручную: положить файлы
.devin/skills/stock-images/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add OpenClaudia/openclaudia-skills --skill stock-images -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о unsplash-image
Как установить unsplash-image в Claude?
Выполните npx skills add OpenClaudia/openclaudia-skills --skill unsplash-image -a claude-code, затем npx skills add OpenClaudia/openclaudia-skills --skill stock-images -a claude-code. Файл скилла окажется в ~/.claude/skills/stock-images/SKILL.md.
Что делает unsplash-image?
Ищет изображения на Unsplash через API и скачивает выбранное в указанный файл. При передаче --title добавляет на картинку заголовок и, если нужно, подзаголовок.
Что нужно для работы скилла?
Ключ UNSPLASH_CLIENT_ID в файле ~/.agents/tools/.env и библиотека requests. Наложение текста требует ещё Pillow: pip install requests Pillow.
Исходный текст
SKILL.md · MIT
--- name: unsplash-image description: Search for images on Unsplash and download them. Optionally add text overlay (title/subtitle) to the image. Use when the user asks to find a stock photo, search for an image, get an Unsplash image, or download a photo with text. argument-hint: [search query] allowed-tools: Bash(*), Read, Write --- # Unsplash Image Search & Download Search Unsplash for images, download them, and optionally add text overlay. ## Tool Location - Script: `~/.agents/tools/unsplash-search.py` - Env file: `~/.agents/tools/.env` (contains `UNSPLASH_CLIENT_ID`) ## Quick Usage ### Search and download a random matching image ```bash python ~/.agents/tools/unsplash-search.py \ --query "nature landscape" \ --output ./image.jpg ``` ### With orientation filter ```bash python ~/.agents/tools/unsplash-search.py \ --query "coffee shop" \ --orientation landscape \ --output ./coffee.jpg ``` ### With text overlay (title and subtitle) ```bash python ~/.agents/tools/unsplash-search.py \ --query "technology abstract" \ --output ./cover.png \ --title "My Blog Post Title" \ --subtitle "A short description" ``` ### List results without downloading ```bash python ~/.agents/tools/unsplash-search.py \ --query "sunset" \ --list ``` ### Pick the first result instead of random ```bash python ~/.agents/tools/unsplash-search.py \ --query "mountains" \ --pick first \ --output ./mountains.jpg ``` ## CLI Options | Option | Description | |--------|-------------| | `--query, -q` | **(Required)** Search query string | | `--output, -o` | **(Required unless --list)** Output file path | | `--orientation` | Filter: `landscape`, `portrait`, or `squarish` | | `--color` | Color filter (e.g., `blue`, `green`, `red`, `black_and_white`) | | `--pick` | How to select from results: `random` (default) or `first` | | `--title` | Title text to overlay on the image | | `--subtitle` | Subtitle text to overlay (only used with --title) | | `--list` | List search results instead of downloading | | `--count` | Number of results to fetch, max 30 (default: 30) | ## Text Overlay When `--title` is provided, the script adds a text overlay to the bottom portion of the image with: - Semi-transparent dark background behind the text - White title text with shadow - Gray subtitle text (if provided) - Automatic word wrapping and font sizing **Requires Pillow**: `pip install Pillow` ## Dependencies - `requests` (for API calls and image download) - `Pillow` (only needed if using text overlay with `--title`) Install if needed: ```bash pip install requests Pillow ``` ## Output The script prints: - The download URL - Photographer attribution (required by Unsplash) - The saved file path - Confirmation of text overlay if applied ## Notes - Unsplash API guidelines require attribution. The script prints photographer info. - The script triggers Unsplash's download tracking endpoint as required by their API terms. - Images are downloaded at "regular" quality (1080px width). For higher resolution, modify the script to use `urls.full` or `urls.raw`.
© OpenClaudia · MIT · OpenClaudia/openclaudia-skills