From bc1c6e76d5a6ef2623d26d277473c459dd699f81 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Mon, 21 Jul 2025 23:22:38 +0300 Subject: feat: Enhanced bulk import, archive functionality, and export improvements MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## 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 --- internal/cli/command.go | 10 +++++++++- internal/cli/flags.go | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'internal/cli') diff --git a/internal/cli/command.go b/internal/cli/command.go index 81f9914..155cb40 100644 --- a/internal/cli/command.go +++ b/internal/cli/command.go @@ -24,7 +24,13 @@ representative images from web search APIs. Examples: totalrecall # Launch interactive GUI (default) totalrecall ябълка # Generate materials for "apple" via CLI - totalrecall --batch words.txt # Process multiple words from file`, + totalrecall --batch words.txt # Process multiple words from file + totalrecall --archive # Archive existing cards directory + +Batch file formats: + ябълка # Bulgarian word (will be translated to English) + ябълка = apple # Bulgarian with translation provided + = apple # English only (will be translated to Bulgarian)`, Args: cobra.MaximumNArgs(1), Version: internal.Version, } @@ -41,6 +47,7 @@ func setupFlags(cmd *cobra.Command, flags *Flags) { defaultOutputDir := filepath.Join(home, ".local", "state", "totalrecall", "cards") // Global flags + // AGENT: The default config file location should be ~/.config/totalrecall/config.yaml cmd.PersistentFlags().StringVar(&flags.CfgFile, "config", "", "config file (default is $HOME/.totalrecall.yaml)") // Local flags @@ -56,6 +63,7 @@ func setupFlags(cmd *cobra.Command, flags *Flags) { cmd.Flags().BoolVar(&flags.ListModels, "list-models", false, "List available OpenAI models for the current API key") cmd.Flags().BoolVar(&flags.AllVoices, "all-voices", false, "Generate audio in all available voices (creates multiple files)") cmd.Flags().BoolVar(&flags.NoAutoPlay, "no-auto-play", false, "Disable automatic audio playback in GUI mode (auto-play is enabled by default)") + cmd.Flags().BoolVar(&flags.Archive, "archive", false, "Archive existing cards directory with timestamp") // OpenAI flags cmd.Flags().StringVar(&flags.OpenAIModel, "openai-model", flags.OpenAIModel, "OpenAI TTS model: tts-1, tts-1-hd, gpt-4o-mini-tts") diff --git a/internal/cli/flags.go b/internal/cli/flags.go index ab409f5..904059f 100644 --- a/internal/cli/flags.go +++ b/internal/cli/flags.go @@ -16,6 +16,7 @@ type Flags struct { ListModels bool AllVoices bool NoAutoPlay bool + Archive bool // OpenAI flags OpenAIModel string -- cgit v1.2.3