a CLI tool for managing the Icarus Mods Database
To use this app, you'll need to obtain the following:
- A Github ACCESS_TOKEN (doesn't need access to any repos, this is used purely to make API calls)
- A Google Cloud Platform credentials
keyfile.json - Ruby 3.1 (or greater)
If you aren't sure how to obtain these credentials, please see:
I highly recommend using WSL2 on Windows, or a Linux distro on your machine. This app has not been tested on Windows.
gem install Icarus-Mod-Tools
Create a file called .imtconfig.json in your home directory with the following, replacing the CAPITALIZED values with the values provided by the above links:
{
"firebase": {
"credentials": {
"copy your Google Cloud Platform keyfile.json here and remove this line": null
},
"collections": {
"modinfo": "meta/modinfo",
"toolinfo": "meta/toolinfo",
"repositories": "meta/repos",
"mods": "mods",
"tools": "tools"
}
},
"github": {
"token": "YOUR-GITHUB-TOKEN"
}
}Hint: Copy the contents of your Google Cloud Platform keyfile.json into the credentials section of the above file.
imt [options] [command]
Commands:
imt add # Adds entries to the databases
imt help [COMMAND] # Describe available commands or one specific command
imt list # Lists the databases
imt remove # Removes entries from the databases
imt sync # Syncs the databases
imt validate # Validates various entries
Options:
-C, [--config=CONFIG] # Path to the config file
# Default: /Users/dyoung/.imtconfig.json
-V, [--version], [--no-version] # Print the version and exitCommands:
imt add help [COMMAND] # Describe subcommands or one specific subcommand
imt add modinfo # Adds an entry to 'meta/modinfo/list'
imt add toolinfo # Adds an entry to 'meta/toolinfo/list'
imt add repos # Adds an entry to 'meta/repos/list'
imt add mod <filename> # Adds an entry to 'mods' when given a modinfo.json file
Options:
-C, [--config=CONFIG] # Path to the config file
# Default: /Users/dyoung/.imtconfig.json
-V, [--version], [--no-version] # Print the version and exit
-v, [--verbose], [--no-verbose] # Increase verbosity. May be repeated for even more verbosity.
# Default: [true]Commands:
imt list help [COMMAND] # Describe subcommands or one specific subcommand
imt list modinfo # Displays data from 'meta/modinfo/list'
imt list mods # Displays data from 'mods'
imt list toolinfo # Displays data from 'meta/toolinfo/list'
imt list tools # Displays data from 'tools'
imt list repos # Displays data from 'meta/repos/list'
Options:
-C, [--config=CONFIG] # Path to the config file
# Default: /Users/dyoung/.imtconfig.json
-V, [--version], [--no-version] # Print the version and exit
-v, [--verbose], [--no-verbose] # Increase verbosity. May be repeated for even more verbosity.
# Default: [true]Commands:
imt remove help [COMMAND] # Describe subcommands or one specific subcommand
imt remove mod MOD_ID # Removes a mod from the 'mods' collection
imt remove modinfo ITEM # Removes an entry from 'meta/modinfo/list'
imt remove repos REPO # Removes an entry from 'meta/repos/list' and cascades to associated mods/tools
imt remove tool TOOL_ID # Removes a tool from the 'tools' collection
imt remove toolinfo ITEM # Removes an entry from 'meta/toolinfo/list'
Options:
-C, [--config=CONFIG] # Path to the config file
# Default: /Users/dyoung/.imtconfig.json
-V, [--version], [--no-version] # Print the version and exit
-v, [--verbose], [--no-verbose] # Increase verbosity. May be repeated for even more verbosity.
# Default: [true]
[--dry-run], [--no-dry-run] # Dry run (no changes will be made)
[--cascade], [--no-cascade] # Also remove associated modinfo, toolinfo, mods, and tools entries (for repos only)
# Default: trueCommands:
imt sync all # Run all sync jobs
imt sync help [COMMAND] # Describe subcommands or one specific subcommand
imt sync modinfo # Reads from 'meta/repos/list' and Syncs any modinfo files we find (github only for now)
imt sync mods # Reads from 'meta/modinfo/list' and updates the 'mods' database accordingly
imt sync toolinfo # Reads from 'meta/repos/list' and Syncs any toolinfo files we find (github only for now)
imt sync tools # Reads from 'meta/toolinfo/list' and updates the 'tools' database accordingly
Options:
-C, [--config=CONFIG] # Path to the config file
# Default: /Users/dyoung/.imtconfig.json
-V, [--version], [--no-version] # Print the version and exit
-v, [--verbose], [--no-verbose] # Increase verbosity. May be repeated for even more verbosity.
# Default: [true]
[--dry-run], [--no-dry-run] # Dry run (no changes will be made)Note: Sync operations automatically convert GitHub URLs to the correct raw.githubusercontent.com format for direct downloads. If you're using GitHub URLs in modinfo.json or toolinfo.json files, you can use either /blob/ or /raw/ formats and they will be automatically converted. Warnings will be displayed when URLs are auto-fixed so you can update your source files.
After checking out the repo, run bin/setup to install dependencies. Then, run rake test to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and the created tag, and push the .gem file to rubygems.org.
Bug reports and pull requests are welcome on GitHub at https://github.com/DonovanMods/icarus-mod-tools.