summaryrefslogtreecommitdiff
path: root/internal/cli
AgeCommit message (Collapse)Author
2026-04-06feat: --narrate opt-in narration, panel variety mandate, v0.23.0v0.23.0Paul Buetow
- Add --narrate flag (default false); narration is now opt-in to save TTS quota - Add VARIETY MANDATE to story page prompts: each panel must differ in camera angle, pose, location, lighting, and foreground — prevents repeated compositions - Wire NarrateEnabled through RunnerConfig and main.go - Update README: --narrate flag, updated output file table, narrator voice examples Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-06test: add missing unit tests for Veo video feature (task 016)Paul Buetow
- internal/video/veo_test.go: add pageNumFromPath table test, loadGalleryImage multiple-matches edge case, saveMP4 fallback name, and NewVeoGenerator success path with mock client injection - internal/cli/prompts_test.go: add parseSelection edge cases — zero max with "all", page number exceeding max, and whitespace-only input - internal/cli/video_runner_test.go: new file covering GenerateSelectedVideos for empty/nil paths (early return) and empty/whitespace API key (error path) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-06fix: correct video integration after comic generationPaul Buetow
PromptForGalleryVideos now returns []string paths (from recursive walk) instead of []int page numbers, so GenerateSelectedVideos always has the exact path to each gallery PNG regardless of which comics/<slug>/ subdirectory it lives in. Previously, GenerateSelectedVideos passed "." as galleryPath and called loadGalleryImage with a non-recursive filepath.Glob that could not find PNGs in subdirectories, causing video generation to always fail with "no gallery image found". Additional changes: - Add VeoGenerator.GenerateVideoFromPath that accepts a full image path and writes the MP4 next to the source PNG - Make runStoryVideos non-fatal: video errors print a warning and return nil so comic/PDF/narration outputs are never invalidated by Veo errors - Add filterPathsByPages helper and tests for the new behaviour - Add TestFindGalleryPages_Recursive to cover the comics/<slug>/ layout Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-06feat: add --video CLI flag to control Veo video prompt after story generationPaul Buetow
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/<slug>/ are discovered from the CWD search root. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-06feat: add generateSelectedVideos CLI runner for Veo video generationPaul Buetow
Implements the shared CLI runner that calls video.VeoGenerator for each selected gallery page number sequentially, printing progress and the saved MP4 path per page. Lives in internal/cli/video_runner.go. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-06feat: add CLI prompt helper for gallery video generationPaul Buetow
Implements promptForGalleryVideos(outputDir) which lists *_gallery_*.png files, asks the user y/n, then prompts for page selection (1,3,5 or all), returning a sorted slice of chosen page numbers. Also adds the pure helper parseSelection(input, max) with full unit tests covering all branches. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-06refactor: decompose Processor god object into focused files (SRP)Paul Buetow
Extract audio coordination (voice selection, config assembly, attribution writing) into audio_coordinator.go, card directory management into card_store.go, and image downloading/searcher construction into image_downloader.go. processor.go shrinks from ~1119 to ~575 lines, each file now has a single clear responsibility. Also apply go fmt to all touched files. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-04feat: skip existing pages on re-run, add --story-slug for targeted repairv0.18.0Paul Buetow
- loadOrGenerate() in artist.go skips API calls for pages already on disk, loading bytes for the reference chain. Re-runs now only generate missing pages instead of regenerating the whole comic. - --story-slug flag forces the output directory slug so a repair run writes to the same directory as the original (e.g. --story-slug ai-jungle-quest). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-04feat: random ultra-realistic/comic style, --no-ultra-realistic flag, updated ↵v0.13.0Paul Buetow
README - Random 50/50 rendering mode per run (ultra-realistic or standard comic style) - --no-ultra-realistic flag forces standard comic style when set - renderingRequirement const centralised and applied to all image prompts via DRY renderReq() method - Log rendering mode chosen at generation time - Update README: correct page count (10), output filenames, all --story flags documented - Bump version to 0.13.0 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-03feat: comic pipeline v0.10.0 — iterative chaining, title slugs, comics ↵Paul Buetow
subfolder, 16:9 - Iterative image chaining: each page receives cover + prev page as pixel-level reference (multimodal) so the model copies appearance directly, not from text alone - --story-theme flag overrides random genre pick per run - Gemini now generates a short comic title (---COMIC TITLE--- separator) used as the output slug; all files named <slug>_cover.png, <slug>_page_1.png, etc. - All comic output stored under comics/<slug>/ subdirectory - Aspect ratio changed to 16:9 (ThinkPad X1 Gen 9 screen fit; 16:10 not supported) - Bulgarian language rule moved to top of every prompt for stronger compliance - Dynamic story-specific cover masthead + publisher logo badge matching story genre - --story-theme "a thrilling space..." forces genre without touching random pool Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-03feat: add --story cinematic narration and comic strip generationPaul Buetow
- Generates a ~500-word Bulgarian vocabulary story from a batch file - Produces 3 comic pages via NanoBanana (90% ultra-realistic style) - Art style chosen randomly per run; override with --story-style - Cinematic Gemini TTS narration saved as story_narration.mp3 - Random voice from curated pool (Charon, Fenrir, Enceladus, Algieba, Aoede, Schedar) - Override narrator voice with --narrator-voice - Falls back to story_tts_todo.txt if narration fails - No new API key required — reuses existing GOOGLE_API_KEY - Bump version to 0.9.4 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-02task 003: handle home-dir and APKG marshal errorsPaul Buetow
2026-04-02Release v0.9.0v0.9.0Paul Buetow
2026-04-02Add Gemini model listing supportPaul Buetow
2026-04-01Fix Gemini audio format handlingPaul Buetow
2026-04-01Add Gemini audio CLI flagsPaul Buetow
2026-04-01zg: derive openai voice help from shared listPaul Buetow
2026-04-01z8: preserve Nano Banana CLI precedencePaul Buetow
2026-04-01z8: finish Nano Banana CLI wiringPaul Buetow
2026-04-01z9: clarify GUI provider matrixPaul Buetow
2026-04-01z9: update GUI Nano Banana guidancePaul Buetow
2026-04-01z9: fix GUI launch provider propagationPaul Buetow
2026-04-01z7: make Nano Banana help additivePaul Buetow
2026-04-01z7: keep Nano Banana CLI additivePaul Buetow
2026-04-01z7: wire Nano Banana CLI configPaul Buetow
2026-04-01zr: add Gemini-backed translation providerPaul Buetow
2026-03-08test(task-374): fix errcheck issues in tests and support codePaul Buetow
2026-03-08fix: complete code-quality task queue (373-378)Paul Buetow
2026-01-21docs: document Bulgarian-Bulgarian batch file format (double equals ==)Paul Buetow
- Update README.md with complete batch file format documentation - Expanded from 3 to 5 supported formats - Added Format 4: Bulgarian-Bulgarian (monolingual) using double equals - Clarified Format 2 as English→Bulgarian with single equals - Noted that bg-bg cards generate two separate audio files - Update CLI help text to show batch file format examples - Added example of double equals syntax - Clarified single equals creates English→Bulgarian cards This closes the documentation gap for the Bulgarian-Bulgarian flashcard feature that was already implemented in the codebase.
2025-07-21feat: Enhanced bulk import, archive functionality, and export improvementsPaul Buetow
## Bulk Import Enhancements - Added support for three flexible batch file formats: - `BULGARIAN = ENGLISH` - Both provided, no translation needed - `= ENGLISH` - Only English provided, auto-translated to Bulgarian - `BULGARIAN` - Only Bulgarian provided, auto-translated to English - Implemented smart file checking to skip already processed words - Check all required files (word.txt, translation.txt, phonetic.txt, audio/image files and their attribution/metadata) - Added batch processing summary with statistics ## Archive Functionality - Renamed --clear flag to --archive for clarity - Archive cards directory to ~/.local/state/totalrecall/archive/cards-TIMESTAMP - Added archive button to GUI toolbar with folder icon - Archive confirmation dialog supports keyboard shortcuts (y/n/c/ESC) ## Export Improvements - Anki exports now show full file path in output - Changed default export location to home directory (~) for both CLI and GUI - Auto-adjust image size to 1024x1024 when DALL-E 3 is selected ## Other Improvements - Added TranslateEnglishToBulgarian method for reverse translation - Enhanced batch processing with better error handling and progress reporting - Improved file integrity checking for complete word processing 🤖 Generated with [opencode](https://opencode.ai) Co-Authored-By: opencode <noreply@opencode.ai>
2025-07-21feat: improve consistency between CLI and GUI modesPaul Buetow
- Fix batch mode to store cards in ~/.local/state/totalrecall/cards/ matching GUI behavior - Add --no-auto-play flag to disable automatic audio playback (enabled by default) - Simplify phonetic fetching in CLI to match GUI (IPA only, no detailed explanations) - Remove redundant --gui flag as GUI is already the default mode - Align image generation settings: both modes now use DALL-E 2 with 512x512 resolution 🤖 Generated with [opencode](https://opencode.ai) Co-Authored-By: opencode <noreply@opencode.ai>
2025-07-20test: add comprehensive test coverage for refactored packagesPaul Buetow
Add test suites for all newly created packages from the main.go refactoring: - batch: 100% coverage - file reading, parsing, edge cases - cli: 96.7% coverage - command setup, flags, configuration - translation: 92% coverage - API integration, caching, errors - phonetic: 87.5% coverage - API fetching, file operations - models: 77.3% coverage - model listing functionality - processor: 18% coverage - basic tests (limited by API dependencies) Total: 1159 lines of test code across 7 new test files 🤖 Generated with [opencode](https://opencode.ai) Co-Authored-By: opencode <noreply@opencode.ai>
2025-07-20Refactor main.go into focused packagesPaul Buetow
- Reduced main.go from 961 lines to 89 lines (91% reduction) - Created new packages for better separation of concerns: - cli: Command-line interface setup and configuration - processor: Core word processing logic and orchestration - batch: Batch file processing functionality - translation: Bulgarian to English translation services - models: OpenAI model listing functionality - phonetic: Phonetic information fetching - Each package has clear documentation in doc.go files - Improved testability and maintainability - All existing functionality preserved - All tests passing and build successful