
Security News
/Research
Popular node-ipc npm Package Infected with Credential Stealer
Socket detected malicious node-ipc versions with obfuscated stealer/backdoor behavior in a developing npm supply chain attack.
AI image generation CLI built with Bun + Bunli + AI SDK.
bun add -g ai-img
Or local development:
git clone https://github.com/aryasaatvik/ai-img
cd ai-img
bun install
bun run build
Add to your AI agent:
# For Claude Code
npx skills add aryasaatvik/ai-img -a claude-code
# For OpenCode
npx skills add aryasaatvik/ai-img -a opencode
# For all agents
npx skills add aryasaatvik/ai-img
Or install locally:
npx skills add ./skills/ai-image-gen
See skills/ai-image-gen for full skill documentation.
# Generate images
ai-img generate -p "a cat wearing sunglasses" -o cat.png
# Edit images
ai-img edit -p "make it blue" -i input.png -o output.png
# Batch jobs from JSONL
ai-img batch -i jobs.jsonl -o ./output
# Provider/config status
ai-img status
# Force strict preview rendering (supported on generate/edit)
ai-img generate -p "a cat wearing sunglasses" --image-mode on
ai-img edit -p "make it blue" -i input.png --image-mode on
# Inspect preview mode resolution with explicit flag
ai-img status --image-mode on
# Manage runtime config
ai-img config init
ai-img config init --target project
ai-img config show
ai-img config set aiImg.defaults.provider openai
ai-img config set aiImg.preview.mode auto
ai-img config unset aiImg.defaults.provider
# Generate shell completions
ai-img completions bash
ai-img completions zsh
ai-img completions fish
The completions plugin adds a completions command for Bash/Zsh/Fish.
Quick install patterns:
# Bash (current session)
source <(ai-img completions bash)
# Zsh (save file)
mkdir -p ~/.zsh/completions
ai-img completions zsh > ~/.zsh/completions/_ai-img
# Fish (save file)
ai-img completions fish > ~/.config/fish/completions/ai-img.fish
Supported providers: openai, google, fal.
Credential resolution order is:
aiImg.secrets.<provider>)Environment variable names:
OPENAI_API_KEYGOOGLE_API_KEY, GEMINI_API_KEY, GOOGLE_GENERATIVE_AI_API_KEYFAL_API_KEYConfig is loaded from these sources (deep merged, later overrides earlier):
~/.config/ai-img/config.json.ai-imgrc.ai-imgrc.json.ai-imgrc.local.jsonRuntime precedence is:
config init/set/unset defaults to --target user. Use --target project to write local project config.
Image dimensions are model-aware:
aiImg.defaults.size for size-based models.aiImg.defaults.aspectRatio for aspect-ratio-based models.ai-img uses a blessed model preset when known, otherwise it leaves dimensions unset and uses the provider/model default.size defaults are automatically converted for blessed Google image models when possible.For preview mode specifically, precedence is:
--image-mode flagaiImg.preview.mode configauto{
"aiImg": {
"schemaVersion": 1,
"defaults": {
"provider": "openai",
"model": "gpt-image-1.5",
"size": "1024x1024",
"aspectRatio": "1:1",
"output": "output.png",
"outDir": "./output"
},
"generate": {
"quality": "auto",
"count": 1
},
"edit": {
"count": 1
},
"batch": {
"concurrency": 5,
"maxAttempts": 3
},
"preview": {
"mode": "auto",
"protocol": "auto",
"width": 32
},
"secrets": {
"openai": "...",
"google": "...",
"fal": "..."
}
}
}
Set either size or aspectRatio for a given workflow. If both exist in config, ai-img prefers the model-native option for the selected blessed model.
Batch JSONL jobs can also override dimensions per job with either field:
{"prompt":"Green terminal UI", "aspectRatio":"16:9"}
off, auto, onauto is best-effort and non-fatal when rendering is unavailableon is strict and fails fast before provider API calls when preview is unsupported32 columns; only width is set so aspect ratio is preservedaiImg.schemaVersion defaults to 1 during config load when omittedThe config schema is generated from Zod and published as ai-img.schema.json.
Generate/update it:
bun run generate:schema
Check for drift:
bun run generate:schema:check
Use it in your config file:
{
"$schema": "./ai-img.schema.json",
"aiImg": {
"schemaVersion": 1
}
}
bun run dev
bun run build
bun run typecheck
bun run generate:schema
bun run generate:schema:check
FAQs
AI Image Generation CLI with bunli + AI SDK
We found that ai-img 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
/Research
Socket detected malicious node-ipc versions with obfuscated stealer/backdoor behavior in a developing npm supply chain attack.

Security News
TeamPCP and BreachForums are promoting a Shai-Hulud supply chain attack contest with a $1,000 prize for the biggest package compromise.

Security News
Packagist urges PHP projects to update Composer after a GitHub token format change exposed some GitHub Actions tokens in CI logs.