nano-banana by kingbootoshi/nano-banana-2-skill
npx skills add https://github.com/kingbootoshi/nano-banana-2-skill --skill nano-bananaAI 图像生成命令行工具。默认模型:Gemini 3.1 Flash Image Preview (Nano Banana 2)。
当用户说“init”、“setup nano-banana”或“install nano-banana”时,运行以下命令以在他们的机器上安装此 CLI 工具。无需 sudo 权限。
前提条件: 必须已安装 Bun。如果未安装:curl -fsSL https://bun.sh/install | bash
# 1. 克隆仓库
git clone https://github.com/kingbootoshi/nano-banana-2-skill.git ~/tools/nano-banana-2
# 2. 安装依赖
cd ~/tools/nano-banana-2 && bun install
# 3. 全局链接(通过 Bun 创建 `nano-banana` 命令 - 无需 sudo)
cd ~/tools/nano-banana-2 && bun link
# 4. 设置 API 密钥
mkdir -p ~/.nano-banana
echo "GEMINI_API_KEY=<ask user for their key>" > ~/.nano-banana/.env
初始化后,用户可以在任何地方输入 nano-banana "prompt"。
如果 bun link 失败或链接后找不到命令,请回退到:
mkdir -p ~/.local/bin
ln -sf ~/tools/nano-banana-2/src/cli.ts ~/.local/bin/nano-banana
# 然后确保 ~/.local/bin 在 PATH 中:
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
在此处获取 Gemini API 密钥:https://aistudio.google.com/apikey
nano-banana "prompt" [options]| 选项 | 默认值 | 描述 |
|---|---|---|
-o, --output | nano-gen-{timestamp} | 输出文件名(无扩展名) |
-s, --size | 1K | 图像尺寸:512、1K、2K 或 4K |
-a, --aspect | 模型默认值 | 宽高比:1:1、16:9、9:16、4:3、3:4 等 |
-m, --model | flash | 模型:flash/nb2、pro/nb-pro 或任意模型 ID |
-d, --dir | 当前目录 | 输出目录 |
-r, --ref | - | 参考图像(可多次使用) |
-t, --transparent | - | 在绿幕上生成,移除背景(使用 FFmpeg) |
--api-key | - | Gemini API 密钥(覆盖环境变量/文件) |
--costs | - | 显示成本摘要 |
| 别名 | 模型 | 使用场景 |
|---|---|---|
flash, nb2 | Gemini 3.1 Flash | 默认。快速、便宜(约 $0.067/1K 图像) |
pro, nb-pro | Gemini 3 Pro | 需要最高质量时(约 $0.134/1K 图像) |
| 尺寸 | 成本(Flash) | 成本(Pro) |
|---|---|---|
512 | 约 $0.045 | 仅 Flash 支持 |
1K | 约 $0.067 | 约 $0.134 |
2K | 约 $0.101 | 约 $0.201 |
4K | 约 $0.151 | 约 $0.302 |
支持:1:1、16:9、9:16、4:3、3:4、3:2、2:3、4:5、5:4、21:9
使用 -a 标志:nano-banana "cinematic scene" -a 16:9
nano-banana "minimal dashboard UI with dark theme"
nano-banana "cinematic landscape" -s 2K -a 16:9
nano-banana "quick concept sketch" -s 512
# 默认(Flash - 快速、便宜)
nano-banana "your prompt"
# Pro(最高质量)
nano-banana "detailed portrait" --model pro -s 2K
# 编辑现有图像
nano-banana "change the background to pure white" -r dark-ui.png -o light-ui
# 风格迁移 - 多个参考
nano-banana "combine these two styles" -r style1.png -r style2.png -o combined
nano-banana "robot mascot character" -t -o mascot
nano-banana "pixel art treasure chest" -t -o chest
-t 标志会自动提示 AI 在绿幕上生成,然后使用 FFmpeg 的 colorkey + despill 来抠出背景并移除边缘像素的绿色溢出。实现像素级完美透明,无需手动提示。
要求:brew install ffmpeg imagemagick
要获得特定的输出尺寸:
-r 标志:你的参考/风格图像-r 标志:目标尺寸的空白图像nano-banana "pixel art character in style of first image, 256x256" -r style.png -r blank-256x256.png -o sprite
每次生成都会记录到 ~/.nano-banana/costs.json。查看摘要:
nano-banana --costs
# UI 模型
nano-banana "clean SaaS dashboard with analytics charts, white background"
# 宽屏电影感
nano-banana "cyberpunk cityscape at sunset" -a 16:9 -s 2K
# 使用 Pro 质量的产品图
nano-banana "premium software product hero image" --model pro
# 快速低分辨率概念图
nano-banana "rough sketch of a robot" -s 512
# 深色模式 UI
nano-banana "Premium SaaS chat interface, dark mode, minimal, Linear-style aesthetic"
# 透明游戏资源(自动提示绿幕)
nano-banana "pixel art treasure chest" -t -o chest
# 纵向宽高比
nano-banana "mobile app onboarding screen" -a 9:16
CLI 按以下顺序解析 Gemini API 密钥:
--api-key 标志GEMINI_API_KEY 环境变量.env 文件.env 文件~/.nano-banana/.env每周安装数
187
仓库
GitHub 星标数
247
首次出现
2026年2月28日
安全审计
安装于
opencode180
cline178
codex178
gemini-cli178
kimi-cli178
cursor178
AI image generation CLI. Default model: Gemini 3.1 Flash Image Preview (Nano Banana 2).
When the user says "init", "setup nano-banana", or "install nano-banana", run these commands to get the CLI tool on their machine. No sudo required.
Prerequisites: Bun must be installed. If not: curl -fsSL https://bun.sh/install | bash
# 1. Clone the repo
git clone https://github.com/kingbootoshi/nano-banana-2-skill.git ~/tools/nano-banana-2
# 2. Install dependencies
cd ~/tools/nano-banana-2 && bun install
# 3. Link globally (creates `nano-banana` command via Bun - no sudo)
cd ~/tools/nano-banana-2 && bun link
# 4. Set up API key
mkdir -p ~/.nano-banana
echo "GEMINI_API_KEY=<ask user for their key>" > ~/.nano-banana/.env
After init, the user can type nano-banana "prompt" from anywhere.
If bun link fails or the command is not found after linking, fall back to:
mkdir -p ~/.local/bin
ln -sf ~/tools/nano-banana-2/src/cli.ts ~/.local/bin/nano-banana
# Then ensure ~/.local/bin is on PATH:
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
Get a Gemini API key at: https://aistudio.google.com/apikey
nano-banana "prompt" [options]| Option | Default | Description |
|---|---|---|
-o, --output | nano-gen-{timestamp} | Output filename (no extension) |
-s, --size | 1K | Image size: 512, 1K, 2K, or 4K |
| Alias | Model | Use When |
|---|---|---|
flash, nb2 | Gemini 3.1 Flash | Default. Fast, cheap (~$0.067/1K image) |
pro, nb-pro | Gemini 3 Pro | Highest quality needed (~$0.134/1K image) |
| Size | Cost (Flash) | Cost (Pro) |
|---|---|---|
512 | ~$0.045 | Flash only |
1K | ~$0.067 | ~$0.134 |
2K | ~$0.101 | ~$0.201 |
4K | ~$0.151 | ~$0.302 |
Supported: 1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3, 4:5, 5:4, 21:9
Use -a flag: nano-banana "cinematic scene" -a 16:9
nano-banana "minimal dashboard UI with dark theme"
nano-banana "cinematic landscape" -s 2K -a 16:9
nano-banana "quick concept sketch" -s 512
# Default (Flash - fast, cheap)
nano-banana "your prompt"
# Pro (highest quality)
nano-banana "detailed portrait" --model pro -s 2K
# Edit existing image
nano-banana "change the background to pure white" -r dark-ui.png -o light-ui
# Style transfer - multiple references
nano-banana "combine these two styles" -r style1.png -r style2.png -o combined
nano-banana "robot mascot character" -t -o mascot
nano-banana "pixel art treasure chest" -t -o chest
The -t flag automatically prompts the AI to generate on a green screen, then uses FFmpeg colorkey + despill to key out the background and remove green spill from edge pixels. Pixel-perfect transparency with no manual prompting needed.
Requires: brew install ffmpeg imagemagick
To get a specific output dimension:
-r flag: your reference/style image-r flag: blank image in target dimensionsnano-banana "pixel art character in style of first image, 256x256" -r style.png -r blank-256x256.png -o sprite
Every generation is logged to ~/.nano-banana/costs.json. View summary:
nano-banana --costs
# UI mockups
nano-banana "clean SaaS dashboard with analytics charts, white background"
# Widescreen cinematic
nano-banana "cyberpunk cityscape at sunset" -a 16:9 -s 2K
# Product shots with Pro quality
nano-banana "premium software product hero image" --model pro
# Quick low-res concept
nano-banana "rough sketch of a robot" -s 512
# Dark mode UI
nano-banana "Premium SaaS chat interface, dark mode, minimal, Linear-style aesthetic"
# Game assets with transparency (green screen auto-prompted)
nano-banana "pixel art treasure chest" -t -o chest
# Portrait aspect ratio
nano-banana "mobile app onboarding screen" -a 9:16
The CLI resolves the Gemini API key in this order:
--api-key flagGEMINI_API_KEY environment variable.env file in current directory.env file next to the CLI script~/.nano-banana/.envGet a key at: https://aistudio.google.com/apikey
Weekly Installs
187
Repository
GitHub Stars
247
First Seen
Feb 28, 2026
Security Audits
Gen Agent Trust HubFailSocketFailSnykFail
Installed on
opencode180
cline178
codex178
gemini-cli178
kimi-cli178
cursor178
AI 代码实施计划编写技能 | 自动化开发任务分解与 TDD 流程规划工具
50,900 周安装
-a, --aspect |
| model default |
Aspect ratio: 1:1, 16:9, 9:16, 4:3, 3:4, etc. |
-m, --model | flash | Model: flash/nb2, pro/nb-pro, or any model ID |
-d, --dir | current directory | Output directory |
-r, --ref | - | Reference image (can use multiple times) |
-t, --transparent | - | Generate on green screen, remove background (FFmpeg) |
--api-key | - | Gemini API key (overrides env/file) |
--costs | - | Show cost summary |