Agent Skills: tauri-app-file-system

Read and write local files using the Tauri v2 file-system plugin with scoped directory access. Use when implementing file read/write operations, configuring safe directory scopes, or building import/export file workflows.

UncategorizedID: teachingai/full-stack-skills/tauri-app-file-system

Install this agent skill to your local

pnpm dlx add-skill https://github.com/partme-ai/full-stack-skills/tree/HEAD/skills/tauri-skills/tauri-app-file-system

Skill Files

Browse the full folder contents for tauri-app-file-system.

Download Skill

Loading file tree…

skills/tauri-skills/tauri-app-file-system/SKILL.md

Skill Metadata

Name
tauri-app-file-system
Description
"Read and write local files using the Tauri v2 file-system plugin with scoped directory access. Use when implementing file read/write operations, configuring safe directory scopes, or building import/export file workflows."

When to use this skill

ALWAYS use this skill when the user mentions:

  • Reading or writing local files in a Tauri app
  • Configuring file system scope for safe access
  • File import/export workflows

Trigger phrases include:

  • "file system", "read file", "write file", "fs plugin", "file access", "scope"

How to use this skill

  1. Install the file-system plugin:
    cargo add tauri-plugin-fs
    
  2. Register the plugin in your Tauri builder:
    tauri::Builder::default()
        .plugin(tauri_plugin_fs::init())
    
  3. Configure scoped access in src-tauri/capabilities/default.json:
    {
      "permissions": [
        { "identifier": "fs:allow-read-text-file", "allow": [{ "path": "$APPDATA/**" }] },
        { "identifier": "fs:allow-write-text-file", "allow": [{ "path": "$APPDATA/**" }] }
      ]
    }
    
  4. Read and write files from the frontend:
    import { readTextFile, writeTextFile, BaseDirectory } from '@tauri-apps/plugin-fs';
    const content = await readTextFile('config.json', { baseDir: BaseDirectory.AppData });
    await writeTextFile('config.json', JSON.stringify(data), { baseDir: BaseDirectory.AppData });
    
  5. Define minimal directory scopes to restrict access to only the directories your app needs
  6. Validate access boundaries and handle permission errors gracefully

Outputs

  • File system plugin setup with scoped directory access
  • Read/write operations using BaseDirectory constants
  • Minimal-scope permission configuration

References

  • https://v2.tauri.app/plugin/file-system/

Keywords

tauri file system, read file, write file, scope, fs plugin, file access