Skip to content

Tauri IPC Commands

All backend logic is exposed as Tauri commands. No HTTP server runs inside the app. Frontend calls these via invoke():

import { invoke } from '@tauri-apps/api/core';
const result = await invoke<string>('run_top_gear', { simcContent });

Runs a SimulationCraft simulation.

Inputsimc_content: String — the complete .simc file content
OutputString — the json2 output content
Defined incommands/run_simc.rs

Behavior:

  1. Writes simc_content to a temp file (uuid.simc)
  2. Creates a temp path for JSON output (uuid.json)
  3. Invokes the SimC sidecar via app.shell().sidecar("simc")
  4. Waits for exit — checks JSON file exists (not exit code)
  5. Reads and returns the JSON file content
  6. Cleans up both temp files

Fetches item data from Wowhead.

Inputitem_id: u32
OutputString — Wowhead XML response
Defined incommands/item_data.rs

Used by the frontend item cache to resolve item names and quality colors.

Searches the bundled item database.

Inputquery: String
OutputVec<ItemSearchResult>
Defined incommands/item_data.rs

Searches items.db using SQLite FTS5 full-text search. Returns up to 10 results with item name, slot, and quality.

Reads the user’s app configuration.

Input
OutputAppConfig
Defined incommands/config.rs

Returns the persisted configuration including SimC binary path override and thread count.

Updates the user’s app configuration.

InputAppConfig
Output
Defined incommands/config.rs

Persists configuration changes via Tauri’s store plugin.

Checks that the SimC sidecar is accessible and working.

Input
OutputBinaryStatus
Defined incommands/config.rs

Run on app startup. On macOS, also strips the quarantine xattr from the sidecar binary.

  1. Create src-tauri/src/commands/my_feature.rs
  2. Define: #[tauri::command] pub async fn my_feature(...) -> Result<T, String>
  3. Register in main.rs: tauri::generate_handler![..., my_feature]
  4. Call from TypeScript: invoke<T>('my_feature', { args })

All commands must be async to avoid blocking the Tauri main thread.