mcjarmig is a high-performance, concurrent CLI tool written in Go that automatically updates Minecraft mods (.jar files) from an older version to the newest version available on the Modrinth v2 API.
Whether you are upgrading an entire modpack to a new Minecraft update or just ensuring all your installed mods are on their latest release, mcjarmig handles file discovery, SHA-1 checksum identification, API querying, downloading, and backup migration seamlessly.
- Cross-Platform Auto-Detection: Automatically detects your OS-specific Minecraft mods folder (
%APPDATA%/.minecraft/modson Windows,~/Library/Application Support/minecraft/modson macOS, and~/.minecraft/modson Linux). - Concurrent Worker Pool: Processes multiple mod files simultaneously across configurable worker threads (
-workers) using channels andsync.WaitGroupfor maximum speed. - Memory-Efficient Hashing: Calculates SHA-1 hashes by streaming
.jarfiles in chunks, ensuring minimal RAM usage even with large modpacks. - Modrinth v2 API Integration: Queries
https://api.modrinth.com/v2/version_file/{hash}/updateto find the exact matching update for your mod loader and target game version. - Thread-Safe File Management:
- Automatically creates an
old_mods/backup directory inside your mods folder and safely archives old.jarfiles before replacing them. - Uses atomic file locking (
sync.Mutex) across workers to eliminate race conditions, corrupted downloads, or file write collisions. - Includes cross-filesystem copy/rename fallbacks to handle across-device boundaries.
- Automatically creates an
- Detailed Summary Reporting: Generates a comprehensive post-run report categorizing every mod into Updated, Up-to-Date, No Update Found, and Errors with clean alphabetical formatting.
- Go 1.21+ (tested on Go 1.26+)
Clone the repository and build using the Go CLI:
git clone https://github.com/Woeter/mcjarmig.git
cd mcjarmig
go build -o mcjarmig main.gomcjarmig comes with sensible defaults right out of the box. Simply running ./mcjarmig will scan your system's default Minecraft mods folder and update all mods to their latest available Fabric releases.
# Update all mods in the default Minecraft folder to the latest available Fabric versions
./mcjarmig
# Update mods to a specific Minecraft game version (e.g., 1.21.1)
./mcjarmig -version 1.21.1
# Update mods for Forge or NeoForge
./mcjarmig -loader neoforge -version 1.21.1
# Specify a custom mods directory and use 10 concurrent download workers
./mcjarmig -dir /path/to/custom/mods -loader fabric -version latest -workers 10| Flag | Default | Description |
|---|---|---|
-dir |
%APPDATA%/.minecraft/mods |
Path to the target Minecraft mods folder (Windows %APPDATA%/.minecraft/mods by default). |
-loader |
fabric |
Target mod loader (fabric, forge, neoforge, quilt). |
-version |
latest |
Target Minecraft game version (1.21.1, 1.20.4, or latest for any version). |
-workers |
5 |
Number of concurrent workers for API querying and downloading. |
-token |
"" (or MODRINTH_TOKEN) |
Optional Modrinth API token (Authorization header) for private mods or higher rate limits. |
- No API Key Required by Default: Modrinth's version check endpoint (
POST https://api.modrinth.com/v2/version_file/{hash}/update) is completely public.mcjarmigworks out of the box without any signup, configuration files, or tokens for public mods. - Optional Token Authentication: If you need to access private mod projects, drafts, or want to increase your Modrinth API rate limit, you can provide a personal access token using the
-tokenCLI flag or by exporting theMODRINTH_TOKENenvironment variable:# Via environment variable export MODRINTH_TOKEN="mry_your_token_here" ./mcjarmig # Via CLI flag ./mcjarmig -token mry_your_token_here
- Scan: mcjarmig scans the directory specified by
-dir(ignoring subdirectories likeold_mods/) for valid.jarfiles. - Hash: Each
.jarfile is streamed and hashed usingSHA-1, which Modrinth uses to uniquely identify mod files. - Query: Each hash is queried against the Modrinth API (
POST /v2/version_file/{hash}/update). If-versionis set tolatest, game version filtering is bypassed to return the absolute newest release for your loader. - Download & Archive: If an update is found, the new
.jarfile is downloaded to a temporary buffer, the old.jarfile is moved into theold_mods/folder, and the new file is moved into place. All disk modifications are mutex-guaranteed for thread safety.
After all concurrent workers finish checking and updating your mods, mcjarmig outputs an organized summary report:
================================================================================
MIGRATION SUMMARY REPORT
================================================================================
Total Mods Scanned : 15
Updated : 4
Already Up-to-Date : 8
No Update Found : 2
Errors / Failed : 1
--------------------------------------------------------------------------------
[✔] UPDATED (4)
• fabric-api-0.92.0.jar -> fabric-api-0.95.0.jar
• sodium-0.8.12.jar -> sodium-0.9.1.jar
[=] ALREADY UP-TO-DATE (8)
• iris-1.7.0.jar (already on latest version)
• lithium-0.12.0.jar (already on latest version)
[∅] NO UPDATE FOUND ON MODRINTH (2)
• custom-server-mod-1.0.jar
[✖] ERRORS / FAILED (1)
• broken-mod.jar: API request failed (timeout)
================================================================================