agentleFS
taixuanntaixuann/development-space/.claude/skills/configuring-tauri-apps/SKILL.md

configuring-tauri-apps

Skill1 starsChanged 14 days agoMITView on GitHub

Guides developers through Tauri v2 configuration including tauri.conf.json structure, Cargo.toml settings, environment-specific configs, and common configuration options for desktop and mobile applications.

The file

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 3 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Create platform-specific files that override base configuration using JSON Merge Patch (RFC 7396).

    line 178
  2. Very specific:

    When using Tauri.toml, configuration uses kebab-case:

    line 329
  3. Distinctive:

    Commit lock files for reproducible builds:

    line 414
  4. Distinctive:

    Use the JSON schema for editor autocompletion:

    line 425
  5. Very specific:

    Run tauri info to verify configuration and environment setup.

    line 431

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Tauri Configuration Files

Tauri v2 applications use three primary configuration files to manage application behavior, dependencies, and build processes.

Configuration File Overview

FilePurposeFormat
tauri.conf.jsonTauri-specific settingsJSON, JSON5, or TOML
Cargo.tomlRust dependencies and metadataTOML
package.jsonFrontend dependencies and scriptsJSON

tauri.conf.json

The main configuration file located in src-tauri/. Defines application metadata, window behavior, bundling options, and plugin settings.

Supported Formats

  • JSON (default): tauri.conf.json
  • JSON5: tauri.conf.json5 (requires config-json5 Cargo feature)
  • TOML: Tauri.toml (requires config-toml Cargo feature)

Complete Configuration Structure

{
  "$schema": "https://schema.tauri.app/config/2",
  "productName": "MyApp",
  "version": "1.0.0",
  "identifier": "com.company.myapp",
  "mainBinaryName": "my-app",
  "build": {
    "devUrl": "http://localhost:3000",
    "frontendDist": "../dist",
    "beforeDevCommand": "npm run dev",
    "beforeBuildCommand": "npm run build",
    "features": ["custom-feature"],
    "removeUnusedCommands": true
  },
  "app": {
    "withGlobalTauri": false,
    "macOSPrivateApi": false,
    "windows": [
      {
        "title": "My Application",
        "width": 1200,
        "height": 800,
        "minWidth": 800,
        "minHeight": 600,
        "resizable": true,
        "fullscreen": false,
        "center": true,
        "visible": true,
        "decorations": true,
        "transparent": false,
        "alwaysOnTop": false,
        "focus": true,
        "url": "index.html"
      }
    ],
    "security": {
      "capabilities": [],
      "assetProtocol": {
        "enable": true,
        "scope": ["$APPDATA/**"]
      },
      "pattern": { "use": "brownfield" },
      "freezePrototype": false
    },
    "trayIcon": {
      "id": "main-tray",
      "iconPath": "icons/tray.png",
      "iconAsTemplate": true
    }
  },
  "bundle": {
    "active": true,
    "targets": "all",
    "icon": ["icons/32x32.png", "icons/128x128.png", "icons/icon.icns", "icons/icon.ico"],
    "resources": ["assets/**/*"],
    "copyright": "Copyright 2024",
    "category": "Utility",
    "shortDescription": "A short app description",
    "longDescription": "A longer description",
    "licenseFile": "../LICENSE",
    "windows": {
      "certificateThumbprint": null,
      "timestampUrl": "http://timestamp.digicert.com",
      "nsis": { "license": "../LICENSE", "installerIcon": "icons/icon.ico", "installMode": "currentUser" }
    },
    "macOS": {
      "minimumSystemVersion": "10.13",
      "signingIdentity": null,
      "dmg": { "appPosition": { "x": 180, "y": 170 }, "applicationFolderPosition": { "x": 480, "y": 170 } }
    },
    "linux": {
      "appimage": { "bundleMediaFramework": false },
      "deb": { "depends": ["libwebkit2gtk-4.1-0"] },
      "rpm": { "depends": ["webkit2gtk4.1"] }
    },
    "android": { "minSdkVersion": 24 },
    "iOS": { "minimumSystemVersion": "13.0" }
  },
  "plugins": {
    "updater": {
      "pubkey": "YOUR_PUBLIC_KEY",
      "endpoints": ["https://releases.example.com/{{target}}/{{arch}}/{{current_version}}"]
    }
  }
}

Root-Level Fields

FieldTypeRequiredDescription
productNamestringNoApplication display name
versionstringNoSemver version or path to package.json
identifierstringYesReverse domain identifier (e.g., com.tauri.example)
mainBinaryNamestringNoOverride the main binary filename

Build Configuration Fields

FieldTypeDescription
devUrlstringDevelopment server URL for hot-reload
frontendDiststringPath to built frontend assets or remote URL
beforeDevCommandstringScript to run before tauri dev
beforeBuildCommandstringScript to run before tauri build
featuresstring[]Cargo features to enable during build
removeUnusedCommandsbooleanStrip unused plugin commands from binary

Window Configuration Options

FieldTypeDefaultDescription
titlestring"Tauri"Window title
width / heightnumber800 / 600Window dimensions in pixels
minWidth / minHeightnumber-Minimum dimensions
maxWidth / maxHeightnumber-Maximum dimensions
x / ynumber-Window position
resizablebooleantrueAllow window resizing
fullscreenbooleanfalseStart in fullscreen
centerbooleanfalseCenter window on screen
visiblebooleantrueWindow visibility on start
decorationsbooleantrueShow window decorations
transparentbooleanfalseEnable window transparency
alwaysOnTopbooleanfalseKeep window above others
urlstring"index.html"Initial URL to load

Security Configuration

FieldTypeDescription
capabilitiesstring[]Permission capabilities for the application
assetProtocol.enablebooleanEnable custom asset protocol
assetProtocol.scopestring[]Allowed paths for asset protocol
pattern.usestringSecurity pattern ("brownfield" default)
freezePrototypebooleanPrevent prototype mutation

Bundle Targets by Platform

PlatformTargets
Windowsnsis, msi
macOSapp, dmg
Linuxappimage, deb, rpm
Androidapk, aab
iOSapp

Platform-Specific Configuration

Create platform-specific files that override base configuration using JSON Merge Patch (RFC 7396).

PlatformFilename
Linuxtauri.linux.conf.json
Windowstauri.windows.conf.json
macOStauri.macos.conf.json
Androidtauri.android.conf.json
iOStauri.ios.conf.json

Example src-tauri/tauri.windows.conf.json:

{
  "app": {
    "windows": [{ "title": "My App - Windows Edition" }]
  },
  "bundle": {
    "windows": { "nsis": { "installMode": "perMachine" } }
  }
}

Example src-tauri/tauri.macos.conf.json:

{
  "app": { "macOSPrivateApi": true },
  "bundle": {
    "macOS": { "minimumSystemVersion": "11.0", "entitlements": "entitlements.plist" }
  }
}

CLI Configuration Override

# Development with custom config
tauri dev --config src-tauri/tauri.dev.conf.json

# Build with beta configuration
tauri build --config src-tauri/tauri.beta.conf.json

# Inline configuration override
tauri build --config '{"bundle":{"identifier":"com.company.myapp.beta"}}'

Cargo.toml Configuration

Located in src-tauri/Cargo.toml, manages Rust dependencies.

[package]
name = "my-app"
version = "1.0.0"
edition = "2021"

[build-dependencies]
tauri-build = { version = "2.0", features = [] }

[dependencies]
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
tauri = { version = "2.0", features = [] }
tauri-plugin-shell = "2.0"
tauri-plugin-opener = "2.0"

[features]
default = ["custom-protocol"]
custom-protocol = ["tauri/custom-protocol"]

Common Tauri Features

[dependencies]
tauri = { version = "2.0", features = [
  "config-json5",      # Enable JSON5 config format
  "config-toml",       # Enable TOML config format
  "devtools",          # Enable WebView devtools
  "macos-private-api", # Enable macOS private APIs
  "tray-icon",         # Enable system tray support
  "image-png",         # PNG image support
  "image-ico",         # ICO image support
  "protocol-asset"     # Custom asset protocol
] }

Version Management

tauri = { version = "2.0" }       # Semver-compatible (recommended)
tauri = { version = "=2.0.0" }    # Exact version
tauri = { version = "~2.0.0" }    # Patch updates only

package.json Integration

{
  "name": "my-tauri-app",
  "version": "1.0.0",
  "scripts": {
    "dev": "vite",
    "build": "vite build",
    "tauri": "tauri"
  },
  "dependencies": { "@tauri-apps/api": "^2.0.0" },
  "devDependencies": { "@tauri-apps/cli": "^2.0.0" }
}

Environment-Specific Configurations

Development (src-tauri/tauri.dev.conf.json)

{
  "build": { "devUrl": "http://localhost:5173" },
  "app": {
    "withGlobalTauri": true,
    "windows": [{ "title": "My App [DEV]" }]
  }
}

Production (src-tauri/tauri.prod.conf.json)

{
  "build": { "frontendDist": "../dist", "removeUnusedCommands": true },
  "bundle": { "active": true, "targets": "all" }
}

Beta (src-tauri/tauri.beta.conf.json)

{
  "identifier": "com.company.myapp.beta",
  "productName": "MyApp Beta",
  "plugins": {
    "updater": {
      "endpoints": ["https://beta-releases.example.com/{{target}}/{{arch}}/{{current_version}}"]
    }
  }
}

TOML Configuration Format

When using Tauri.toml, configuration uses kebab-case:

[build]
dev-url = "http://localhost:3000"
before-dev-command = "npm run dev"
before-build-command = "npm run build"

[app]
with-global-tauri = false

[[app.windows]]
title = "My Application"
width = 1200
height = 800
resizable = true
center = true

[app.security]
freeze-prototype = false

[app.security.asset-protocol]
enable = true
scope = ["$APPDATA/**"]

[bundle]
active = true
targets = "all"
icon = ["icons/32x32.png", "icons/128x128.png", "icons/icon.icns", "icons/icon.ico"]

[plugins.updater]
pubkey = "YOUR_PUBLIC_KEY"
endpoints = ["https://releases.example.com/{{target}}/{{arch}}/{{current_version}}"]

Common Configuration Patterns

Multi-Window Application

{
  "app": {
    "windows": [
      { "label": "main", "title": "Main Window", "width": 1200, "height": 800, "url": "index.html" },
      { "label": "settings", "title": "Settings", "width": 600, "height": 400, "url": "settings.html", "visible": false }
    ]
  }
}

System Tray Application

{
  "app": {
    "trayIcon": { "id": "main-tray", "iconPath": "icons/tray.png", "iconAsTemplate": true },
    "windows": [{ "visible": false }]
  }
}

Plugin Configuration

{
  "plugins": {
    "updater": {
      "pubkey": "YOUR_PUBLIC_KEY",
      "endpoints": ["https://releases.example.com/{{target}}/{{arch}}/{{current_version}}"],
      "windows": { "installMode": "passive" }
    },
    "shell": {
      "open": true,
      "scope": [{ "name": "open-url", "cmd": "open", "args": [{ "validator": "\\S+" }] }]
    },
    "deep-link": {
      "mobile": ["myapp"],
      "desktop": { "schemes": ["myapp"] }
    }
  }
}

Lock Files

Commit lock files for reproducible builds:

FilePurpose
Cargo.lockLocks Rust dependency versions
package-lock.jsonLocks npm dependency versions
yarn.lockLocks Yarn dependency versions
pnpm-lock.yamlLocks pnpm dependency versions

Configuration Validation

Use the JSON schema for editor autocompletion:

{ "$schema": "https://schema.tauri.app/config/2" }

Run tauri info to verify configuration and environment setup.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.