Skip to content

Conversation

@shipurjan
Copy link

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 ~/photos

Export mode:

java -jar cullergrader.jar --input ~/photos --output ~/export

Custom thresholds:

java -jar cullergrader.jar -i ~/photos -o ~/export --time 10 --similarity 40

The --output flag 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

  • Added CLI.java with argument parsing and the same photo processing workflow as the GUI
  • Modified Main.java to detect CLI mode based on command-line flags
  • Updated README.md with CLI documentation and examples

The 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant