
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
AI-powered CLI for customizable image descriptions using Google's Gemini multimodal models.
CLI tool for generating image metadata in bulk — powered by Gemini for smarter, more context-aware descriptions.
imgdesc is a fast, open-source CLI for turning images into rich captions, alt text, and metadata using Google Gemini. Perfect for developers, content teams, eCommerce, and dataset curators who need instant, consistent descriptions from the terminal.
Requires Node.js >=18.0.0.
Global install:
npm install -g imgdesc
Run without installing:
npx imgdesc --help
Quick start:
npx imgdesc ./images -o result.json --api-key <YOUR_KEY>
Describe all images in a folder and save results to JSON:
imgdesc ./images -o result.json --api-key <YOUR_KEY>
Describe a single image with a custom instruction:
imgdesc ./assets/product.jpg -o desc.txt --instruction "Write SEO product descriptions for eCommerce"
Syntax:
imgdesc <input> [--api-key <key>] [--model <model>] [--instruction <text>] [--output <file>] [--json] [--verbose]
| Flag | Type | Default | Description | Example |
|---|---|---|---|---|
--api-key, -k | string | none | Gemini API key. Falls back to GEMINI_API_KEY/GOOGLE_API_KEY. | -k $GEMINI_API_KEY |
--model, -m | string | gemini-2.0-flash-lite | Gemini multimodal model to target. Supported models: |
- `gemini-2.5-pro`
- `gemini-2.5-flash`
- `gemini-2.5-flash-preview`
- `gemini-2.5-flash-lite`
- `gemini-2.5-flash-lite-preview`
- `gemini-2.0-flash`
- `gemini-2.0-flash-lite`
| Example: --model gemini-2.0-flash-lite |
| --instruction, -i | string | Instructional default prompt | Customizes output tone, length, or format. | -i "Write a playful Instagram caption" |
| --output, -o | string | descriptions.json | File to save generated content; skipped when omitted. | -o captions.json |
| --input (positional) | path | required | Image file or directory to process. Supports JPG, PNG, WebP, GIF, BMP. | imgdesc ./photos |
| --verbose, -v | boolean | false | Prints detailed progress logs while processing. | --verbose |
| --json | boolean | false | Streams JSON results to stdout for piping. | --json > output.json |
| --help, -h | boolean | n/a | Display CLI help and exit. | imgdesc --help |
Single image (desc.txt)
{
"name": "pour-over-coffee-marble-counter.jpg",
"originalName": "morning-pour-over.jpg",
"description": "Handcrafted pour-over coffee setup on a marble counter, sunlight catching the steam while whole beans add a warm, artisanal mood.",
"alt": "Pour-over coffee maker steaming on a marble countertop in morning light",
"tags": ["coffee", "pour over", "morning", "artisan"],
"category": "lifestyle",
"src": "./images/morning-pour-over.jpg"
}
Batch JSON (result.json)
[
{
"name": "minimalist-white-sneaker-three-quarter.jpg",
"originalName": "product-front.jpg",
"description": "Minimalist white sneaker angled three-quarters on a soft beige backdrop, emphasizing breathable mesh and gum outsole for everyday wear.",
"alt": "White mesh sneaker on a beige backdrop at a three-quarter angle",
"tags": ["sneaker", "minimalist", "footwear", "retail"],
"category": "product",
"src": "./assets/product-front.jpg"
},
{
"name": "runner-lacing-sneakers-sunset-stairs.jpg",
"originalName": "product-lifestyle.jpg",
"description": "Runner tying the sneaker on a sunlit city staircase, capturing motion and everyday versatility in golden-hour tones.",
"alt": "Person lacing sneakers on a city staircase at sunset",
"tags": ["lifestyle", "fitness", "sunset", "sneaker"],
"category": "lifestyle",
"src": "./assets/product-lifestyle.jpg"
}
]
--api-key / -k, or rely on environment variables (GEMINI_API_KEY or GOOGLE_API_KEY).export GEMINI_API_KEY="your_api_key_here"
.bashrc, .zshrc, PowerShell profile) or a local .env file if you manage environment loading with tools like dotenv-cli.direnv) to auto-load keys when entering the project.The following Gemini models are supported for image description as of October 2025:
gemini-2.5-progemini-2.5-flashgemini-2.5-flash-previewgemini-2.5-flash-litegemini-2.5-flash-lite-previewgemini-2.0-flashgemini-2.0-flash-liteSpecify the model using the --model or -m flag. If you encounter errors, try switching to another supported model from this list.
Below are frequent runtime messages you may encounter when running imgdesc, what they mean, and how to resolve them. In many cases simply switching to a different available model (e.g. falling back to gemini-2.0-flash) or retrying is enough.
[GoogleGenerativeAI Error]: ... [404 Not Found] models/gemini-2.0-flash is not found for API version v1beta, or is not supported for generateContent.
Why it happens:
gemini-2.0-flash before it is generally available to your key / region).Fix:
gemini-2.0-flashnpx imgdesc example.jpg --model gemini-2.0-flash -k $GEMINI_API_KEY
[GoogleGenerativeAI Error]: ... [503 Service Unavailable] The model is overloaded. Please try again later.
Why it happens: High demand or temporary capacity limits for that model/region.
Fix / Mitigation:
gemini-2.0-flash vs a newer flash release) or temporarily use another supported model if latency is acceptable.[GoogleGenerativeAI Error]: ... [400 Bad Request] API key not valid. Please pass a valid API key. {"reason":"API_KEY_INVALID" ...}
Why it happens:
Fix:
export GEMINI_API_KEY="<NEW_KEY>"
npx imgdesc example.jpg -o out.json
--api-key.You may see a per‑image error message followed by ✅ Output file created and 🎉 Done!. The CLI writes an output file even if some images failed; failed items simply will not have entries. Re-run on the failed subset (or the whole folder—runs are idempotent) after addressing the error.
- Try a known-good model: `--model gemini-2.0-flash`.
--verbose for additional logging context. # Stable flash baseline
npx imgdesc image.jpg -m gemini-2.0-flash -k $GEMINI_API_KEY
If you consistently hit 503 overload errors on a specific model, prefer a different one temporarily rather than rapid-fire retrying—that helps avoid rate limiting and gets you results faster.
Never commit your API key or paste it into issues. If you believe a key was exposed (even in a terminal transcript), rotate it and update your environment variable. Keys shown in examples here are placeholders.
CONTRIBUTING.md (coming soon) for coding standards and release workflow.FAQs
AI-powered CLI for customizable image descriptions using Google's Gemini multimodal models.
We found that imgdesc demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.