add CLI binary for conflict detection (v0.6.0)#19
Open
thisfrontenddev wants to merge 1 commit into
Open
Conversation
Adds a headless CLI tool (red4-conflicts-cli) that reuses the GUI's conflict detection logic via a shared scanner module. Features: - Auto-detects Cyberpunk 2077 install (Steam/GOG) - JSON and TOON (experimental) output formats - --summary mode for LLM-friendly compact overview - --mod-filter / --file-filter with regex support - --show-no-conflicts / --show-load-order opt-in flags - CI builds and releases both GUI and CLI binaries Core logic extracted from TemplateApp into scanner.rs, shared by both binaries via Cargo feature gates (gui/cli).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 binary for conflict detection
This adds a headless CLI tool (
red4-conflicts-cli) alongside the existing GUI app. Both share the same conflict detection engine — the core logic was extracted into ascannermodule that both binaries use, so there's zero code duplication.Why
I've been tinkering to try if I could automate conflict detection, and I did this for my own needs, but I thought why not share it. If you really do not want this, feel free to close this PR, no harm done 👍🏼
What it does
The CLI auto-detects the Cyberpunk 2077 installation for Steam and GOG, scans all
.archivemods for file-level conflicts, and outputs the conflicts in non-formatted JSON. Progress messages go to stderr to not mess up piping.Two output modes:
--summary) — compact one-line-per-mod overview of all conflicting mods, contains afully_overriddenflag so we can spot mods that are completely overridden.Filtering is built in with
--mod-filterand--file-filter, both accepting plain strings or regex patterns. This lets you filter, especially if you want to check specific mods after reviewing the summary.There's also an experimental TOON format support (
--toon) as an alternative to JSON, if we want to use the output in an LLM.Crate structure
The
red4-conflictscrate has two Cargo features (guiandcli) that gate their respective dependencies. The GUI continues to work exactly as before —cargo buildwith default features builds the GUI,cargo build --features cli --no-default-featuresbuilds the CLI. CI builds and releases both.Usage