@lucacas05/nanopix
v1.0.0
Published
CLI interactivo para generar imágenes con Google Gemini
Downloads
18
Readme
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
npm ciYou can also install dependencies with npm install for local iteration.
Configuration
Set your Gemini API key before running the CLI:
export GEMINI_API_KEY="your_api_key_here"Usage
Run from the project root:
npm startor directly:
node index.jsYou can also expose the nanopix command locally with:
npm link
nanopixHow it Works
- The CLI asks for a prompt (
Prompt:) - It calls Gemini's image generation endpoint
- It extracts the image bytes from the API response
- It writes a PNG file in
img/using the next availableIMG-N.pngnumber
Project Structure
index.js- CLI flow, API request, and image writing logicimg/- Generated images (gitignored)package.json- Project metadata and scripts
Troubleshooting
GEMINI_API_KEY is not set: export the key in your shell and retryThe API did not return any image: try a different or more specific promptHTTP <status>errors: verify your API key and Gemini API access
License
ISC
