Skip to content

feat: add --engine flag for UE version selection - #1

Merged
StarksLabs merged 1 commit into
StarksLabs:masterfrom
renan-renger:feature/engine-version-selection-option
Sep 3, 2026
Merged

StarksLabs merged 1 commit into
StarksLabs:masterfrom
renan-renger:feature/engine-version-selection-option

Conversation

@renan-renger

Copy link
Copy Markdown
Contributor

Summary

  • Add --engine <version> CLI flag for download and sync commands (default: UE_5.7)
  • Input validation rejects malformed versions (e.g. UE_58) with clear error message
  • Fallback to highest compatible version when exact match unavailable, with informational stderr message
  • Interactive prompt when only higher engine versions exist — shows available versions, lets user pick or abort
  • Fix pre-existing bug where bestScore = -1 prevented fallback to higher versions from working

Changes

File What
src/api.ts Refactor pickArtifactId → pickArtifact returning EngineResolution with match type. Split getAsset() into resolveAsset() + fetchAssetDetail(). Export ENGINE_VERSION_RE and parseEngineVersion.
src/cli.ts Add --engine flag parsing, format validation, handleEngineResolution() with fallback messages and interactive prompt for higher-only case.

Test plan

  • epic-fab download <id> --engine UE_58 → rejects with format error
  • epic-fab download <id> --engine UE5.7 → rejects with format error
  • epic-fab download <id> → defaults to UE_5.7 (no behavior change)
  • epic-fab download <id> --engine UE_6.0 → falls back to highest available ≤ 6.0 with stderr message
  • epic-fab download <id> --engine UE_5.0 (only higher available) → shows versions, prompts user
  • epic-fab --help → shows --engine in Options section
  • bun run typecheck → passes

🤖 Generated with Claude Code

Engine version was hardcoded to UE_5.7. Now configurable via --engine
flag on download and sync commands, with smart resolution:

- Exact match: proceeds silently
- Fallback to lower: informs user, proceeds with highest compatible
- Only higher available: shows versions, prompts user to pick or abort
- Invalid format (e.g. UE_58): rejects early with clear error

Also fixes pre-existing bug where fallback to higher versions failed
(bestScore initialized to -1 instead of -Infinity).

Refactors getAsset() into resolveAsset() + fetchAssetDetail() so CLI
can inspect engine match before committing to manifest fetch.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@StarksLabs StarksLabs closed this in 3b0ecfa Sep 3, 2026
@StarksLabs
StarksLabs merged commit 3b0ecfa into StarksLabs:master Sep 3, 2026
@StarksLabs

Copy link
Copy Markdown
Owner

Merged — thank you, and I'm sorry this sat for two months.

That delay was entirely on me. I'm in school full time and this repo went quiet
while a term ran long. You did careful work and then heard nothing back, which is
the worst version of contributing to someone's project. I appreciate you not
giving up on it.

Everything in here landed:

  • --engine <version> on download and sync, defaulting to UE_5.7
  • format validation, so UE_58 and UE5.7 fail fast with a readable message
  • fallback to the highest compatible version, with the reason on stderr
  • the interactive prompt when only higher engine versions exist
  • the bestScore = -1 fix — nice catch. That one was silently breaking fallback
    for everybody and nobody had noticed.

One thing worth flagging since it touched your code: #2 independently rewrote the
same paths in cmdDownload/cmdSync to add progress output, so merging both
needed a real resolution rather than a mechanical one. Your resolveAsset →
handleEngineResolution → fetchAssetDetail split is what survived — I wrapped
it in their stderr status lines instead of the other way around, because your
version is the one that can prompt. bun run typecheck is green and --engine
is verified working on the merged tree.

Thanks again for the patience.

@renan-renger
renan-renger deleted the feature/engine-version-selection-option branch September 15, 2026 14:02
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.

2 participants