summaryrefslogtreecommitdiff
path: root/internal/cli/command.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2025-07-21 23:22:38 +0300
committerPaul Buetow <paul@buetow.org>2025-07-21 23:22:38 +0300
commitbc1c6e76d5a6ef2623d26d277473c459dd699f81 (patch)
tree3bc0c7b4b730d50fb15ae38458037fe2f8ac4b2f /internal/cli/command.go
parenta43d503533f301db43af412167fda26364542e27 (diff)
feat: Enhanced bulk import, archive functionality, and export improvements
## 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>
Diffstat (limited to 'internal/cli/command.go')
-rw-r--r--internal/cli/command.go10
1 files changed, 9 insertions, 1 deletions
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")