/electronup:electronup-createfrom electronup
Creates new electronup + Electron projects via create-electronup scaffolding, or integrates electronup into existing projects. Covers templates (vanilla/vue/react/react-swc/solid), directory conventions, and minimal config.
Ships in electronup. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
electronup 是 Electron 应用的构建 CLI:Vite 构建渲染进程,主进程与 preload 由 electronup 内部打包,electron-builder 生成安装包,全部通过一个 electronup.config.ts 配置。
^22.18.0 || ^24.11.0 || >=26.0.0(node -v 检查,不满足先让用户升级)。pnpm create electronup my-app --template vue # -t 为短参数
# 或 npm create electronup@latest my-app -- --template vue
vanilla、vue、react、react-swc、solid。传入无效模板或不传时会进入交互选择;选 react(包括 -t react)时还会再询问 TypeScript / SWC 变体;-t react-swc 不会询问。想完全不交互,就同时传项目名和除 react 之外的模板,并保证目标目录为空。. 表示当前目录。目标目录非空时会询问是否清空(保留 .git),清空前先征得用户同意。https://github.com/QuiteerJs/electronup-template.git#<template>(giget 拉取,不读缓存)。网络失败时提示用户检查 GitHub 访问,或用 --mirror <地址> / 环境变量 CREATE_ELECTRONUP_MIRROR 走镜像(替换 https://github.com 这一段);不要改用其他模板仓库。cd my-app
pnpm install
pnpm dev
pnpm add -D electronup electron typescript
electronup 自带 Vite、electron-builder 等构建依赖,应用只需再装 electron(可选 peer,由应用决定版本,建议 >= 28)和 typescript。然后按约定整理目录(都可在配置里改名):
my-app/
├── main/index.ts # 主进程入口,文件名固定为 index(推荐 .ts,也支持 .js/.mjs 等)
├── preload/index.ts # 可选,需在配置 preload.entry 中登记
├── render/index.html # 渲染进程根目录(Vite root)
├── public/ # 原样拷贝的静态资源
├── lib/ # 可选,打包时作为 extraFiles 复制
├── .env / .env.{mode} # 可选
├── electronup.config.ts
└── package.json
package.json 关键字段:
{
"main": "dist/resource/electron.cjs",
"scripts": {
"dev": "electronup --no-minify",
"build": "electronup build",
"build:dir": "electronup build --dir"
}
}
main 必须指向主进程产物 resourceDir/electron.cjs(默认 dist/resource/electron.cjs);改了 resourceDir 要同步修改。dist/ 加入 .gitignore。最小 electronup.config.ts:
import { defineConfig } from 'electronup'
export default defineConfig({})
主进程加载页面的常见写法(dev 时 electronup 注入 RENDER_PORT,产物与 index.html 同在 resourceDir):
import { resolve } from 'node:path'
import process from 'node:process'
import { app, BrowserWindow } from 'electron'
const url = process.env.NODE_ENV === 'development'
? `http://localhost:${process.env.RENDER_PORT}`
: `file://${resolve(__dirname, 'index.html')}`
void app.whenReady().then(() => {
const win = new BrowserWindow({
webPreferences: { preload: resolve(__dirname, 'preload.cjs') },
})
void win.loadURL(url)
})
pnpm dev:Electron 窗口打开且渲染进程可热更新。没有下载到 Electron 二进制时窗口拉不起来,可改用下一步验证。pnpm exec electronup build --dir:生成未打包目录(如 dist/out/win-unpacked)。后续配置见 electronup-config skill,打包见 electronup-build,自动更新见 electronup-auto-update。官方文档:https://quiteerjs.github.io/electronup/。
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub quiteerjs/electronup --plugin electronup5 skills in this plugin
/electronup-auto-update在 electronup 项目中接入 electron-updater 自动更新(initAutoUpdater、checkForUpdates、autoUpdater、builderConfig.publish、各平台更新产物)并排查更新失败。用户提到自动更新、热更新安装包、latest.yml、app-update.yml、electron-updater 或“打包后 Cannot find module 'electron-updater'”时使用。/electronup-build运行 electronup dev / electronup build,为 Windows、macOS、Linux 打包指定架构的安装包,只构建渲染进程(--web)或只出目录(--dir),并排查构建/打包失败。用户要启动 Electron 开发环境、打包、出安装包、在 CI 构建或遇到 electronup 构建报错时使用。/electronup-config编写或修改 electronup.config.ts(defineConfig、目录、viteConfig、packConfig、preload、builderConfig、签名、.env 环境变量)。用户要改 electronup 配置、加 Vite 插件、配置 preload、调整 electron-builder 选项、排查“配置不生效”时使用。/electronup-modules在 Electron 主进程里接入 @quiteer/electron-* 运行时模块包(窗口 browser、IPC 契约 ipc、预加载 preload、应用生命周期 app、菜单 menu、托盘 tray、全局快捷键 shortcut)。用户要管理窗口、写类型安全的 IPC、配 preload 通道白名单、做单实例 / deep link / 退出清理、加菜单托盘快捷键,或排查这些包的报错时使用。Other plugins' skills for the same job