Git Product home page Git Product logo

r2mod_cli's Introduction

r2mod_cli

Features Installation Usage Changelog

A simple mod manager written in Bash for Linux users.

Screen

Features

  • Simple No-Nonsense Usage
  • Setup BepInEx and R2API
  • Install and Update Mods
  • Resolve Dependencies
  • Hold Specific Mods Back from Updating
  • Enable/Disable Mods
  • Edit Mod Configs
  • Check for Updates for itself
  • Supports Importing/Exporting r2modman profile codes
  • Supports Flatpak Steam Installs
  • Tab Completion

Installation

AUR

r2mod is available in the Arch AUR as r2mod_cli

yay -S r2mod_cli

Flatpak

r2mod is available from flathub as io.github.Foldex.r2mod

flatpak install flathub io.github.Foldex.r2mod

Alias

Flatpak bin exports should allow you to run r2mod using io.github.Foldex.r2mod.

But you may wish to set up an alias for easier use.

alias r2mod="flatpak run io.github.Foldex.r2mod"

Completions

Flatpak does not allow shell completions to be installed in the usual root owned locations.

The flatpak will install them under user owned directories at runtime instead.

For ZSH, you may need to add $HOME/.local/share/zsh/site-functions to your $fpath

Manual

The prior methods are preferred, but if you wish to manually install:

Extract the zip and run sudo make install inside its directory.

Dependencies

Arch

sudo pacman -S curl findutils gawk jq p7zip sed

Fedora

sudo dnf install curl findutils gawk jq p7zip sed

Ubuntu

sudo apt-get install curl findutils gawk jq p7zip-full sed

Usage

First Setup

Make sure you have run Risk of Rain 2 beforehand to create the needed directories.

It is heavily recommended to run r2mod setup to create a new install.

Some empty folders will be placed in the BepInEx/plugins dir, do not remove them.

They are used to track updates for certain mods.

Custom Install Location

The default install directories for Steam/Flatpak should automatically be handled.

If you've installed Risk of Rain 2 to a different location, please export the environment variable

$R2MOD_INSTALL_DIR in your bash profile and point it to your install directory:

export R2MOD_INSTALL_DIR="$HOME/custom/dir/Risk of Rain 2"

$R2MOD_COMPAT_DIR also exists for custom locations of Steam's compatdata directory.

export R2MOD_COMPAT_DIR="$HOME/custom/dir/steamapps/compatdata/632360"

Flatpak

If you wish to use a custom install location with the flatpak, you may use overrides or Flatseal to edit the permissions and environment variables.

  • The env vars must be an absolute path, they are literal strings and do not have ~ expansion.

  • Do NOT include Risk of Rain 2 in the R2MOD_INSTALL_DIR env path, an issue with flatpak does not allow for spaces in environment variables. Just point up to steamapps/common.

  • Use flatpak override --user if it is a user installed flatpak

flatpak override \
--env='R2MOD_INSTALL_DIR=/home/foldex/Games/Steam/SteamLibrary/steamapps/common' \
--env='R2MOD_COMPAT_DIR=/home/foldex/Games/Steam/SteamLibrary/steamapps/compatdata/632360' \
--filesystem='~/Games/Steam/SteamLibrary/steamapps/common/Risk of Rain 2' \
--filesystem='~/Games/Steam/SteamLibrary/steamapps/compatdata/632360' \
io.github.Foldex.r2mod

Command List

Accepts shorthand for command names.

r2mod ch(eck): Check for Script Updates
r2mod del(ete) ProfileName: Delete Local Profile
r2mod dis(able) (Mod-Dependency-String): Disable Mods
r2mod ed(it) ConfigName: Edit Mod Configs
r2mod en(able) (Mod-Dependency-String): Enable Mods
r2mod exp(ort) ProfileName: Export r2modman mod profile
r2mod hol(d): Toggle Mod Updates
r2mod imp(ort) ProfileCode: Install r2modman mod profile
r2mod ins(tall) Mod-Dependency-String: Install New Mod
r2mod li(st) (count|all) : List or Count Installed Mods
r2mod loa(d) ProfileName: Import Local Profile
r2mod ref(resh): Force Refresh Package Cache
r2mod run: Launch Risk of Rain
r2mod sav(e) ProfileName: Export Local Profile
r2mod sea(rch): Search for Mods
r2mod set(up): Install a Fresh BepInEx Setup
r2mod un(install) Mod-Dependency-String: Uninstall Mod
r2mod upd(ate): Update All Exisiting Mods
r2mod ver(sion): Print Version

Installing a Mod

r2mod install ontrigger-ItemStatsMod-2.0.0 to install a mod.

If the version number is left out, the most recent version will be installed.

r2mod install ontrigger-ItemStatsMod

Multiple mods can also be installed

r2mod install ontrigger-ItemStatsMod MagnusMagnuson-BiggerBazaar

Uninstalling a Mod

Use r2mod uninstall ontrigger-ItemStatsMod-2.0.0 to install a mod.

If the version number is left out, any version of that mod will be uninstalled.

r2mod uninstall ontrigger-ItemStatsMod

Multiple mods can also be uninstalled

r2mod uninstall ontrigger-ItemStatsMod MagnusMagnuson-BiggerBazaar

Disabling Mods

r2mod disable to disable BepInEx entirely.

r2mod enable to re-enable.

r2mod disable ontrigger-ItemStatsMod-2.0.0 to disable a specific mod.

r2mod enable ontrigger-ItemStatsMod-2.0.0 to re-enable.

Listing Installed Mods

r2mod list to display installed mods.

r2mod list all to display installed mods and disabled mods.

r2mod list count to display a count of installed mods.

r2mod list count all to display a count of installed mods and disabled mods.

Editing Configs

$EDITOR environment variable is used to determine which editor to use.

r2mod edit will open all BepInEx config files in your editor

r2mod edit name will open all matching configs (case insensitive, incomplete names are fine)

Holding

Mods can be prevented from being auto updated by running r2mod hold ModName.

Run again to remove the hold.

Updating r2mod

Updates for r2mod will be automatically checked, but not installed.

If you manually installed r2mod, updates can be done like any other mod:

r2mod install Foldex-r2mod_cli

Files

All Files, Old Versions, and Backups can be found in /tmp/r2mod

Changelog

1.3.4

  • Added completion for fish

1.3.3

  • Updated ModCode Import/Export to new Thunderstore API

1.3.2

  • Fix flatpak trying to use sandboxed version of $XDG_DATA_HOME
  • Disabled run command for flatpak version

1.3.1

  • Fix for flatpak not allowing env vars to contain spaces

1.3.0

  • Add r2mod flatpak version support
  • Use jq to validate on package cache update
  • Improved filtering of non-mod files in plugins dir
  • Colorize list and import preview

1.2.2

  • Support HookGen including configs
  • Support BepInEx including plugins
  • Fix for trying to install missing Hookgen while API cache did not exist

1.2.1

  • Fix for BepInEx patchers folder no longer being supplied
  • Now checks for steam folders using $XDG_DATA_HOME
  • Improved check for proton override file

1.2.0

  • Basic profile support
  • Support installing from ror2mm:// links
  • Remove check for R2API patcher files
  • Ignore deprecated mods in completion & searches

1.1.0

  • Dependency Support
  • Disable/Enable Individual Mods
  • Install r2mod updates through r2mod
  • Add HookGenPatcher to default installs
  • Add r2mod to AUR

1.0.7

  • Support R2API v3
  • Allow Custom Steam Compat Dir
  • Add Completion for import preview
  • Fix mod installs with patchers
  • Avoid running update check twice

1.0.6

  • Fix some mods zips extracting without folders
  • Improved setup logic
  • list now uses color=auto
  • Added list count command
  • Added ls alias

1.0.5

  • Add Search Command
  • Alias remove for uninstall
  • Automatically override winhttp on setup (bgkillas)

1.0.4

  • Allow Custom Install Locations
  • Improved ZSH Tab Completion
  • Added run Command to Launch Game

1.0.3

  • Added Hold Command
  • Auto Check for R2Mod Updates
  • Added profile_import preview option
  • Fallback to previous cache if package cache update fails

1.0.2

  • Added Tab Completion

1.0.1

  • Fixed Update Check

1.0.0

  • Initial Release

r2mod_cli's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

r2mod_cli's Issues

Autocomplete from middle of mod name + case insensitive completion

Trying to install mods entirely from the command line is a bit of a pain currently, as (at least for me) the zsh completion only matches results from the beginning of the string. For example, if I want to install the TooManyFriends mod, I type r2mod install too then hit tab, but it wouldn't return anything. I'd have to first type r2mod install wildbook then hit tab and it would then list all the mods that they've uploaded to thunderstore.
I'm not sure if this is a configuration error with my own .zshrc or if the zsh completion script could be updated to support this feature. I'd also suggest that case insensitive completion be supported, as it would help with finding mods as well.

Question regarding setup

For context I'm using Konsole on Steam Deck, when I try to run "r2mod setup" or any r2mod command it says "bash: r2mod: command not found". This is likely a problem regarding my lack of experience with linux, but would still appreciate the help. Thank you!

unable to run setup on previous setup with winhttp.dll

Currently r2mod checks for BepInEx and winhttp.dll before allowing anything to run which does not exist on a fresh install and prevents the setup from running

r2mod_cli/r2mod

Lines 131 to 133 in e9ef3d3

[ ! -d "$R2_DIR" ] && cecho r "$R2_DIR" && fatal_error "Risk of Rain 2 Folder Not Found"
[ ! -d "$R2_DIR/BepInEx" ] && cecho r "BepInEx Folder Not Found" && setup_bepin
[ ! -f "$R2_DIR/winhttp.dll" ] && error "winhttp.dll Missing"

Allow custom RoR2 install locations

This script assumes that Risk of Rain 2 is installed to $HOME/.var/app/com.valvesoftware.Steam/.local/share/Steam/steamapps/common/Risk of Rain 2 or $HOME/.local/share/Steam/steamapps/common/Risk of Rain 2 and as a result will not if Risk of Rain 2 is installed to a different location (in my case, I keep my steam library on a separate drive).

I've temporarily solved the problem by symlinking my install to $HOME/.var/app/com.valvesoftware.Steam/.local/share/Steam/steamapps/common/Risk of Rain 2, but it would be nice if there was an option to specify the install location

Feature request: Multiple profiles

I'm requesting that the ability to have multiple profiles, where different mods and their configs can be installed to. Allowing you to swap, create, and delete them with ease. As far as I can tell the codes generated by the export command dont last long.

P.S. Don't know where else I can put this so im putting it here, thank you very much for making this mod manager!

Feature Request: Support for R2ModMan Mod Codes

basically what the title says, not sure if you used to and the way it uses codes changed or something. But it's becoming really hard for my friend (who's on windows) and I to share mods.

Game would not actually run with any mods installed

The script would seem to have succeeded in installing mods, but when run, the game would be vanilla, even if run through the script and with the modded option selected. I successfully changed my enviroment variable to refer to the game, this did not make any difference.

Additionally, I tried using R2ModManager, and after doing so I found myself unable to run Risk of Rain 2 at all, even after verifying the game files, and uninstalling and reinstalling, and switching over to an empty profile in R2ModManager. Not sure if this is related.

mod installing error

KingEnderBrine-LobbyVotesSave and KingEnderBrine-InLobbyConfig
install in a way that bepinex cant find the right file location

launch game option

it may be a bit hard to get it to work with alot of computers but you could maybe just have someone launch the game with the launch options "PROTON_DUMP_DEBUG_COMMANDS=1 %command%" then it would be in /tmp/proton_$USER/run

mv: cannot move file

[:~] $ r2mod setup
✦ RiskofThunder-HookGenPatcher Missing, Installing
→ Installing HookGenPatcher...
  → HookGenPatcher: Updating to Version 1.2.1...
  → Moving Patcher Files...
mv: cannot move '/media/nvme0n1p1/SteamLibrary/steamapps/common/Risk of Rain 2/BepInEx/plugins/RiskofThunder-HookGenPatcher-1.2.1/BepInEx/patchers/Bepinex.MonoMod.HookGenPatcher' to '/media/nvme0n1p1/SteamLibrary/steamapps/common/Risk of Rain 2/BepInEx/patchers/RiskofThunder-HookGenPatcher': No such file or directory
→ Setup New BepInEx Install? y/n

choosing y runs the installer but then it's not detected again on the next run.

in .bash_profile:

export R2MOD_INSTALL_DIR="/media/nvme0n1p1/SteamLibrary/steamapps/common/Risk of Rain 2"
export R2MOD_COMPAT_DIR="/media/nvme0n1p1/SteamLibrary/steamapps/compatdata/632360"

my guess is the file is not being created, or is created somewhere else.

5.15.12-arch1-1, installed from AUR

Proton overrides file missing?

Got this warning when i ran the installer, when i launch the game using r2mod run and selecting "modded" the mods still dont load, assume it is related to this message and i can't find anything online on how to find the file or fix it. Script was pulled directly from AUR.
proton over

Just a question

where would I change the source to work with native steam, or is there just some sort of option. (I'm compiling from source code)

Env var error if game not in default steam library

Hello,

At the start of r2mod, you check the R2MOD_INSTALL_DIR env var.
Can you check to R2_COMPAT too ?

On my system, I need to force it, because "$HOME/$FLATPAK_DIR/steamapps/compatdata/$STEAM_ID" nor "$HOME/$STEAM_DIR/steamapps/compatdata/$STEAM_ID" exist.

[r2mod_cli]$ export STEAM_ID="632360"; export STEAM_DIR=".local/share/Steam"

[r2mod_cli]$ ls $HOME/$STEAM_DIR/steamapps/compatdata/$STEAM_ID
ls: cannot access '/home/auser/.local/share/Steam/steamapps/compatdata/632360': No such file or directory

[r2mod_cli]$ ls $HOME/$FLATPAK_DIR/steamapps/compatdata/$STEAM_ID
ls: cannot access '/home/auser//steamapps/compatdata/632360': No such file or directory

=> My steam library as multiples folders : RoR2 is on an alternate drive.
/media/Data-4-2000/Jeux/.steam_depot_3_wine_steam/steamapps/common/Risk of Rain 2
/media/Data-4-2000/Jeux/.steam_depot_3_wine_steam/steamapps/compatdata/632360

A little dirty patch :

  • I put r2mod folder in Risk of Rain 2 folder (personal preference : I don't like to install an not packaged application on the system side)
  • created a "r2mod.ini" in the r2mod folder containing the correct exported R2MOD_INSTALL_DIR and R2_COMPAT var. (Maybe the file can be in the ~/.config folder if r2mod installed with make install).
  • sourced the r2mod.ini : at line 14
    if [[ -f $(dirname $0)/r2mod.ini ]]; then source $(dirname $0)/r2mod.ini; elif [[ -f ~/.config/r2mod.ini ]]; then source ~/.config/r2mod.ini; fi
  • to check if R2_COMPAT is already assigned, added line 25 (and 33):
    if [[ ! -n "$R2_COMPAT" ]]; then ... fi

It will be even better to check the steam configuration file to automatically find the good RoR2 folder, but...

Nice script by the way.
Regards,
OS : Arch Linux.

Bug Report: Profiles code change

A few months back the host for r2modman profiles changed. You'll probably want to switch over to the new host as the old site is down.

"Failed to Parse JSON" for every mod

./r2mod ins Rune_580-Risk_Of_Options
→ Updating API Cache...
✓ R2Mod Up to Date
→ Installing Risk_Of_Options...
✖ Failed to Parse JSON for Rune_580-Risk_Of_Options

I'm on NixOS. Is there anything that can be done to get more information about or (preferably) fix the issue?

Feature request: ability to disable mods one by one

Hi,

Can you add the ability to disable only a selected mod ?

Currently, I have just created a plugins_disabled folders on BepInEx root folder and move them manually from/too plugins folder.

It will be nice if the plugins from the disabled folder can be updated too. (Usefull when waiting for a plugin fix for a new version of the game).

Thanks you.
Regards,

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.