imgcmd
v0.0.3
Published
Secure terminal CLI for image generation and AI agent tooling.
Downloads
93
Readme
imgcmd
Powered by Smoonb
Smoonb is the official sponsor of imgcmd. From the same creators of smoonb. Website: https://www.imgcmd.com
imgcmd is a secure CLI for developers who need real image files from prompts without relying on fragile chat-generated code.
Why imgcmd
- Security-first workflow: API keys stay on your machine.
- Reliable output: saves binary PNG files directly to disk.
- Fast developer UX: one command, one result, no editor lock-in.
- Agentic Tooling support: teach Copilot and Cursor to call imgcmd natively.
Installation
Install globally so the command is available system-wide:
npm install -g imgcmdAfter installation, imgcmd is available in any terminal directory.
Configuration
Use IMGCMD-prefixed variables as the primary configuration layer for predictable behavior in local and agent-driven workflows.
Set your API key (preferred and legacy fallback):
export IMGCMD_GEMINI_API_KEY="your_google_api_key"
# Fallback (legacy compatibility)
export GEMINI_API_KEY="your_google_api_key"Optional default model (preferred and fallback):
export IMGCMD_MODEL="gemini-3.1-flash-image-preview"
# Fallback (legacy compatibility)
export GEMINI_MODEL="gemini-3.1-flash-image-preview"Optional language preference at environment level:
export IMGCMD_LANGUAGE="en"Sovereign override for safety-sensitive agent flows:
export IMGCMD_FORCE_MODEL="gemini-3.1-flash-image-preview"When IMGCMD_FORCE_MODEL is set, it overrides all CLI model flags and other model settings.
Agentic Tooling
imgcmd can generate editor rules so your AI assistant uses the CLI instead of trying to produce SVG/Base64 code directly in chat.
Automatic setup
imgcmd -c vscode
imgcmd -c cursorGenerated rule files:
- VS Code:
.github/copilot-instructions.md - Cursor:
.cursor/rules/imgcmd.mdc
Manual setup
Create the correct rule file and paste this template:
# Image Generation Rules
When asked to create an image, DO NOT generate code (SVG/Base64).
Always use the system CLI through the terminal:
`imgcmd "detailed prompt" --dir <destination_folder>`For Cursor, include this frontmatter at the top of .cursor/rules/imgcmd.mdc:
---
description: Rules for image generation via imgcmd CLI
globs: "*"
---Language Support
imgcmd automatically detects your terminal language from system locale variables.
- Supported built-in languages: English (
en) and Portuguese (pt) - Default fallback language: English (
en) - You can force the language manually with:
imgcmd --lang en "your prompt"
imgcmd --lang pt "seu prompt"Rule generation via --create-rule is intentionally written in English for better AI model interoperability.
Usage Examples
Basic usage:
imgcmd "A minimal rocket icon, transparent background"Organize output folders:
imgcmd "Landing page hero illustration" --dir assets/imgQuick model selection:
imgcmd "Modern analytics dashboard concept" --3.1Explicit model control:
imgcmd "Campaign mascot in 3D" -m <specific_model_name>CLI Flags
--2.5: usegemini-2.5-flash-image--3.1: usegemini-3.1-flash-image-preview-m,--model <name>: set explicit model name-d,--dir <folder>: output directory-c,--create-rule <ide>: generate AI rules (vscodeorcursor)--lang <id>: force language (enorpt)-h,--help: show help
.env setup
Create a .env file in the project root:
IMGCMD_GEMINI_API_KEY=your_google_api_key
IMGCMD_MODEL=gemini-3.1-flash-image-preview
IMGCMD_LANGUAGE=en
# Optional sovereign override:
IMGCMD_FORCE_MODEL=gemini-3.1-flash-image-previewThe optional sovereign override (IMGCMD_FORCE_MODEL) is a safety control for teams and AI agents: it locks the model at environment level so no CLI flag (-m, --2.5, --3.1) can switch to a different model by mistake.
When IMGCMD_FORCE_MODEL is set in .env, that value always wins, even if an AI agent sends a prompt command with another model parameter.
Legacy compatibility remains available via GEMINI_API_KEY and GEMINI_MODEL.
Model precedence:
IMGCMD_FORCE_MODEL(enforced override)-m/--modelor--2.5/--3.1IMGCMD_MODELGEMINI_MODEL- internal default fallback
About the Creators
imgcmd is a free tool maintained by the smoonb.com team and owned by Goalmoon Tecnologia LTDA.
If you like this project, check Smoonb to discover a broader platform for sales productivity and AI-enhanced operations.
Supa Moonbase (smoonb)
Complete Supabase backup and migration tool.
Backup and restore: complete and simple, as it should be.
Developed and owned by: Goalmoon Tecnologia LTDA
Website: https://www.smoonb.com
GitHub: https://github.com/almmello/smoonb
Objective
smoonb solves the problem of tools that only back up the PostgreSQL database while ignoring critical Supabase components.
Backup Components
smoonb performs full backup coverage of your Supabase project:
- Database PostgreSQL (full backup via pg_dumpall and split SQL files, matching Dashboard behavior)
- Database extensions and settings
- Custom roles
- Edge Functions (automatic download from server)
- Auth settings (via Management API)
- Storage buckets (metadata, settings, and files via Management API + Supabase Client, ZIP in Dashboard format)
- Realtime settings (7 parameters captured interactively)
- Supabase .temp files
- Migrations (all project migrations via supabase migration fetch)
License
This project is licensed under MIT. See LICENSE for details.
