Getting Started
Requirements
Section titled “Requirements”- Linux (WebKitGTK) — macOS/Windows planned
- Tauri v2 (v1 not supported)
- Rust 1.94.0+ (edition 2024)
Installation
Section titled “Installation”1. Add the plugin to your Tauri app
Section titled “1. Add the plugin to your Tauri app”Add the plugin to src-tauri/Cargo.toml:
[dependencies]tauri-plugin-pilot = { git = "https://github.com/mpiton/tauri-pilot" }2. Register the plugin
Section titled “2. Register the plugin”Register the plugin in src-tauri/src/main.rs. The plugin is gated to debug builds only — it has no effect in production releases:
fn main() { let mut builder = tauri::Builder::default();
#[cfg(debug_assertions)] { builder = builder.plugin(tauri_plugin_pilot::init()); }
builder.run(tauri::generate_context!()).expect("error running app");}3. Install the CLI
Section titled “3. Install the CLI”cargo install tauri-pilot-cliQuick Start
Section titled “Quick Start”# Check connectiontauri-pilot ping
# List open windows (multi-window apps)tauri-pilot windows
# Inspect the UItauri-pilot snapshot -i # interactive elements onlytauri-pilot snapshot -s "#sidebar" # scoped to a CSS selector
# Target a specific windowtauri-pilot --window settings snapshot -i
# Interacttauri-pilot click @e3tauri-pilot fill @e2 "hello"tauri-pilot press Enter
# Verifytauri-pilot assert text @e1 "Expected text"tauri-pilot assert visible @e3tauri-pilot wait --selector ".success-message"
# Record and replaytauri-pilot record starttauri-pilot click @e3tauri-pilot fill @e2 "test"tauri-pilot record stop --output test.jsontauri-pilot replay test.jsontauri-pilot replay test.json --export sh # generate shell scriptBasic Usage Flow
Section titled “Basic Usage Flow”tauri-pilot follows a ping → snapshot → interact → verify workflow (optionally wrapped in record for replay):
- Ping — verify the plugin is running and the socket is reachable.
- Snapshot — capture the current state of the UI. This assigns stable refs (
@e1,@e2, …) to every element. Refs are reset on each snapshot, so always snapshot before interacting. - Interact — use refs to click, fill, press, or scroll elements.
- Verify — use
assertfor one-step verification,waitfor async state, ordiffto see what changed.
Example snapshot output
Section titled “Example snapshot output”$ tauri-pilot snapshot -i- heading "PR Dashboard" [ref=e1]- textbox "Search PRs" [ref=e2] value=""- button "Refresh" [ref=e3]- list "PR List" [ref=e4] - listitem "fix: resolve memory leak #142" [ref=e5] - listitem "feat: add workspace support #138" [ref=e6]- button "Load More" [ref=e7]After this snapshot, @e3 refers to the “Refresh” button. You can then run:
tauri-pilot click @e3If the UI changes (navigation, re-render), take a new snapshot before using refs again.