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.
Metadata
Release files for bananagen 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| bananagen-0.2.0.tar.gz | 5.5 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| bananagen-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 11.6 kB
Release files / bananagen-0.2.0.tar.gz
| Download URL | bananagen-0.2.0.tar.gz |
|---|---|
| Size | 5.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2197c24f62c26dfadf0d14cd2b4976b7d1c2a86b1a0cfd4267a08bc329d892d6
|
|
BLAKE2b-256 checksum How to use checksums |
330b6358e257033077b79bdb2795e2162db1b6f23e0987a62b405b0e989e6d49
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 27, 2026.
Transparency logRelease files / bananagen-0.2.0-py3-none-any.whl
| Download URL | bananagen-0.2.0-py3-none-any.whl |
|---|---|
| Size | 6.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c1f555b85f8b729138f580a41013c12337d37b12458248ef8a6d43d543e965a4
|
|
BLAKE2b-256 checksum How to use checksums |
ecff9c91c4c8c543ab26e24bec8ec524e9bb850d0e37fae3e3643cfa135afd15
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 27, 2026.
Transparency logSecurity for bananagen 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for bananagen-0.2.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 27, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.