A CLI tool and library for launching Minecraft clients.
Run a Minecraft instance named default
(config is ~/.config/startmc/default.toml
):
startmc
Run using a custom startmc config file:
startmc ./myinstance.toml
Download mods:
startmc -U MOD_URL ANOTHER_MOD_URL MANY_MORE_MOD_URLS
Download resourcepacks:
startmc -U RESOURCEPACK_URL ANOTHER_RESOURCEPACK_URL MANY_MORE_RESOURCEPACK_URLS
Download mods from Modrinth:
startmc -S fabric-api sodium
Update all your installed mods:
startmc -Syu
git clone https://github.com/startmc/startmc.git
cd startmc
cargo install --path .
- Install mingw-w64-gcc (this is for Arch Linux, for other distros it might be different)
sudo pacman -S mingw-w64-gcc
- Cross-compile!
cargo build --target x86_64-pc-windows-gnu --release
- The binary should be in
target/x86_64-pc-windows-gnu/release/startmc.exe
.
You can use this library to integrate any part of startmc's functionality into your own program, or invoke it programmatically, or make a wrapper around it, or anything else that comes to your mind!
If you want to know more, please either generate API docs with cargo doc --package startmc --lib
, or read the source code.
If you see bad docs, or library-unfriendly code, or whatever else that is making it harder to use, please open an issue or, if you want, fix it and open a PR, I will greatly appreciate it.
Invoke the CLI with your own args programmatically:
use startmc::cli::Cli;
let cli = Cli::parse_from(["startmc", "-I", "-m", "1.20.1", "-f", "0.16.9"]).unwrap();
cli.exec().await.unwrap();
Or construct it yourself:
use startmc::cli::*;
let cli = Cli {
instance: "default".to_string(),
command: CliCommand::Init(CliInit {
version: Some("1.20.1".to_string()),
fabric: Some("0.16.9".to_string()),
}),
};
cli.exec().await.unwrap();
Use the cache:
use startmc::cache::*;
use startmc::mojapi::model::fabric::*;
let minecraft_version = "1.20.1";
let fabric_versions = use_cached_json::<FabricVersionsGame>(&format!(
"{}/{minecraft_version}",
FABRIC_VERSIONS_GAME
)).await.unwrap();