Single File Rename¶
This guide covers everything about renaming individual image files.
Basic Usage¶
Preview a Rename (Dry Run)¶
By default, image-namer file shows what the new name would be without making changes:
Output:
╭─────────────────────────────────────────────────╮
│ Proposed Name │
│ web-app-login-screen--username-password.png │
╰─────────────────────────────────────────────────╯
Apply the Rename¶
Add --apply to actually rename the file:
The file screenshot.png is now renamed to web-app-login-screen--username-password.png.
Provider and Model Selection¶
Using Default (Ollama)¶
By default, Image Namer uses Ollama with gemma3:27b:
Using OpenAI¶
To use OpenAI instead:
OpenAI API Key Required
Set OPENAI_API_KEY environment variable before using OpenAI:
Using Different Ollama Models¶
# Use Llama 3 8B model
ollama pull llama3:8b
image-namer file photo.jpg --provider ollama --model llama3:8b --apply
Idempotency¶
Image Namer is idempotent—it won't rename a file if it already has a suitable name.
Example: Already Suitable Name¶
Output:
This prevents unnecessary churn and repeated API calls.
How It Works¶
- Image Namer first assesses if the current filename is suitable
- If suitable, it skips the rename (and caches the assessment)
- If unsuitable, it generates a new name
Collision Handling¶
If the proposed name already exists, Image Namer automatically adds a numeric suffix:
The file is renamed to:
- web-app-login-2.png (if web-app-login.png exists)
- web-app-login-3.png (if both exist)
- And so on...
Updating Markdown References¶
If you have markdown files that reference the image, update them automatically:
This updates:
- Standard markdown:  → 
- Obsidian wiki links: ![[diagram.png]] → ![[system-architecture--microservices-overview.png]]
Specify Reference Root¶
By default, Image Namer searches for markdown files in the current directory. To search elsewhere:
This updates markdown files in ~/Documents/notes that reference diagram.png.
Supported File Formats¶
Image Namer supports these formats:
.png.jpg/.jpeg.gif.webp.bmp.tif/.tiff
Other formats are rejected with an error.
Working with Paths¶
Absolute Paths¶
Relative Paths¶
Current Directory¶
Performance and Caching¶
Image Namer caches results to avoid redundant AI calls.
First Run (Cache Miss)¶
Subsequent Run (Cache Hit)¶
The cache is stored in .image_namer/cache/ and is keyed by:
- Image content hash (SHA-256)
- Provider + model
- Rubric version
See Understanding the Cache for details.
Advanced Options¶
Override Configuration via Environment¶
Set defaults via environment variables:
export LLM_PROVIDER=openai
export LLM_MODEL=gpt-4o
export OPENAI_API_KEY='sk-...'
# Now uses OpenAI by default
image-namer file photo.jpg --apply
CLI flags override environment variables:
Error Handling¶
Unsupported File Type¶
$ image-namer file document.pdf
Unsupported file type '.pdf'. Supported: ['.bmp', '.gif', '.jpeg', ...]
File Not Found¶
Permission Denied¶
OpenAI API Error¶
Solution:
Examples¶
Rename a Screenshot¶
Result: web-dashboard--sales-metrics-chart.png
Rename a Photo¶
Result: mountain-landscape--sunset-over-alpine-lake.jpg
Rename a Diagram¶
Result: architecture-diagram--microservices-api-gateway.png (and updates markdown files)
Next Steps¶
- Batch Folder Processing - Rename multiple files at once
- Updating Markdown References - Keep your notes in sync
- Naming Rubric Reference - Understanding the naming convention