1
1
Fork
You've already forked startmc
0
CLI for launching Minecraft clients
  • Rust 100%
2025年07月18日 21:06:10 +03:00
crates cargo fmt 2025年07月18日 21:06:10 +03:00
src cargo fmt 2025年07月18日 21:06:10 +03:00
.gitignore i can now actually remove stuff with complete certainty that it's gone 2025年06月10日 16:47:04 +03:00
Cargo.lock finish init, move to owo-colors 2025年06月17日 19:09:36 +03:00
Cargo.toml finish init, move to owo-colors 2025年06月17日 19:09:36 +03:00
LICENSE Add LICENSE 2025年06月08日 19:58:18 +03:00
README.md start init, allow library usage 2025年06月17日 17:14:44 +03:00

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

  1. Install mingw-w64-gcc (this is for Arch Linux, for other distros it might be different)
sudo pacman -S mingw-w64-gcc
  1. Cross-compile!
cargo build --target x86_64-pc-windows-gnu --release
  1. 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();

Credits

  • wiki.vg and all its contibutions for documenting, like, the entire asset, library, etc download and launch progress.
  • pacman for inspiration for the CLI interface. Seriously, it's awesome.