[PR #4573] [MERGED] Launcher: install a native mod from a GitHub link (CLI) #5701

Closed
opened 2026-11-03 05:14:25 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/4573
Author: @levzzz5154
Created: 10/30/2026
Status: ✅ Merged
Merged: 10/30/2026
Merged by: @levzzz5154

Base: main ← Head: launcher/mods-from-github


📝 Commits (1)

  • b4ad459 Launcher: install a native mod from a GitHub link (mods add-github, update-github)

📊 Changes

8 files changed (+1357 additions, -14 deletions)

View changed files

📝 docs/launcher-commands.md (+27 -0)
📝 docs/native-mods.md (+33 -0)
📝 launcher/src/cli.rs (+189 -1)
📝 launcher/src/cli_tools.rs (+3 -0)
➕ launcher/src/github_mods.rs (+685 -0)
➕ launcher/src/github_mods/tests.rs (+399 -0)
📝 launcher/src/lib.rs (+1 -0)
📝 launcher/src/native_mods.rs (+20 -13)

📄 Description

🤖 Opened by levzzz5154's AI agent (Claude Code, Claude Sonnet 5.5), not by levzzz5154 personally.

Native mod authors can ship a version without a registry PR: the player installs it from a GitHub link. This is the backend and CLI; the Mods page ("Add from GitHub", origin line, "Check for updates") follows in a second PR.

  • horizon-launcher mods add-github <url> [--mod ID | --all] [--instance X] --trust-native-code. URLs: https://github.com/<o>/<r>, .../releases/tag/<tag>, .../tree/<ref>, .../commit/<sha>.
  • Resolved through GitHub's public API (unauthenticated; a rate limit gives a clear message) to an exact release .hnmod (SHA-256 compared with GitHub's digest) or an exact commit SHA. No release or no asset: the commit's codeload archive (same unpack code as the Horizon source fetch, now native_mods::unpack_archive, with a size cap) is searched for mod folders by the native-build <folder> rules; several mods are listed and picked with --mod or --all. Source folders are packed into a deterministic .hnmod and must pin horizon_revision.
  • The bundle goes through horizon_mods::index::native::Bundle::read, the registry's check, before anything is installed. .hmod-only releases say "not supported yet".
  • The warning (not reviewed by the registry; full access to this computer; read the source) and the exact commit link print first; nothing is downloaded without --trust-native-code. Not an MCP tool (listed in NOT_TOOLS).
  • Origin (owner/repo, tag or commit, asset, SHA-256) is stored as horizon-native-mods/<id>.origin.json; mods list shows "from GitHub: owner/repo @ tag/sha"; mods update-github [ID] [--check] compares with the latest release (or the default branch head for a commit install); mods remove removes it. A mod from the registry or by hand is never replaced.
  • Does not touch backend.rs or Cargo.toml; no new dependencies. Docs: docs/native-mods.md "Install from GitHub", docs/launcher-commands.md (generated).

Tested: 14 new unit tests (URL parsing, resolution against recorded API JSON, mod folder search, packing and the registry checks, origin record and update comparison), clippy -D warnings, cargo test of the launcher; a real run of mods add-github / list / update-github --check against horizon-native-mod-template in scratch dirs.

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/4573 **Author:** [@levzzz5154](https://github.com/levzzz5154) **Created:** 10/30/2026 **Status:** ✅ Merged **Merged:** 10/30/2026 **Merged by:** [@levzzz5154](https://github.com/levzzz5154) **Base:** `main` ← **Head:** `launcher/mods-from-github` --- ### 📝 Commits (1) - [`b4ad459`](https://github.com/horizon-rust/horizon/commit/b4ad4594496ebe40913652b3f05e6d9fc2e60dc2) Launcher: install a native mod from a GitHub link (mods add-github, update-github) ### 📊 Changes **8 files changed** (+1357 additions, -14 deletions) <details> <summary>View changed files</summary> 📝 `docs/launcher-commands.md` (+27 -0) 📝 `docs/native-mods.md` (+33 -0) 📝 `launcher/src/cli.rs` (+189 -1) 📝 `launcher/src/cli_tools.rs` (+3 -0) ➕ `launcher/src/github_mods.rs` (+685 -0) ➕ `launcher/src/github_mods/tests.rs` (+399 -0) 📝 `launcher/src/lib.rs` (+1 -0) 📝 `launcher/src/native_mods.rs` (+20 -13) </details> ### 📄 Description > 🤖 Opened by levzzz5154's AI agent (Claude Code, Claude Sonnet 5.5), not by levzzz5154 personally. Native mod authors can ship a version without a registry PR: the player installs it from a GitHub link. This is the backend and CLI; the Mods page ("Add from GitHub", origin line, "Check for updates") follows in a second PR. - `horizon-launcher mods add-github <url> [--mod ID | --all] [--instance X] --trust-native-code`. URLs: `https://github.com/<o>/<r>`, `.../releases/tag/<tag>`, `.../tree/<ref>`, `.../commit/<sha>`. - Resolved through GitHub's public API (unauthenticated; a rate limit gives a clear message) to an exact release `.hnmod` (SHA-256 compared with GitHub's digest) or an exact commit SHA. No release or no asset: the commit's codeload archive (same unpack code as the Horizon source fetch, now `native_mods::unpack_archive`, with a size cap) is searched for mod folders by the `native-build <folder>` rules; several mods are listed and picked with `--mod` or `--all`. Source folders are packed into a deterministic `.hnmod` and must pin `horizon_revision`. - The bundle goes through `horizon_mods::index::native::Bundle::read`, the registry's check, before anything is installed. `.hmod`-only releases say "not supported yet". - The warning (not reviewed by the registry; full access to this computer; read the source) and the exact commit link print first; nothing is downloaded without `--trust-native-code`. Not an MCP tool (listed in `NOT_TOOLS`). - Origin (owner/repo, tag or commit, asset, SHA-256) is stored as `horizon-native-mods/<id>.origin.json`; `mods list` shows "from GitHub: owner/repo @ tag/sha"; `mods update-github [ID] [--check]` compares with the latest release (or the default branch head for a commit install); `mods remove` removes it. A mod from the registry or by hand is never replaced. - Does not touch `backend.rs` or `Cargo.toml`; no new dependencies. Docs: `docs/native-mods.md` "Install from GitHub", `docs/launcher-commands.md` (generated). Tested: 14 new unit tests (URL parsing, resolution against recorded API JSON, mod folder search, packing and the registry checks, origin record and update comparison), clippy `-D warnings`, `cargo test` of the launcher; a real run of `mods add-github` / `list` / `update-github --check` against horizon-native-mod-template in scratch dirs. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:14:25 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#5701
No description provided.