Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

tauri

БесплатноБез исполняемых скриптовНе проверен

Tauri builds desktop and mobile apps from a web frontend and a Rust backend, rendering the UI in the operating system's webview instead of a bundled Chromium…

TerminalSkillsот TerminalSkills★ 221 звезда на GitHub

Об этом скилле

Tauri

Overview

Tauri is a framework for building cross-platform desktop and mobile applications using any web framework for the frontend and Rust for the backend. The UI runs in the system webview (WebView2 on Windows, WKWebView on macOS and iOS, WebKitGTK on Linux), so no browser engine is shipped with the app. The frontend talks to Rust through commands (request/response), events and channels (push), and every native API it may reach has to be granted in a capability file.

This skill covers Tauri v2. A v1 project (tauri.conf.json with an allowlist) is migrated with npm run tauri migrate. For installing and pinning the Rust toolchain itself, use the rust skill.

Instructions

Prerequisites

Tauri 2.12 requires Rust 1.90 or newer plus the platform's webview toolchain:

# Debian / Ubuntu (22.04 or newer: Tauri v2 needs WebKitGTK 4.1)
sudo apt update
sudo apt install libwebkit2gtk-4.1-dev build-essential curl wget file \
  libxdo-dev libssl-dev libayatana-appindicator3-dev librsvg2-dev

On macOS run xcode-select --install (full Xcode only for iOS targets). On Windows install the Microsoft C++ Build Tools ("Desktop development with C++") and make sure the MSVC Rust toolchain is the default (rustup default stable-msvc). WebView2 ships with Windows 10 1803 and later. npm run tauri info prints what is missing.

Create a project

npm create tauri-app@latest markdown-notes -- --template react-ts --manager npm --identifier io.inkwell.notes
cd markdown-notes
npm install
npm run tauri dev          # compiles the Rust side and opens the window with hot reload

Templates: vanilla, vue, svelte, react, solid, preact (each with a -ts variant), angular, and the Rust frontends yew, leptos, sycamore, dioxus. To add Tauri to an existing frontend instead, run npm install -D @tauri-apps/cli@latest and npx tauri init; it asks for the dev server URL and the build command and creates src-tauri/.

The CLI is the same whichever way it is started: npm run tauri dev, pnpm tauri dev, bun tauri dev, or cargo tauri dev after cargo install tauri-cli --version "^2.0.0" --locked. With npm, flags for the CLI go after -- (npm run tauri build -- --debug).

Project layout

src-tauri/                    # next to the frontend's package.json and src/
├── Cargo.toml                # tauri, tauri-build, tauri-plugin-* crates
├── build.rs                  # tauri_build::build()
├── tauri.conf.json           # identifier, windows, build commands, bundle, plugin config
├── capabilities/default.json # what the frontend is allowed to call
└── src/
    ├── lib.rs                # app code: commands, plugins, setup — edit this
    └── main.rs               # desktop entry point that calls lib's run(); leave as is

App code lives in lib.rs because mobile builds load the app as a library. tauri.conf.json v2 keys: build.devUrl, build.frontendDist, build.beforeDevCommand, build.beforeBuildCommand, app.windows, app.security, bundle, plugins. A tauri.linux.conf.json, tauri.windows.conf.json or tauri.macos.conf.json next to it is merged on that platform; arrays are replaced, not appended.

Commands: call Rust from the frontend

// src-tauri/src/lib.rs
#[tauri::command]
fn word_count(note_text: String) -> usize {
    note_text.split_whitespace().count()
}

#[tauri::command]
async fn parse_port(input: String) -> Result<u16, String> {
    input.trim().parse::<u16>().map_err(|e| e.to_string())
}

#[cfg_attr(mobile, tauri::mobile_entry_point)]
pub fn run() {
    tauri::Builder::default()
        .invoke_handler(tauri::generate_handler![word_count, parse_port])
        .run(tauri::generate_context!())
        .expect("error while running tauri application");
}
import { invoke } from "@tauri-apps/api/core";
const words = await invoke<number>("word_count", { noteText: "Ship the release notes" }); // 4
const port = await invoke<number>("parse_port", { input: "80800" }); // rejects with the Err string
  • Argument keys are camelCase in JavaScript (noteText) for snake_case Rust parameters (note_text); use #[tauri::command(rename_all = "snake_case")] to keep snake_case on both sides.
  • Arguments must implement serde::Deserialize, return values and errors serde::Serialize. Most library error types such as std::io::Error do not, so map them to String or define an error enum with thiserror and a manual Serialize impl.
  • Only the last invoke_handler call counts: list every command in one generate_handler![…].
  • Commands in lib.rs must not be pub; commands in another module must be pub and are registered as notes::word_count. Names are global, not scoped by module.
  • A command without async runs on the main thread; declare long work async. An async command cannot take borrowed arguments such as &str or State<'_, T> unless it returns a Result.
  • For large binary payloads
Полный SKILL.md на GitHub

Установить tauri в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

_scores.json

FAQ

Что делает скилл tauri?

Tauri builds desktop and mobile apps from a web frontend and a Rust backend, rendering the UI in the operating system's webview instead of a bundled Chromium. Use when creating or extending a Tauri v2 app: scaffolding with create-tauri-app, writing Rust commands and calling them with invoke, pushing events or channel data to the frontend, adding plugins, fixing "not allowed" permission errors in capabilities, bundling installers, or shipping signed auto-updates. Trigger words: tauri, tauri v2, tauri command, tauri plugin, capabilities, system webview, rust desktop app.

Как установить скилл tauri?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл tauri запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить tauri с