CLI for Gemini image generation
Project description
Nano Banana CLI
CLI tool for generating and editing images using Google's Gemini 3 Pro and Gemini 3.1 Flash image generation models.
Installation
pip install nanobanana
Then set your API key (get one from Google AI Studio):
export GEMINI_API_KEY=your-api-key-here
Add the export to your ~/.zshrc or ~/.bashrc to persist it.
Usage
# Generate a new image
nanobanana "a cute banana wearing sunglasses"
# With options
nanobanana "a futuristic city at sunset" -a 16:9 -r 2K -o city.png
# Edit an existing image
nanobanana "add a hat and sunglasses" -e input.png -o output.png
# Use Google Search grounding for real-time info
nanobanana "visualize today's weather in Tokyo" -s
# Use Google Image Search grounding explicitly
nanobanana "A detailed painting of a Timareta butterfly" -i
# Use reference images for style or content guidance
nanobanana "a cute cat in this style" --reference style_image.png -o cat.png
nanobanana "a mix of these people" -ref person1.png person2.png
# Enable High Thinking reasoning for difficult visual generation prompts
nanobanana "A futuristic city built inside a giant glass bottle floating in space" -t high
# Fall back to Gemini 3 Pro instead of default Gemini 3.1 Flash
nanobanana "a dog flying a kite" -p
Options
| Flag | Description | Default |
|---|---|---|
-o, --output |
Output file path | nanobanana_TIMESTAMP.png |
-a, --aspect-ratio |
1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9, 1:4, 4:1, 1:8, 8:1 |
1:1 |
-r, --resolution |
0.5K, 1K, 2K, 4K |
1K |
-e, --edit |
Edit an existing image (provide input path) | - |
-ref, --reference |
One or more reference images to guide generation | - |
-s, --search |
Use Google Search grounding | - |
-i, --image-search |
Use Google Image Search grounding | - |
-p, --pro |
Use the Gemini 3 Pro model instead of 3.1 Flash | - |
-t, --thinking |
Thinking reasoning level (minimal or high) |
- |
Development
git clone https://github.com/YishenTu/nanobanana.git
cd nanobanana
uv sync
cp .env.example .env # Add your GEMINI_API_KEY
uv run nanobanana "test prompt"
Global Access
For global access, add to your shell profile (~/.zshrc or ~/.bashrc):
alias nanobanana='uv run --project /path/to/nanobanana nanobanana'
Claude Code Skill
The skill is fully self-contained. Just copy and set API key!
Requirements: Python 3.12+ (pre-installed on most systems)
-
Copy the skill folder:
cp -r skills/nanobanana ~/.claude/skills/
-
Set your API key in
~/.zshrcor~/.bashrc:export GEMINI_API_KEY="your-api-key-here"
That's it! Claude will automatically use this skill when you ask it to generate or edit images. Python dependencies auto-install on first run.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bananagen-0.2.0.tar.gz.
File metadata
- Download URL: bananagen-0.2.0.tar.gz
- Upload date:
- Size: 5.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2197c24f62c26dfadf0d14cd2b4976b7d1c2a86b1a0cfd4267a08bc329d892d6
|
|
| MD5 |
816c1c721b201d15b19d7dde9c6b427f
|
|
| BLAKE2b-256 |
330b6358e257033077b79bdb2795e2162db1b6f23e0987a62b405b0e989e6d49
|
Provenance
The following attestation bundles were made for bananagen-0.2.0.tar.gz:
Publisher:
publish.yml on YishenTu/nanobanana
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bananagen-0.2.0.tar.gz -
Subject digest:
2197c24f62c26dfadf0d14cd2b4976b7d1c2a86b1a0cfd4267a08bc329d892d6 - Sigstore transparency entry: 1001677012
- Sigstore integration time:
-
Permalink:
YishenTu/nanobanana@4c2594dd1789209a1fb20c4cefbfc382ee618674 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/YishenTu
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@4c2594dd1789209a1fb20c4cefbfc382ee618674 -
Trigger Event:
release
-
Statement type:
File details
Details for the file bananagen-0.2.0-py3-none-any.whl.
File metadata
- Download URL: bananagen-0.2.0-py3-none-any.whl
- Upload date:
- Size: 6.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c1f555b85f8b729138f580a41013c12337d37b12458248ef8a6d43d543e965a4
|
|
| MD5 |
3845b6cbf3c121f3094ae1449ec6c400
|
|
| BLAKE2b-256 |
ecff9c91c4c8c543ab26e24bec8ec524e9bb850d0e37fae3e3643cfa135afd15
|
Provenance
The following attestation bundles were made for bananagen-0.2.0-py3-none-any.whl:
Publisher:
publish.yml on YishenTu/nanobanana
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bananagen-0.2.0-py3-none-any.whl -
Subject digest:
c1f555b85f8b729138f580a41013c12337d37b12458248ef8a6d43d543e965a4 - Sigstore transparency entry: 1001677018
- Sigstore integration time:
-
Permalink:
YishenTu/nanobanana@4c2594dd1789209a1fb20c4cefbfc382ee618674 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/YishenTu
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@4c2594dd1789209a1fb20c4cefbfc382ee618674 -
Trigger Event:
release
-
Statement type: