feat: added modpack management

This commit is contained in:
v4n
2025-01-22 21:07:20 +02:00
parent 115e8acac3
commit c1785b5323
4 changed files with 416 additions and 86 deletions
+47 -44
View File
@@ -2,25 +2,9 @@
Helldivers 2 Mod Manager CLI is a command line interface for managing Helldivers 2 mods. Since there is no Linux mod manager available and I like being a nerd by using CLI tools instead of GUIs, this project was born.
- [Helldivers 2 Mod Manager CLI](#helldivers-2-mod-manager-cli)
- [Installation](#installation)
- [Usage](#usage)
- [Available commands](#available-commands)
- [Basic usage](#basic-usage)
- [Install mod(s)](#install-mods)
- [Uninstall a mod](#uninstall-a-mod)
- [Enable/disable mods](#enabledisable-mods)
- [List installed mods](#list-installed-mods)
- [Compatibility](#compatibility)
- [Advanced usage](#advanced-usage)
- [Shortcuts](#shortcuts)
- [Exporting and importing](#exporting-and-importing)
- [Resetting all installed mods](#resetting-all-installed-mods)
- [Database location and details](#database-location-and-details)
- [Contributing](#contributing)
- [Planned features](#planned-features)
This script is complete, the version will always [remain at 0.x.x](https://0ver.org/)
## Installation
## Installation and updating
To install/update Helldivers 2 Mod Manager CLI run the following command in your terminal:
@@ -28,7 +12,15 @@ To install/update Helldivers 2 Mod Manager CLI run the following command in your
bash -c "$(curl -fsSL https://raw.githubusercontent.com/v4n00/h2mm-cli/refs/heads/master/install.sh)"
```
Running this script will require sudo permissions. **DO NOT TRUST** random scripts from the internet. If you want to review the script before running it, check out the mod repository for yourself.
> [!CAUTION]
> Running this script will require sudo permissions. **DO NOT TRUST** random scripts from the internet. If you want to review the script before running it, check out the mod repository for yourself.
If for some reason, the installation command doesn't work you can:
1. Go to https://raw.githubusercontent.com/v4n00/h2mm-cli/refs/heads/master/install.sh
1. Right click -> Save page as...
1. Go to your downloads folders `cd ~/Downloads`
1. Give the script execution permissions `chmod +x install.sh`
1. Run the script `./install.sh`
## Usage
@@ -40,15 +32,21 @@ h2mm
### Available commands
- `install` - Install a mod with files
- `uninstall` - Uninstall a mod by name
- `list` - List all installed mods
- `enable` - Enable a mod by name
- `disable` - Disable a mod by name
- `export` - Export installed mods to a zip file
- `import` - Import mods from a zip file
- `reset` - Reset all installed mods
- `help` - Display the help message
- `install` - Install a mod by the file provided (directory, zip, patch).
- `uninstall` - Uninstall a mod by name (or index).
- `list` - List all installed mods.
- `enable` - Enable a mod by name (or index).
- `disable` - Disable a mod by name (or index).
- `export` - Export installed mods to a zip file.
- `import` - Import mods from a zip file.
- `modpack-create` - Create a modpack from the currently installed mods.
- `modpack-switch` - Switch to a modpack by name (or index).
- `modpack-list` - List all installed modpacks.
- `modpack-delete` - Delete a modpack by name (or index).
- `modpack-overwrite` - Overwrite a modpack by name (or index).
- `modpack-reset` - Reset all installed modpacks.
- `reset` - Reset all installed mods.
- `help` - Display this help message.
### Basic usage
@@ -62,7 +60,8 @@ h2mm install -n "Example mod" mod.patch_0 mod.patch_0.stream # -n is mandatory w
h2mm install -n "Example mod" mod* # using a wildcard to include all files
```
> Currently, if the mod has more than 1 variant, you need to install the one you want by unarchiving it separately.
> [!NOTE]
> If the mod has more than 1 variant, you need to install the one you want by unarchiving it separately and providing the directory.
#### Uninstall a mod
@@ -94,7 +93,7 @@ Status of platforms:
- Linux :white_check_mark:
- Steam Deck - untested (should work) :grey_question:
- WSL :white_check_mark:
- Windows - WSL :white_check_mark:
> The script works on WSL, but you need to specify the path to the Helldivers 2 mods directory manually, to find your Windows partition head to `/mnt/` and from there go to your Helldivers 2 data directory, on a typical install it should be on `/mnt/c/Program\ Files\ \(x86\)/Steam/steamapps/common/Helldivers\ 2/data`. You also need to have `unzip` installed, which can be done by running `sudo apt install unzip`.
@@ -111,11 +110,28 @@ You can use the short form of commands to save some time. The shortcuts are:
- `l` for `list`
- `ex` for `export`
- `im` for `import`
- `mc` for `modpack-create`
- `ms` for `modpack-switch`
- `ml` for `modpack-list`
- `md` for `modpack-delete`
- `mo` for `modpack-overwrite`
- `mr` for `modpack-reset`
- `r` for `reset`
### Modpacks support
You can set up modpacks by using the `modpack-*` commands. This allows you to quickly change between a set of mods. For more information, check the help message.
```bash
h2mm modpack-create "Modpack 1"
# install, enable, disable other mods...
h2mm modpack-create "Modpack 2"
h2mm modpack-switch "Modpack 1"
```
### Exporting and importing
You can export all installed mods to a zip file and import mods from the same file. This can be useful for sharing mods with others or for backing up your mods. The zip file will be saved in the current directory.
You can export all installed mods to a zip file and import mods from the same file. This can be useful for sharing mods with others or for backing up your mods. The archive file (`.tar.gz`) will be saved in the current directory.
```bash
h2mm export modpack1.zip
@@ -137,16 +153,3 @@ The database is stored in the `Helldivers 2` install directory, under the `data`
## Contributing
Feel free to contribute to this project by creating a pull request or opening an issue.
## Planned features
- [x] Check for mod updates
- [x] Enable/disable mods
- [x] Install mods in batches
- [ ] Easier way to change mod presets
- [ ] Find a way to make use of `manifest.json` and simplify installing variants
- [x] [DEV] Change to `.tar.gz` for exporting and importing
- [x] [DEV] Provide fixes for breaking updates
- [x] [DEV] Optimize code - throw errors in 1 line
- [ ] [DEV] Import/export treat breaking changes
- [ ] [DEV] Rewrite some code to be more readable