跨平台文件对话框抽象层Skill file-dialog-abstraction

这是一个用于实现跨平台文件对话框的软件工具,支持打开文件、保存文件和目录选择功能。它提供了统一的API接口,兼容Windows、macOS和Linux操作系统,支持多文件选择、文件类型过滤、默认路径设置等核心功能。关键词:跨平台文件对话框、桌面应用开发、文件选择器、Electron、Tauri、Qt、WPF、原生对话框、文件操作API。

前端开发 0 次安装 0 次浏览 更新于 2/25/2026

name: file-dialog-abstraction description: 跨平台文件对话框实现,用于打开、保存和目录选择 allowed-tools: Read, Write, Edit, Bash, Glob, Grep tags: [files, dialogs, cross-platform, desktop, native]

file-dialog-abstraction

实现跨平台文件对话框,用于打开、保存和目录选择,在Windows、macOS和Linux上提供一致的API。

功能

  • 打开文件对话框
  • 保存文件对话框
  • 目录选择对话框
  • 多文件选择
  • 文件类型过滤器
  • 默认路径和名称
  • 最近位置支持

输入模式

{
  "type": "object",
  "properties": {
    "projectPath": { "type": "string" },
    "framework": { "enum": ["electron", "tauri", "qt", "wpf"] },
    "dialogTypes": { "type": "array" }
  },
  "required": ["projectPath"]
}

Electron示例

const { dialog } = require('electron');

async function openFile() {
    const result = await dialog.showOpenDialog({
        properties: ['openFile', 'multiSelections'],
        filters: [
            { name: '文档', extensions: ['pdf', 'docx'] },
            { name: '所有文件', extensions: ['*'] }
        ]
    });
    return result.filePaths;
}

相关技能

  • file-watcher-setup
  • file-system-integration process