Skip to main content

Overview

LiquidLauncher exposes its backend functionality through Tauri commands that can be invoked from the frontend. These commands are organized into four main categories:
  • Authentication Commands - Handle Minecraft and LiquidBounce account authentication
  • Client API Commands - Interact with the LiquidBounce API for builds, mods, and game launching
  • Data Management Commands - Store and retrieve launcher configuration
  • System Commands - Access system information and perform checks

Command Categories

Authentication

Commands for managing Minecraft and LiquidBounce accounts.

Microsoft Login

Authenticate with a Microsoft account

Offline Login

Create an offline Minecraft account

Client Authentication

Authenticate with LiquidBounce account

Refresh Token

Refresh authentication tokens

Client API

Commands for interacting with the LiquidBounce API and managing the game client.

Launch Client

Start the Minecraft client with LiquidBounce

Request Branches

Get available LiquidBounce branches

Request Builds

Get builds for a specific branch

Manage Mods

Install and manage custom mods

Data Management

Commands for managing launcher configuration and data.

Options Management

Get and store launcher options

System

Commands for system information and checks.

System Information

Get launcher version and system memory

Using Commands

All commands are invoked using Tauri’s invoke function from the frontend:
import { invoke } from '@tauri-apps/api/core';

// Example: Get launcher options
const options = await invoke('get_options');

// Example: Login with Microsoft
const account = await invoke('login_microsoft');

// Example: Request branches with parameters
const branches = await invoke('request_branches', {
  client: clientInstance
});

Error Handling

All commands that can fail return Result<T, String> on the Rust side, which translates to a Promise that can reject with a string error message:
try {
  const account = await invoke('login_microsoft');
  console.log('Login successful:', account);
} catch (error) {
  console.error('Login failed:', error);
  // error is a string describing what went wrong
}

Type Definitions

The Rust types used in commands are serialized to JSON when crossing the Tauri bridge:
  • Enums are serialized with a type field (e.g., MinecraftAccount)
  • Structs become JavaScript objects with camelCase field names
  • Options become null when None, or the contained value when Some
  • Results throw exceptions on Err, or return the value on Ok

Source Code Location

All Tauri commands are defined in:
  • src-tauri/src/app/gui/commands/auth.rs - Authentication commands
  • src-tauri/src/app/gui/commands/client.rs - Client API commands
  • src-tauri/src/app/gui/commands/data.rs - Data management commands
  • src-tauri/src/app/gui/commands/system.rs - System commands
See the detailed pages for each category:

Build docs developers (and LLMs) love