Nanobanana

From maragudk/fabrik · View interactive version

Nanobanana is an AI agent skill from the GitHub repository maragudk/fabrik. Guide for generating and editing images using generative AI with the nanobanana CLI

How to use this skill

Skill file

Nanobanana

This is a guide for generating and editing images using the nanobanana CLI tool.

Nanobanana is a command-line interface for Nano Banana 2.1 (gemini-nano-banana-2.1), Google's Gemini image generation model. It is the only model the CLI supports, so there are no model flags.

Installation

If the nanobanana CLI is not already installed, install it using:

go install maragu.dev/nanobanana@latest

Prerequisites

The GOOGLE_API_KEY environment variable must be set, or a .env file with the key must be present in the working directory.

Usage

nanobanana generate [flags] <output-path> <prompt>

Flags must come before the output path, and the prompt must be a single quoted argument. Any extra argument after the prompt (including a flag placed there) is a usage error. Run nanobanana generate -h for the full help text.

Flags

Output format

The output format follows the extension of the output path: .png gives PNG, and .jpg or .jpeg gives JPEG. Pick the extension that matches what the user asked for.

Generating images

nanobanana generate output.png "a beautiful sunset over mountains"

With a specific aspect ratio and size:

nanobanana generate -aspect 16:9 -size 4K wallpaper.jpg "a misty pine forest at dawn"

Editing existing images

To edit or modify an existing image using a text prompt:

nanobanana generate -i input.png output.jpg "make the sky purple and add stars"

Combining several images

Pass -i multiple times (up to 14). Refer to the images by their order in the prompt:

nanobanana generate -i hat.png -i banana.jpg output.png "put the hat from the first image on the banana in the second"

Tips for effective prompts

Examples

Generate a square logo:

nanobanana generate -aspect 1:1 -size 2K logo.png "minimalist tech company logo with geometric shapes in blue and white"

Create concept art:

nanobanana generate -aspect 21:9 concept.jpg "futuristic city skyline at night with neon lights and flying vehicles, cyberpunk style"

Edit an existing photo:

nanobanana generate -i photo.png enhanced.jpg "enhance the colors and make it look like golden hour"
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.