Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,25 @@ jobs:
run: bun install

- name: Type check
run: bun run tsc --noEmit
run: bun run typecheck

- name: Test build
- name: Build for npm
run: npm run build:js

- name: Test npm CLI
run: node dist/cli.js --help

- name: Test npm pack and install
run: |
npm pack
npm install -g factory-nanobanana-*.tgz
nanobanana --help
nanobanana tips generate

- name: Build standalone binary
run: bun build cli.ts --compile --outfile nanobanana

- name: Test CLI
- name: Test standalone CLI
run: ./nanobanana --help

unit-tests:
Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:

permissions:
contents: write
id-token: write

jobs:
build:
Expand Down Expand Up @@ -109,3 +110,30 @@ jobs:
```

Get an API key at https://aistudio.google.com/apikey

publish-npm:
needs: build
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: '24'
registry-url: 'https://registry.npmjs.org'

- uses: oven-sh/setup-bun@v2
with:
bun-version: latest

- name: Install dependencies
run: bun install

- name: Build for npm
run: npm run build:js

- name: Publish to npm
run: npm publish --access public
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
node_modules/
dist/
nanobanana-output/
nanobanana
nanobanana-linux
Expand Down
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,19 @@
<h1 align="center">nanobanana</h1>

<p align="center">
Gemini image generation from the command line. Single binary, no dependencies.
Gemini image generation from the command line.
</p>

## Installation

### npm (recommended)

```bash
npm install -g @factory/nanobanana
```

### Standalone binary

```bash
# macOS (Apple Silicon)
curl -L https://github.com/Factory-AI/nanobanana-cli/releases/latest/download/nanobanana-darwin-arm64 -o nanobanana
Expand All @@ -29,7 +37,9 @@ chmod +x nanobanana
Invoke-WebRequest -Uri "https://github.com/Factory-AI/nanobanana-cli/releases/latest/download/nanobanana-windows-x64.exe" -OutFile "nanobanana.exe"
```

Then set your API key:
## Setup

Set your API key:

```bash
# macOS/Linux
Expand Down
15 changes: 15 additions & 0 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions cli.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env bun
#!/usr/bin/env node

import {
parseArgs,
Expand All @@ -7,7 +7,7 @@ import {
story,
showTips,
showHelp,
} from "./lib";
} from "./lib.js";

async function main() {
const args = process.argv.slice(2);
Expand Down
34 changes: 29 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,50 @@
{
"name": "nanobanana-cli",
"version": "1.0.0",
"name": "@factory/nanobanana",
"publishConfig": {
"access": "public"
},
"version": "1.0.1",
"description": "CLI for Gemini image generation (Nano Banana Pro)",
"type": "module",
"main": "dist/lib.js",
"types": "dist/lib.d.ts",
"bin": {
"nanobanana": "./cli.ts"
"nanobanana": "dist/cli.js"
},
"files": [
"dist"
],
"scripts": {
"start": "bun run cli.ts",
"test": "bun test",
"test:unit": "bun test tests/unit.test.ts",
"test:e2e": "bun test tests/e2e.test.ts",
"test:integration": "bun test tests/integration.test.ts --timeout 180000",
"typecheck": "tsc -p tsconfig.test.json --noEmit",
"build:js": "tsc",
"build": "bun build cli.ts --compile --outfile nanobanana",
"build:linux": "bun build cli.ts --compile --target=bun-linux-x64 --outfile nanobanana-linux",
"build:mac": "bun build cli.ts --compile --target=bun-darwin-arm64 --outfile nanobanana-mac",
"build:windows": "bun build cli.ts --compile --target=bun-windows-x64 --outfile nanobanana.exe"
"build:windows": "bun build cli.ts --compile --target=bun-windows-x64 --outfile nanobanana.exe",
"prepublishOnly": "npm run build:js"
},
"keywords": ["gemini", "image-generation", "ai", "cli"],
"keywords": ["gemini", "image-generation", "ai", "cli", "generative-ai"],
"author": "Eno Reyes",
"license": "Apache-2.0",
"repository": {
"type": "git",
"url": "https://github.com/Factory-AI/nanobanana-cli.git"
},
"homepage": "https://github.com/Factory-AI/nanobanana-cli#readme",
"engines": {
"node": ">=18"
},
"dependencies": {
"@google/genai": "^0.7.0"
},
"devDependencies": {
"@types/bun": "^1.3.6",
"@types/node": "^25.0.9",
"typescript": "^5.9.3"
}
}
11 changes: 6 additions & 5 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
{
"compilerOptions": {
"target": "ES2022",
"module": "ESNext",
"moduleResolution": "bundler",
"module": "NodeNext",
"moduleResolution": "NodeNext",
"esModuleInterop": true,
"strict": true,
"skipLibCheck": true,
"outDir": "dist",
"rootDir": "src",
"declaration": true,
"skipLibCheck": true
"types": ["node"]
},
"include": ["src/**/*"]
"include": ["lib.ts", "cli.ts"],
"exclude": ["dist", "node_modules", "tests"]
}
14 changes: 14 additions & 0 deletions tsconfig.test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"compilerOptions": {
"target": "ES2022",
"module": "ESNext",
"moduleResolution": "bundler",
"esModuleInterop": true,
"strict": true,
"skipLibCheck": true,
"noEmit": true,
"types": ["bun-types"]
},
"include": ["*.ts", "tests/**/*"],
"exclude": ["dist", "node_modules"]
}