| description | Use Bun instead of Node.js, npm, pnpm, or vite. |
|---|---|
| globs | *.ts, package.json |
| alwaysApply | false |
CLI tool for generating images using Google's Imagen API (Gemini Image Models) via Bun.
- Run CLI:
bun index.ts --prompt "..." --output result.png - Install:
bun install - Build (Local):
bun build --compile --minify --sourcemap ./index.ts --outfile banannate - Build (Cross-platform): See README for specific
--targetflags (e.g.,bun-linux-x64,bun-darwin-arm64). - Logo:
bun run logo
- Runtime: Always use Bun. Avoid Node.js standard libraries if a Bun equivalent exists.
- TypeScript: Strictly typed. Use interfaces for API requests/responses and configuration.
- Bun APIs:
Bun.file(path)for file reading/existence checks.Bun.write(path, data)for writing output images.- Native
fetchfor Google Gemini API calls. Bun.argvfor CLI argument access.
- Error Handling: Graceful error messages for API failures (401, 429, 400, 500) and invalid CLI arguments.
- UI: Use
LoadingSpinner(inindex.ts) for progress feedback during long-running API calls. - Commits: Follow Conventional Commits.
The tool supports the following Gemini image generation models (defined in SUPPORTED_MODELS constant):
gemini-2.5-flash-image- Fast, efficient image generationgemini-3-pro-image-preview- High-quality image generation (default)
Model Selection:
- Default model:
gemini-3-pro-image-preview - Override via
--modelCLI flag - Unsupported model names trigger warnings but are still passed to the API
index.ts: CLI entry point, argument parsing, API integration, and main workflow.logo.ts: ASCII art and terminal color constants.CONTRIBUTING.md: Detailed contribution workflow.README.md: Usage documentation and build instructions.