feat(cli): add 'add-all' command and auto_delete_added_files config - #232
feat(cli): add 'add-all' command and auto_delete_added_files config#232sebastianbraun25 wants to merge 2 commits into
Conversation
…ption - New 'openkb add-all' command processes all files in raw/ directory - New config parameter 'auto_delete_added_files' (default: false) - When enabled, both 'add' and 'add-all' automatically delete successfully ingested files - Updated help texts to document the new cleanup behavior - Config applies to all ingest methods: direct files, directories, and URLs
Duplicates (skipped files) should also be auto-deleted when auto_delete_added_files is enabled, so raw/ stays clean. Only 'failed' status files are preserved to allow retries. Updated docstrings and helper function logic accordingly.
eecc0bc to
680c04b
Compare
|
Rewrote this branch's history to remove unrelated commits. The branch had accidentally picked up commits from the (now-withdrawn, see Rebuilt cleanly from current |
Problem
The
openkb addcommand supports adding directories recursively, but users who frequently download documents to/rawmust manually invokeopenkb add raw/and then manually delete processed files. There is no batch processing command for the/rawstaging directory, and no configuration option to auto-delete successfully ingested files and duplicates.Solution / Changes
New CLI command:
openkb add-allprocesses all files in the KB'sraw/directory recursivelyNew configuration parameter:
auto_delete_added_files(boolean, default:false)addandadd-allautomatically delete files after processingImplementation:
_delete_if_auto_cleanup_enabled()helper function to handle cleanup logicaddandadd-allcommands to use the helper functionIssues