npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@lyalindotcom/nanobanana

v0.1.3

Published

Unofficial CLI for Gemini image generation, image editing, and local image utilities.

Readme

Nanobanana

Unofficial npm CLI for Google Gemini image generation, image editing, and local image utilities.

This is not an official Google project and is not endorsed or supported by Google. Use at your own risk. You are responsible for your API keys, billing, prompts, uploaded images, generated outputs, and compliance with applicable terms.

This project is not open source. All rights are reserved. The published npm package is provided for use as distributed; no license is granted to copy, modify, redistribute, sublicense, or reuse the code outside that package without separate written permission from the owner.

Install

npm install -g @lyalindotcom/nanobanana

Run without installing:

npx @lyalindotcom/nanobanana --help

API Key

Configure a Gemini API key once:

nanobanana config set-api-key

Or use an environment variable:

export GEMINI_API_KEY=your-api-key

The CLI also checks NANOBANANA_API_KEY and GOOGLE_API_KEY.

Quick Start

nanobanana generate "a robot playing guitar" -o robot.png
nanobanana generate "make it watercolor" -i photo.jpg -o watercolor.png
nanobanana icon "coffee cup logo" -o ./icons
nanobanana pattern "hexagon grid" -o pattern.png
nanobanana transform image.png -o thumb.png --resize 200x200
nanobanana transparent inspect sprite.png
nanobanana transparent make sprite.png -o sprite-clean.png
nanobanana combine frame1.png frame2.png -o strip.png

Use nanobanana docs or nanobanana <command> --help for the full command reference.

Models

Model selection uses Gemini API model IDs. The package name is not a Gemini model name.

  • flash default: gemini-3.1-flash-image-preview
  • pro: gemini-3-pro-image-preview

Use flash for normal image generation, editing, icons, patterns, and fast iteration. Use pro for more complex prompts, higher-fidelity text rendering, and asset work where the extra cost and latency are acceptable.

Gemini 2.5 image models and old marketing aliases are blocked in this project.

Image Generation

nanobanana generate "studio product photo of a matte black water bottle" -o bottle.png
nanobanana generate "replace the background with a clean desk setup" -i input.png -o edited.png
nanobanana generate "make three logo concepts" -c 3 -o logo.png

Useful flags:

  • -i, --input <path>: add a reference/input image; repeat for multiple images.
  • -p, --prompt-file <path>: read the prompt from a file.
  • -c, --count <count>: generate multiple outputs.
  • --aspect-ratio <ratio>: request an output aspect ratio.
  • --image-size <size>: request 512, 1K, 2K, or 4K where supported.
  • --ground-web: enable Google Search grounding where supported.
  • --ground-image: enable Google Image Search grounding where supported.
  • --history-in <path> and --history-out <path>: resume and save scripted multi-turn image workflows.

Icons And Patterns

nanobanana icon "minimal calendar app icon" -o ./icons --sizes 64,128,256,512
nanobanana pattern "soft geometric blue tile" -o pattern.png --size 1024x1024

Icon output is resized locally into the requested sizes. Pattern output can be generated as seamless patterns, textures, or wallpapers.

Local Image Tools

nanobanana transform image.png -o resized.png --resize 1200x800
nanobanana transform image.png -o cropped.png --crop 40,40,400,400
nanobanana transform image.png -o rotated.png --rotate 90
nanobanana combine a.png b.png c.png -o strip.png --direction horizontal --gap 16
nanobanana combine frame*.png -o grid.png --direction grid --columns 3

Local operations run with sharp; they do not call Gemini.

Transparency

nanobanana transparent inspect sprite.png
nanobanana transparent make logo.png --color white --tolerance 12 -o logo-transparent.png
nanobanana transparent make sprite.png --overwrite

Transparency commands can:

  • Inspect whether an image has an alpha channel.
  • Report image format, dimensions, transparent pixel percentage, and dominant background color.
  • Remove a selected background color and write a transparent PNG.
  • Tune color matching with --tolerance.
  • Write to a new output path or replace the input with --overwrite.

Output

Commands print human-readable output by default. Add --json for script-friendly output:

nanobanana --json generate "small pixel art spaceship" -o ship.png