Skip to content

add CLI binary for conflict detection (v0.6.0)#19

Open
thisfrontenddev wants to merge 1 commit into
rfuzzo:mainfrom
thisfrontenddev:main
Open

add CLI binary for conflict detection (v0.6.0)#19
thisfrontenddev wants to merge 1 commit into
rfuzzo:mainfrom
thisfrontenddev:main

Conversation

@thisfrontenddev
Copy link
Copy Markdown

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 a scanner module 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 .archive mods 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:

  • Full report — detailed per-archive breakdown with winning/losing files and which mods they conflict with
  • Summary (--summary) — compact one-line-per-mod overview of all conflicting mods, contains a fully_overridden flag so we can spot mods that are completely overridden.

Filtering is built in with --mod-filter and --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-conflicts crate has two Cargo features (gui and cli) that gate their respective dependencies. The GUI continues to work exactly as before — cargo build with default features builds the GUI, cargo build --features cli --no-default-features builds the CLI. CI builds and releases both.

Usage

red4-conflicts-cli --summary --pretty          # summary of conflicting mods
red4-conflicts-cli --mod-filter "ETO_2K"      # filter for a specific mod
red4-conflicts-cli --pretty > conflicts.json   # pipe output

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