- Rust 100%
| crates | cargo fmt | |
| src | cargo fmt | |
| .gitignore | i can now actually remove stuff with complete certainty that it's gone | |
| Cargo.lock | finish init, move to owo-colors | |
| Cargo.toml | finish init, move to owo-colors | |
| LICENSE | Add LICENSE | |
| README.md | start init, allow library usage | |
startmc
A CLI tool and library for launching Minecraft clients.
Features
Run Minecraft
Run a Minecraft instance named default (config is ~/.config/startmc/default.toml):
startmc
Run using a custom startmc config file:
startmc ./myinstance.toml
Download content from the internet
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
(TODO) Download and update content from Modrinth (TODO) and CurseForge (TODO (TODO))
Download mods from Modrinth:
startmc -S fabric-api sodium
Update all your installed mods:
startmc -Syu
Installation
git clone https://github.com/startmc/startmc.git
cd startmc
cargo install --path .
Cross-compiling to Windows from Linux
- 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.
Usage as a library
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.
Examples
Invoke the CLI with your own args programmatically:
usestartmc::cli::Cli;letcli=Cli::parse_from(["startmc","-I","-m","1.20.1","-f","0.16.9"]).unwrap();cli.exec().await.unwrap();Or construct it yourself:
usestartmc::cli::*;letcli=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:
usestartmc::cache::*;usestartmc::mojapi::model::fabric::*;letminecraft_version="1.20.1";letfabric_versions=use_cached_json::<FabricVersionsGame>(&format!("{}/{minecraft_version}",FABRIC_VERSIONS_GAME)).await.unwrap();