open-index/open-npm huggingface dataset:
npm package: @lucacas05/nanopix
Description: CLI interactivo para generar imágenes con Google Gemini
Latest version: 1.0.0

# NanoPix

Interactive Node.js CLI to generate images with Google Gemini from text prompts.

## Features

- Prompt-driven image generation from the terminal
- Spinner-based progress feedback while the request is running
- Auto-incremented output files (`IMG-1.png`, `IMG-2.png`, ...)
- Output saved in `img/` under the current working directory
- Graceful exit with `Ctrl+C`

## Requirements

- Node.js 18+
- A valid `GEMINI_API_KEY`

## Installation

```bash
npm ci
```

You can also install dependencies with `npm install` for local iteration.

## Configuration

Set your Gemini API key before running the CLI:

```bash
export GEMINI_API_KEY="your_api_key_here"
```

## Usage

Run from the project root:

```bash
npm start
```

or directly:

```bash
node index.js
```

You can also expose the `nanopix` command locally with:

```bash
npm link
nanopix
```

## How it Works

1. The CLI asks for a prompt (`Prompt:`)
2. It calls Gemini's image generation endpoint
3. It extracts the image bytes from the API response
4. It writes a PNG file in `img/` using the next available `IMG-N.png` number

## Project Structure

- `index.js` - CLI flow, API request, and image writing logic
- `img/` - Generated images (gitignored)
- `package.json` - Project metadata and scripts

## Troubleshooting

- `GEMINI_API_KEY is not set`: export the key in your shell and retry
- `The API did not return any image`: try a different or more specific prompt
- `HTTP <status>` errors: verify your API key and Gemini API access

## License

ISC