All skills

Tauri v2+ cross-platform app development with Rust backend. Use when configuring tauri.conf.json, implementing Rust commands (#[tauri::command]), setting up IPC patterns (invoke, emit, channels), configuring permissions/capabilities, troubleshooting build issues, or deploying desktop/mobile apps. Triggers on Tauri, src-tauri, invoke, emit, capabilities.json.

Use this Skill: https://skilld.dev/gh/nodnarbnitram/claude-code-extensions/tauri-v2

This session only. Nothing lands on disk.

referencesadvanced-runtime-reference.md

≈1.3k tokens on demand. Your agent reads this file only when SKILL.md points to it.

Tauri v2+ Advanced Runtime Reference

Contents

  • System Tray (TrayIconBuilder)
  • Sidecars (External Binaries)
  • Deep Links (tauri-plugin-deep-link)
  • Custom Protocols

Covers system tray integration, sidecar processes, deep links, and custom protocols. Last verified: 2026-04-02. Check official Tauri v2+ docs for updates.

See also:

Section 1: System Tray (TrayIconBuilder)

v2 Change: SystemTray from v1 is replaced by TrayIconBuilder in v2. Do NOT use SystemTray.

// In lib.rs run() function, in setup hook:
use tauri::{
    tray::{MouseButton, MouseButtonState, TrayIconBuilder, TrayIconEvent},
    Manager,
};

tauri::Builder::default()
    .setup(|app| {
        let tray = TrayIconBuilder::new()
            .icon(app.default_window_icon().unwrap().clone())
            .tooltip("My App")
            .on_tray_icon_event(|tray, event| {
                if let TrayIconEvent::Click {
                    button: MouseButton::Left,
                    button_state: MouseButtonState::Up,
                    ..
                } = event
                {
                    let app = tray.app_handle();
                    if let Some(window) = app.get_webview_window("main") {
                        let _ = window.show();
                        let _ = window.set_focus();
                    }
                }
            })
            .build(app)?;
        Ok(())
    })

Show tray menu example:

use tauri::menu::{Menu, MenuItem};

let quit_item = MenuItem::with_id(app, "quit", "Quit", true, None::<&str>)?;
let menu = Menu::with_items(app, &[&quit_item])?;
let tray = TrayIconBuilder::new()
    .icon(app.default_window_icon().unwrap().clone())
    .menu(&menu)
    .on_menu_event(|app, event| match event.id.as_ref() {
        "quit" => app.exit(0),
        _ => {}
    })
    .build(app)?;

Platform notes:

  • macOS: tray icon appears in menu bar; supports template images
  • Windows: tray icon in system tray; click events differ from macOS
  • Linux: tray support varies by desktop environment (requires libappindicator or libayatana-appindicator)

Section 2: Sidecars (External Binaries)

Show config and usage for bundled executables:

// tauri.conf.json
{
  "bundle": {
    "externalBin": [
      "binaries/my-sidecar"
    ]
  }
}

Capability permission required:

{
  "permissions": [
    {
      "identifier": "shell:allow-execute",
      "allow": [
        { "name": "my-sidecar", "args": true, "sidecar": true }
      ]
    }
  ]
}

Rust code to execute sidecar:

use tauri_plugin_shell::ShellExt;

#[tauri::command]
async fn run_sidecar(app: tauri::AppHandle) -> Result<String, String> {
    let output = app.shell()
        .sidecar("my-sidecar")
        .map_err(|e| e.to_string())?
        .args(["--flag", "value"])
        .output()
        .await
        .map_err(|e| e.to_string())?;
    
    Ok(String::from_utf8_lossy(&output.stdout).to_string())
}

Binary naming convention (for cross-platform bundling):

  • macOS (Intel): my-sidecar-x86_64-apple-darwin
  • macOS (ARM): my-sidecar-aarch64-apple-darwin
  • Windows: my-sidecar-x86_64-pc-windows-msvc.exe
  • Linux: my-sidecar-x86_64-unknown-linux-gnu

Section 3: Deep Links (tauri-plugin-deep-link)

cargo tauri add deep-link

Config in tauri.conf.json:

{
  "plugins": {
    "deep-link": {
      "mobile": [
        { "scheme": "myapp" }
      ],
      "desktop": [
        { "schemes": ["myapp"] }
      ]
    }
  }
}

Capability:

{ "permissions": ["deep-link:default"] }

Handling deep links in Rust:

use tauri_plugin_deep_link::DeepLinkExt;

app.deep_link().on_open_url(|event| {
    println!("Deep link: {:?}", event.urls());
});

Platform notes:

  • macOS: registers URL scheme in Info.plist automatically
  • Windows: registry entry created during install
  • Linux: .desktop file update required
  • iOS/Android: configure in respective platform files (AndroidManifest.xml or Info.plist)

Section 4: Custom Protocols

Scope note: Custom protocol (tauri:// and custom schemes via invoke_filter or asset_protocol) is a more advanced feature. The primary official pattern is the built-in asset protocol for serving local files. Custom protocol handlers require careful security consideration.

Show asset protocol access (most common use case):

// tauri.conf.json
{
  "app": {
    "security": {
      "assetScope": ["$APPDATA/assets/**", "$RESOURCE/**"]
    }
  }
}
// Access local file via asset protocol
const imgSrc = convertFileSrc('/path/to/image.png');

Note: Full custom protocol registration (tauri::Builder::register_uri_scheme_protocol) is available but underdocumented in official v2+ docs as of 2026-04-02. Prefer asset protocol for local file serving.

Source: SKILL.md on GitHub

No alerts17d5 checks · Risk SAFE
  • Gen Agent Trust Hub17d

    The skill provides comprehensive and legitimate documentation for Tauri v2 development. It emphasizes the framework's security-first approach, particularly the new capabilities and permissions model. All described behaviors, including plugin usage and the update mechanism, are standard for Tauri and accompanied by appropriate security guidance.

  • Socket17d

    No alerts

  • Snyk17d

    Risk: LOW · No issues

  • Runlayer7mo

    1/7 files flagged

  • ZeroLeaks5mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at 3493e21. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 months ago.

Steadyupdated 6 months ago
version
1.0.1
  • Rust
  • tauri
  • desktop-apps
  • mobile-apps
  • ipc
  • cross-platform
  • capabilities
  • serde
  • webview

README badge

README badge for nodnarbnitram/claude-code-extensions/tauri-v2

Builds cross-platform desktop and mobile apps with Rust backends and web frontends using Tauri v2+. Covers command registration, IPC patterns (invoke/emit/channels), capability configuration, state management, and common build/deployment issues. Prevents 8+ typical Tauri setup errors including permission denials, unregistered commands, and mobile build failures.

Generated from the current SKILL.md.

Does this skill work with Tauri v1?
No. This skill is for Tauri v2+ only. It covers the v2 API (e.g., `@tauri-apps/api/core`, the `lib.rs` split for mobile, and v2 capability system).
Can I use this for mobile apps?
Yes. The skill covers both desktop and mobile Tauri builds, including the required `#[cfg_attr(mobile, tauri::mobile_entry_point)]` pattern and Rust target setup.
What IPC patterns does this cover?
The skill documents commands, events, channels, and state management. Deeper IPC decision guidance is in the bundled `references/ipc-patterns.md` file.
Does this cover plugin setup?
Yes. The skill explains how to add plugin permissions to capabilities and references the bundled `references/plugin-reference.md` for official Tauri plugins.
What are the minimum Rust changes needed to add a command?
Add a `#[tauri::command]` function in `lib.rs`, register it in `tauri::generate_handler![]`, add required permissions to `capabilities/default.json`, and call it from frontend with `invoke()`.

Generated from the current SKILL.md. These answers refresh after source changes.