Feature: add CLI support #2
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add CLI Support for Scripting and Automation
First off, thanks for building Cullergrader. It's a great tool and exactly what I needed for organizing my photo bursts.
I'm not a Java developer, but I needed CLI support for my personal workflow. I used Claude Code to help implement this feature, and I'm submitting it as a PR in case others find it useful too.
This PR adds a command-line interface to Cullergrader, making it possible to use the tool in scripts and automated workflows without launching the GUI.
Motivation
While the GUI works great for interactive photo culling, there's no way to automate the process or integrate Cullergrader into batch processing pipelines. This PR addresses that by adding a CLI mode that uses the same grouping logic as the GUI but can be run from shell scripts, cron jobs, or other automation tools.
Implementation
The CLI shares the same JAR as the GUI. When you run the program with command-line arguments, it detects CLI mode and skips the GUI initialization. With no arguments, it launches the GUI as before.
Usage
Preview mode (no files copied):
java -jar cullergrader.jar --input ~/photosExport mode:
Custom thresholds:
The
--outputflag is optional. If you omit it, the CLI shows you what would be exported without actually copying any files. This makes it easy to test different threshold values before committing to an export.Changes
CLI.javawith argument parsing and the same photo processing workflow as the GUIMain.javato detect CLI mode based on command-line flagsThe core photo processing logic (
GroupingEngine,FileUtils,HashManager) remains unchanged and is used by both GUI and CLI modes.Backward Compatibility
No breaking changes. The GUI still works exactly as before when you run the JAR without arguments.