DO
Download Image
Search for an image on the web and download it to ~/Downloads
Install
mkdir -p .claude/skills/download-image && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/14241" && unzip -o skill.zip -d .claude/skills/download-image && rm skill.zipInstalls to .claude/skills/download-image
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Search for an image on the web and download it to ~/Downloads61 charsno explicit “when” trigger
About this skill
Download Image Skill
This skill allows you to download an image from the internet based on a search query.
Instructions
When the user asks you to download an image based on a search query:
- Search and Extract Image URL:
- Use the
browser_subagenttool. - Pass the search query as part of the
Taskdescription. For example: "Search for '[Search Query]' on Google Images or Bing Images. Find a high resolution, clear, and relevant image. Extract and return the direct URL of the high-resolution image." - Set
RecordingNameto something likesearch_image_[keyword].
- Use the
- Download the Image:
- Once the
browser_subagentreturns the direct image URL, use therun_commandtool to download it usingcurlto the~/Downloadsdirectory. - Construct the filename using the search query, replacing spaces with underscores or hyphens.
- Conflict Resolution: Check if the file already exists (e.g., using
[ -f "$filename" ]in bash). If it does, append the current timestamp to the filename before downloading. - Example bash snippet to handle downloading and renaming (you can run this directly with
run_command):# Variables URL="<IMAGE_URL>" SEARCH_QUERY="<SEARCH_QUERY>" DIR="$HOME/Downloads" # Sanitize filename SAFE_NAME=$(echo "$SEARCH_QUERY" | tr ' ' '_') # Determine extension from URL, default to jpg EXT="${URL##*.}" # Keep extension simple if it contains query params EXT=$(echo "$EXT" | cut -d'?' -f1) if [[ ! "$EXT" =~ ^(jpg|jpeg|png|webp|gif|svg)$ ]]; then EXT="jpg" fi FILEPATH="$DIR/${SAFE_NAME}.${EXT}" # Conflict resolution if [ -f "$FILEPATH" ]; then TIMESTAMP=$(date +%Y%m%d%H%M%S) FILEPATH="$DIR/${SAFE_NAME}_${TIMESTAMP}.${EXT}" fi echo "Downloading to $FILEPATH" curl -s -L "$URL" -o "$FILEPATH"
- Once the
- Confirm Execution: Let the user know the file has been downloaded and provide the final file path.