Gemini Files API
Purpose
Provide one managed wrapper for Gemini requests that need local audio, video, images, PDFs, or other supported files. This repository owns the wrapper source; installed Codex, OpenCode, Claude Code, and repo-local copies are consumer views.
Setup
Install dependencies once after the skill is installed or updated:
scripts/bootstrap.sh
The wrapper requires Node.js 20 or newer. Authentication is resolved in this order:
GEMINI_API_KEY;GOOGLE_API_KEY;- the macOS Keychain service named by
GEMINI_KEYCHAIN_SERVICE, defaulting togemini_api_key.
Do not store API keys in this skill directory.
Canonical Commands
Run a text-only smoke request:
node scripts/gemini-mm.mjs --prompt "Reply with exactly: OK"
Requests default to the stable gemini-3.5-flash model. Use --model for one
request or GEMINI_MODEL for a local default; dependent skills may select a
separate reviewed model for their own workflow.
Analyze a local file and return the response envelope used by dependent skills:
node scripts/gemini-mm.mjs \
--file path/to/input.m4a \
--prompt "Transcribe the spoken audio." \
--json
Use node scripts/gemini-mm.mjs --help for model, sampling, token, schema,
tool, upload-retention, and file options.
Packaging Rules
node_modulesis never committed or copied as source.scripts/package-lock.jsonis the reviewed dependency pin.scripts/bootstrap.shrecreates dependencies withnpm ci --ignore-scriptsso reviewed packages cannot execute lifecycle scripts during setup.- Uploaded Gemini Files API objects are deleted after each run unless
--keep-filesis explicitly passed. node scripts/test_gemini_mm.mjslocks the reviewed default and quota hint and verifies that SIGINT and SIGTERM wait for uploaded-file cleanup before the wrapper exits.- Consumer copies must be refreshed through the pinned skills manager; do not edit installed copies by hand.
Dependent Skills
meeting-transcription resolves this wrapper from the same repo-local skill
root or the reviewed global Codex/OpenCode and Claude Code manager roots. Install
both managed skills before running the canonical transcription command.