From ef1f3d03ac3f117fecd999fc4fa96f557bfa8fe4 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Mon, 6 Apr 2026 11:25:37 +0300 Subject: feat: add --video CLI flag to control Veo video prompt after story generation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add VideoEnabled bool (default true) to Flags, register --video bool flag in command.go, export PromptForGalleryVideos/GenerateSelectedVideos, and wire them into main.go via runStoryVideos — skipped when --video=false. Also update findGalleryPages to walk subdirectories recursively so gallery PNGs inside comics// are discovered from the CWD search root. Co-Authored-By: Claude Sonnet 4.6 --- cmd/totalrecall/main.go | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'cmd') diff --git a/cmd/totalrecall/main.go b/cmd/totalrecall/main.go index 9e64897..2c08497 100644 --- a/cmd/totalrecall/main.go +++ b/cmd/totalrecall/main.go @@ -117,7 +117,10 @@ func runCommand(cmd *cobra.Command, args []string, flags *cli.Flags) error { NarratorVoice: flags.NarratorVoice, Slug: flags.StorySlug, }) - return runner.Run(flags.StoryFile) + if err := runner.Run(flags.StoryFile); err != nil { + return err + } + return runStoryVideos(flags) } // Auto-adjust image size for DALL-E 3 @@ -187,6 +190,25 @@ func runGUIMode(proc *processor.Processor, flags *cli.Flags) error { return nil } +// runStoryVideos is called after the story runner completes. When the +// --video flag is true (default), it prompts the user to select gallery pages +// for Veo video generation and then generates the selected videos. +// Passing --video=false skips the prompt entirely. +func runStoryVideos(flags *cli.Flags) error { + if !flags.VideoEnabled { + return nil + } + + // The story runner writes gallery PNGs into ./comics//, so we search + // from "." recursively to find them regardless of the exact slug. + selected, err := cli.PromptForGalleryVideos(".") + if err != nil { + return fmt.Errorf("video prompt: %w", err) + } + + return cli.GenerateSelectedVideos(cli.GetGoogleAPIKey(), selected, ".") +} + // storyUltraRealistic converts the --no-ultra-realistic bool flag into a *bool // for RunnerConfig. When noUltraRealistic is true, returns a pointer to false // (forcing standard comic style). When false (flag not set), returns nil so -- cgit v1.2.3