AI-generated feature illustrations now display on story feeds
Gitpulse stories get auto-generated editorial illustrations: the latest PR wires up Gemini image generation to the analyzer pipeline, with a new CLI command for regenerating individual story images without re-running the full analysis.
Feature stories in Gitpulse now get AI-generated editorial illustrations. When a commit's primary category is "feature" and image generation is configured, Gemini creates a contextual image that's uploaded to the configured storage and embedded as imageUrl in the story JSON.
The site renders these images in two layouts: a hero card with the image spanning the full width at the top, and subsequent feature cards using a split layout with image and text alternating left and right by card index. Compact rows remain text-only.
A new gitpulse image command lets operators regenerate a single story's illustration without re-running the full analyzer. It accepts a story JSON path, a GitHub PR URL, or a deployed-site URL with ?story=<id> — when the local file is missing, it fetches the story from the site and writes it locally.
Image generation is opt-in via .gitpulse.json declaring images.ai[[/code] and a [[code]]GEMINI_API_KEY or GOOGLE_API_KEY environment variable. The analyzer logs images: skipped when the feature isn't configured, and proceeds without imageUrl if generation fails.
Security hardening in the image command whitelists story IDs from ?story= query parameters against pr-<n> or commit-<hex> patterns, preventing path traversal. Updated stories are validated against StorySchema before writing. The Gemini call has a 120-second timeout.
Local development UX improvements include auto-loading .env.local (skipped in CI) and walking up the directory tree to find .gitpulse.json, so the CLI works when invoked from cli/ or any subdirectory.
This is the second PR in a three-part series; OpenAI/fal provider support and release-edition images are deferred to PR 3/3.