{"id":35771583,"url":"https://github.com/nickesc/modpack-lock","last_synced_at":"2026-03-09T05:02:50.449Z","repository":{"id":331660062,"uuid":"1128701384","full_name":"nickesc/modpack-lock","owner":"nickesc","description":"Creates a modpack lockfile for files hosted on Modrinth (mods, resource packs, shaders and datapacks)","archived":false,"fork":false,"pushed_at":"2026-02-28T20:19:49.000Z","size":2153,"stargazers_count":0,"open_issues_count":5,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-28T23:37:37.354Z","etag":null,"topics":["lockfile","minecraft","modpack","modrinth"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/modpack-lock","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nickesc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-01-06T03:08:19.000Z","updated_at":"2026-02-15T00:20:13.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/nickesc/modpack-lock","commit_stats":null,"previous_names":["nickesc/modpack-lock"],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/nickesc/modpack-lock","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nickesc%2Fmodpack-lock","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nickesc%2Fmodpack-lock/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nickesc%2Fmodpack-lock/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nickesc%2Fmodpack-lock/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nickesc","download_url":"https://codeload.github.com/nickesc/modpack-lock/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nickesc%2Fmodpack-lock/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30283703,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-09T02:57:19.223Z","status":"ssl_error","status_checked_at":"2026-03-09T02:56:26.373Z","response_time":61,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["lockfile","minecraft","modpack","modrinth"],"created_at":"2026-01-07T04:22:19.251Z","updated_at":"2026-03-09T05:02:50.435Z","avatar_url":"https://github.com/nickesc.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ca href=\"https://www.npmjs.com/package/modpack-lock\"\u003e\u003cimg alt=\"NPM: npmjs.com/package/modpack-lock\" src=\"https://img.shields.io/npm/v/modpack-lock?style=for-the-badge\u0026logo=npm\u0026logoColor=white\u0026label=npm\u0026color=%23C12127\u0026labelColor=%23505050\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/nickesc/modpack-lock\"\u003e\u003cimg alt=\"Source: github.com/nickesc/modpack-lock\" src=\"https://img.shields.io/badge/source-github-brightgreen?style=for-the-badge\u0026logo=github\u0026labelColor=%23505050\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/nickesc/modpack-lock/actions/workflows/modpack-lock-tests.yml\"\u003e\u003cimg alt=\"Tests: github.com/nickesc/modpack-lock/actions/workflows/modpack-lock-tests.yml\" src=\"https://img.shields.io/github/actions/workflow/status/nickesc/modpack-lock/modpack-lock-tests.yml?logo=github\u0026label=tests\u0026logoColor=white\u0026style=for-the-badge\u0026labelColor=%23505050\"\u003e\u003c/a\u003e\n\n# modpack-lock\n\n###### by nickesc - [GitHub](https://github.com/nickesc) | [Modrinth](https://modrinth.com/user/nickesc)\n\nCreates a modpack lockfile for files hosted on Modrinth (mods, resource packs, shaders and datapacks).\n\n## Overview\n\nMany mod and pack authors request that modpack creators link to Modrinth or CurseForge downloads rather than re-hosting files. This makes it difficult to track content files in version control when pushing to a remote server.\n\nThis script generates a `modpack.lock` file containing a plaintext representation of the modpack's contents. This object contains the metadata for the content available on Modrinth, including hashes, versions, names, download URLs and more. An optional `modpack.json` file can also be created to store your modpack's metadata (name, version, modloader, dependencies, etc.) alongside the lockfile. This setup allows for easy diffing and clear version history.\n\n\u003e While an `.mrpack` file could be used to track changes to the modpack, it is a large, binary file that cannot be diffed and can contain large amounts of duplicate data from the rest of the repository.\n\nUsing the `scripts` field in `modpack.json`, you can also define reusable, tracked shell commands for common modpack tasks (like publishing, generating assets or CI/CD workflows).\n\n## Installation\n\nTo install the script globally with `npm`:\n\n```bash\nnpm install -g modpack-lock\n```\n\nAlternatively, you can run it using `npx`:\n\n```bash\nnpx modpack-lock\n```\n\n## CLI\n\nTo generate a lockfile for your modpack, run:\n\n```bash\nmodpack-lock\n```\n\nThe script will:\n\n- Scan target directory's `mods`, `resourcepacks`, `datapacks`, and `shaderpacks` directories for `.jar` and `.zip` files\n- Calculate SHA1 hashes for each file\n- Query the Modrinth API for matching versions\n- Generate a `modpack.lock` file (and update `modpack.json` dependencies if present)\n\nUse flags to generate `README.md` files for each category or update the `.gitignore` to ignore content hosted on Modrinth.\n\n```text\nUsage: modpack-lock [options] [command]\n\nCreates a modpack lockfile for files hosted on Modrinth (mods, resource packs, shaders and datapacks)\n\nOptions:\n  -p, --path \u003cpath\u003e       Path to the modpack directory\n  -d, --dry-run           Dry-run mode - no files will be written\n\nGENERATION\n  -l, --licenseFile       Add the LICENSE file to the modpack\n  -g, --gitignore         Update the .gitignore file to ignore content hosted on Modrinth\n  -r, --readme            Generate README.md files for each category\n\nLOGGING\n  -q, --quiet             Quiet mode - only show errors and warnings\n  -s, --silent            Silent mode - no output\n\nINFORMATION\n  -V                      output the version number\n  -h, --help              display help for modpack-lock\n\nCommands:\n  init [options]          Initialize a modpack with a modpack.json file and a modpack.lock lockfile.\n  run [options] \u003cscript\u003e  Run a script defined in the modpack.json file's 'scripts' field\n```\n\n\u003e [!TIP]\n\u003e\n\u003e #### Did you know?\n\u003e\n\u003e You can generate summary files for each category by running `modpack-lock -r`. This will generate a `README.md` file in each of the content folders, detailing the scanned files and important attribution information for them.\n\n### Initialization\n\nTo initialize a new modpack, run:\n\n```bash\nmodpack-lock init\n```\n\nThis command will:\n\n- Prompt the user for the modpack's metadata (name, version, author, etc.)\n- Generate the lockfile\n- Generate a `modpack.json` file that stores your modpack's metadata (name, version, author, etc.), including a list of dependencies\n\nThe interactive mode will prompt you for each field. Set their initial values using the available option flags. Use `--noninteractive` with the required options to skip the interactive-prompt and use the provided values.\n\n```text\nUsage: modpack-lock init [options]\n\nInitialize a modpack with a modpack.json file and a modpack.lock lockfile.\n\nOptions:\n  -f, --folder \u003cpath\u003e                                Path to the modpack directory\n  -n, --noninteractive                               Non-interactive mode - must provide options for required fields\n  --add-license                                      Add the LICENSE file to the modpack\n  --add-gitignore                                    Update the .gitignore file to ignore content hosted on Modrinth\n  --add-readme                                       Generate README.md files for each category\n\nMODPACK INFORMATION\n  --name \u003cname\u003e                                      The name of the modpack; defaults to the directory name\n  --version \u003cversion\u003e                                The modpack version; defaults to 1.0.0\n  --id \u003cid\u003e                                          The modpack's slug/ID; defaults to the directory name slugified\n  --description \u003cdescription\u003e                        A description of the modpack\n  --author \u003cauthor\u003e                                  The author of the modpack; required\n  --projectUrl \u003cprojectUrl\u003e                          The project's homepage URL; defaults to a guessed Modrinth project URL\n  --sourceUrl \u003csourceUrl\u003e                            The project's source code URL; defaults to a guessed GitHub repository URL\n  --license \u003clicense\u003e                                The modpack's license; popular licenses are fetched from GitHub; defaults to mit in interactive mode\n  --modloader \u003cmodloader\u003e                            The modpack's modloader; a list of loaders is fetched from Modrinth; required\n  --targetModloaderVersion \u003ctargetModloaderVersion\u003e  The target modloader version\n  --targetMinecraftVersion \u003ctargetMinecraftVersion\u003e  The target Minecraft version; a list of versions is fetched from Modrinth; required\n\nINFORMATION\n  -h, --help                                         display help for modpack-lock init\n```\n\n### Running Scripts\n\nTo run a script defined in `modpack.json`, run:\n\n```bash\nmodpack-lock run \u003cscript\u003e\n```\n\nThis command takes the name of the script as its first argument:\n\n- It searches for a scripts fiels in `modpack.json` in the current directory by default.\n- Use the `-f` option to specify a different path to the modpack directory.\n- For debug logging, use the `-D` option.\n\n\u003e To pass additional arguments and options to the script, write them after a `--` separator:\n\u003e\n\u003e ```bash\n\u003e modpack-lock run \u003cscript\u003e -- [options] \u003cargs\u003e\n\u003e ```\n\nThe `scripts` field in `modpack.json` is a key-value pair of script names and their corresponding shell commands. The `scripts` field is optional and is omitted by default.\n\n```text\nUsage: modpack-lock run [options] \u003cscript\u003e\n\nRun a script defined in the modpack.json file's 'scripts' field\n\nArguments:\n  script               The name of the script to run\n\nOptions:\n  -f, --folder \u003cpath\u003e  Path to the modpack directory\n  -D, --debug          Debug mode -- show more information about how the command is being parsed\n\nINFORMATION\n  -h, --help           display help for modpack-lock run\n```\n\n## API\n\nFor programmatic usage, `modpack-lock` exports these functions:\n\n- `getModpackInfo()`\n- `getLockfile()`\n- `generateJson()`\n- `generateGitignoreRules()`\n- `generateReadmeFiles()`\n- `generateLicense()`\n- `generateLockfile()`\n- `generateModpackFiles()`\n- `promptUserForInfo()`\n\nSee the [API documentation](https://nickesc.github.io/modpack-lock) for full details.\n\n## File Formats\n\n### `modpack.lock`\n\nThe lockfile contains metadata about Modrinth-hosted files found in modpack directories:\n\n```json\n{\n  \"version\": \"1.0.1\",\n  \"generated\": \"2026-01-06T03:00:00.000Z\",\n  \"total\": 7,\n  \"counts\": {\n    \"mods\": 1,\n    \"resourcepacks\": 3,\n    \"datapacks\": 1,\n    \"shaderpacks\": 2\n  },\n  \"dependencies\": {\n    \"mods\": [\n      {\n        \"path\": \"mods/example-mod.jar\",\n        \"version\": { ... }\n      }\n    ],\n    \"resourcepacks\": [ ... ],\n    \"datapacks\": [ ... ],\n    \"shaderpacks\": [ ... ]\n  }\n}\n```\n\n### `modpack.json`\n\nThe JSON file contains your modpack metadata and a dependency list:\n\n```json\n{\n  \"name\": \"My Modpack\",\n  \"version\": \"1.0.0\",\n  \"id\": \"my-modpack\",\n  \"description\": \"\",\n  \"author\": \"name\",\n  \"projectUrl\": \"\",\n  \"sourceUrl\": \"\",\n  \"license\": \"\",\n  \"modloader\": \"modloader\",\n  \"targetModloaderVersion\": \"\",\n  \"targetMinecraftVersion\": \"x.y.z\",\n  \"scripts\": {\n    \"example\": \"echo 'example script'\"\n  },\n  \"dependencies\": {\n    \"mods\": [ ... ],\n    \"resourcepacks\": [ ... ],\n    \"datapacks\": [ ... ],\n    \"shaderpacks\": [ ... ]\n  }\n}\n```\n\n\u003e [!IMPORTANT]\n\u003e\n\u003e #### Don't commit binaries\n\u003e\n\u003e Use `modpack-lock -g` to automatically update your `.gitignore` file with rules to ignore modpack contents, with exceptions for any files that are not hosted by Modrinth:\n\u003e\n\u003e ```txt\n\u003e # .gitignore\n\u003e\n\u003e # modpack-lock:start\n\u003e mods/*.jar\n\u003e resourcepacks/*.zip\n\u003e datapacks/*.zip\n\u003e shaderpacks/*.zip\n\u003e */**/*.disabled\n\u003e\n\u003e ## Exceptions\n\u003e !mods/example.jar\n\u003e # modpack-lock:end\n\u003e ```\n\u003e\n\u003e This section is managed by modpack-lock and will be updated automatically when you run `modpack-lock -g`. Changes made inside this section will be overwritten, but any changes you make outside of this section will be preserved.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for more details.\n\n\u003ca href=\"https://github.com/nickesc/modpack-lock/blob/main/LICENSE\"\u003e\u003cimg class=\"badge-img\" alt=\"GitHub License\" src=\"https://img.shields.io/github/license/nickesc/modpack-lock?style=for-the-badge\u0026labelColor=%23333\u0026color=%230070ff\"\u003e\u003c/a\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnickesc%2Fmodpack-lock","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnickesc%2Fmodpack-lock","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnickesc%2Fmodpack-lock/lists"}