wails

- Set up and validate Wails prerequisites (Go, Node/NPM, platform deps)

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "wails" with this command: npx skills add codegirl-007/aiplatform/codegirl-007-aiplatform-wails

What I do

  • Set up and validate Wails prerequisites (Go, Node/NPM, platform deps)

  • Create projects with wails init and pick templates/frameworks

  • Run dev workflows with wails dev and explain live reload/browser mode

  • Build production binaries with wails build and platform-specific flags

  • Use runtime APIs (window, menu, dialog, events, log, browser, clipboard, screen, drag-and-drop)

  • Configure wails.json and application options when needed

  • Apply frontend script injection rules and external dev server setups

  • Use guides for platform-specific packaging, signing, and troubleshooting

  • Point to CLI, options, menus, project config, and runtime references

When to use me

Use this skill for Wails app creation, local development, build issues, and CLI usage. Ask clarifying questions if platform, template, or Wails version is unclear.

Workflow

  • Identify the target OS and Wails version.

  • Confirm prerequisites: Go 1.21+, Node/NPM, and platform deps (xcode, WebView2, GTK/WebKit).

  • For new apps, choose a template and run wails init -n <name> -t <template> .

  • For dev, use wails dev and describe browser dev server at http://localhost:34115 .

  • For builds, use wails build ; on Linux with newer distros, add -tags webkit2_41 when needed.

  • For runtime usage, use the Go runtime package github.com/wailsapp/wails/v2/pkg/runtime or window.runtime in JS.

  • For events, prefer EventsOn , EventsOnce , EventsOnMultiple , EventsOff , and EventsEmit to coordinate Go/JS.

  • If issues arise, run wails doctor and resolve missing deps.

Architecture

  • Wails is a Go app with a WebView frontend and a shared runtime library.

  • Go methods are bound and exposed to JS with autogenerated wailsjs modules.

  • Runtime methods are available in Go via runtime and in JS via window.runtime .

Key commands

go install github.com/wailsapp/wails/v2/cmd/wails@latest wails doctor wails init -n myproject -t <template> wails dev wails build

CLI highlights

  • wails init : -t template (local or remote GitHub URL), -n name, -d dir, -ide .

  • wails dev : -assetdir , -wailsjsdir , -frontenddevserverurl , -browser , -loglevel .

  • wails build : -platform , -tags , -obfuscated , -upx , -nsis , -devtools , -debug .

  • wails generate module : regenerate wailsjs without running dev.

  • wails generate template : scaffold or derive templates from a frontend project.

Runtime API map

  • Events: EventsOn , EventsOff , EventsOnce , EventsOnMultiple , EventsEmit .

  • Log: LogTrace , LogDebug , LogInfo , LogWarning , LogError , LogFatal , LogSetLogLevel .

  • Window: title, size, position, fullscreen/maximise/minimise, show/hide, reload, exec JS.

  • Dialog: open/save dialogs, message dialogs (Go only).

  • Menu: set/update application menu (Go only).

  • Browser: open URL in system browser.

  • Clipboard: get/set text.

  • Screen: list connected screens.

  • Drag and Drop: OnFileDrop , OnFileDropOff (requires EnableFileDrop ).

Config and options

  • wails.json : frontend dirs/build scripts, assetdir, reload dirs, dev server URL, output name, build tags, hooks, info/associations/protocols, bindings ts generation.

  • App options: window size, frame, start state, background, always-on-top, menus, logging, callbacks, bindings, single-instance lock, drag-and-drop, default context menu, fraud detection.

  • OS-specific options: Windows (WebView2, theme, backdrop, zoom), Mac (title bar, appearance, transparency, about), Linux (icons, GPU policy).

Frontend integration

  • Default script injection adds /wails/ipc.js and /wails/runtime.js to index.html .

  • Use <meta name="wails-options" content="noautoinject"> to opt out and inject manually.

  • For external dev servers (example: CRA), configure frontend:dev:watcher and frontend:dev:serverUrl .

Guides quick hits

  • Angular: set frontend:build , frontend:install , frontend:dev:watcher , frontend:dev:serverUrl for ng .

  • Routing: prefer hash-based routing (Vue hash, Angular useHash, React HashRouter, Svelte SPA router).

  • Frameless: Frameless: true , use --wails-draggable:drag and --wails-draggable:no-drag .

  • Overscroll: disable bounce with html { height: 100%; overflow: hidden; } .

  • Dynamic assets: use AssetServer.Handler to serve fallback/dynamic content (watch Vite v5 warning).

  • Obfuscation: wails build -obfuscated with optional -garbleargs and rely on wailsjs bindings.

  • Single instance lock: SingleInstanceLock with UniqueId and OnSecondInstanceLaunch .

  • Custom protocols and file associations: define info.protocols / info.fileAssociations , platform specifics.

  • NSIS installer: install NSIS, build with wails build -nsis .

  • Local dev on Wails master/PRs: go install from cloned repo and use replace in go.mod .

  • Linux notes: distro package support, GStreamer plugin for media, NixOS font-size workaround.

  • IDEs: -ide vscode or -ide goland ; adjust VS Code tasks for frontend builds.

  • Tutorials: Hello World and Dogs API show basic init/build/dev flows.

Step-by-step playbooks

Angular dev server

  • Set frontend:build to npx ng build and frontend:install to npm install in wails.json .

  • Add frontend:dev:watcher = npx ng serve and frontend:dev:serverUrl = http://localhost:4200 .

  • Run wails dev .

SvelteKit integration

  • wails init -n <name> -t svelte .

  • Delete frontend/ , then npx sv create frontend .

  • In wails.json add "wailsjsdir": "./frontend/src/lib" and update package manager commands.

  • In main.go change //go:embed all:frontend/dist to //go:embed all:frontend/build .

  • Update .gitignore from frontend/dist to frontend/build .

  • In frontend/ , install deps, replace adapter with @sveltejs/adapter-static .

  • Add src/routes/+layout.ts with export const prerender = true and export const ssr = false .

  • Run wails dev .

Frameless window drag zones

  • Set Frameless: true in options.App .

  • Use --wails-draggable:drag on the container.

  • Use --wails-draggable:no-drag on interactive elements.

  • If CSS variables are unavailable, set CSSDragProperty and CSSDragValue in options.

Dynamic assets

  • Configure AssetServer.Handler in options.App .

  • Serve missing assets or handle non-GET requests in the handler.

  • Avoid exposing arbitrary filesystem paths without authorization checks.

Obfuscated builds

  • Build with wails build -obfuscated (optional -garbleargs ).

  • Ensure frontend calls use generated wailsjs bindings (not window.go names).

Single instance lock

  • Add SingleInstanceLock with a UUID UniqueId .

  • Use OnSecondInstanceLaunch to process args and bring window forward.

  • Treat second-instance data as untrusted input.

Custom protocols

  • Add info.protocols in wails.json with scheme , description , role .

  • macOS: handle Mac.OnUrlOpen .

  • Windows: use NSIS installer; parse command-line args or use single instance lock.

  • Linux: create .desktop and mime entries via packaging (eg. nfpm).

File associations

  • Add info.fileAssociations in wails.json with ext , name , iconName , description , role .

  • macOS: handle Mac.OnFileOpen .

  • Windows: use NSIS installer; parse args or use single instance lock.

  • Linux: create mime files, desktop entry, icons, and package scripts.

NSIS installer

  • Install NSIS (scoop/winget/choco/brew).

  • Configure build/windows/installer info from wails.json .

  • Run wails build -nsis and use build/bin output.

Local development against Wails master/PR

  • Clone github.com/wailsapp/wails , checkout target branch/PR.

  • cd v2/cmd/wails && go install .

  • Add replace github.com/wailsapp/wails/v2 => <clonedir>/wails/v2 in your app go.mod .

  • Revert by reinstalling CLI from @latest and removing replace.

Extended guides

Code signing (Windows)

  • Base64-encode your .pfx/.p12 certificate and store as GitHub Actions secrets.

  • Build the app in CI, then use signtool.exe with /fd sha256 and timestamp server.

  • If using Actions, ensure the signing step runs after wails build .

Code signing (macOS)

  • Export your Apple Developer cert (.p12) and base64-encode it.

  • Use gon for signing + notarization; configure build/darwin/gon-sign.json and entitlements.

  • Import certs via Apple-Actions/import-codesign-certs@v1 , then run gon .

Mac App Store submission

  • Create App ID, certs, provisioning profile, and App Store Connect entry.

  • Add build/darwin/entitlements.plist with App Sandbox settings.

  • Build and sign with wails build -platform darwin/universal , then codesign and productbuild .

  • Upload via Transporter and attach build in App Store Connect.

GitHub Actions cross-platform builds

  • Use a matrix for linux/amd64 , windows/amd64 , darwin/universal .

  • Cache node and Go deps; set NODE_OPTIONS=--max-old-space-size=4096 if needed.

  • Run wails build (or dAppServer/wails-build-action ) and upload build/bin/* .

WebView2 strategies (Windows)

  • Use wails build -webview2 <download|embed|browser|error> .

  • For fixed runtime, set WebviewBrowserPath and bundle the runtime.

  • If running as admin, set WebviewUserDataPath to a shared location.

Manual build process (decomposed)

  • Install frontend deps (unless -s or no frontend:install ).

  • Build frontend (unless -s or no frontend:build ).

  • Generate assets/icons (Windows uses winicon + winres).

  • Compile Go (-tags dev with -gcflags for dev, -tags desktop,production for prod).

  • Optional UPX compression (-upx ).

Templates

  • wails generate template -name <name> to scaffold a template.

  • For existing frontend, use -frontend path and update template files.

  • Test with wails init -t <path> then wails build .

  • Publish to GitHub and submit to Community Templates.

IDE setup

  • Use wails init -ide vscode or -ide goland .

  • For VS Code, update .vscode/tasks.json to include frontend install/build steps.

  • For Vue + Vetur, add vetur.config.js pointing at frontend/ .

Troubleshooting highlights

  • White screen: verify //go:embed all:frontend/dist and assets in frontend/dist .

  • macOS blank screen: add NSAllowsLocalNetworking to Info.plist .

  • Windows icon cache: delete %LOCALAPPDATA%/IconCache.db .

  • Variadic args: pass array without spread to backend.

  • Stuck on bindings: ensure app exits after wails.Run() .

  • macOS compile errors: update Xcode CLI tools or switch toolchain path.

  • WebView2 missing: install correct architecture runtime.

Routing patterns

  • Vue: createWebHashHistory() .

  • Angular: RouterModule.forRoot(routes, { useHash: true }) .

  • React: HashRouter .

  • Svelte: svelte-spa-router .

Mouse buttons (frameless apps)

  • Use mousedown listener and inspect event.button for button index.

NixOS font-size bug

  • Add XDG_DATA_DIRS and GIO_MODULE_DIR to your devShell hook.

Notes

  • Wails generates Go bindings and TypeScript models for frontend calls.

  • Project layout includes main.go , frontend/ , build/ , and wails.json .

  • Runtime methods need a context from OnStartup or OnDomReady .

  • Events can be emitted from Go or JavaScript with optional data payloads.

  • Manual builds follow install -> build frontend -> generate assets -> compile -> optional UPX.

  • Windows WebView2 can be handled via -webview2 strategies or fixed runtime.

  • Use guides for code signing, Mac App Store submission, and GitHub Actions builds.

  • Use CLI, options, menus, project config, and runtime references for details.

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

openclaw-version-monitor

监控 OpenClaw GitHub 版本更新,获取最新版本发布说明,翻译成中文, 并推送到 Telegram 和 Feishu。用于:(1) 定时检查版本更新 (2) 推送版本更新通知 (3) 生成中文版发布说明

Archived SourceRecently Updated
Coding

ask-claude

Delegate a task to Claude Code CLI and immediately report the result back in chat. Supports persistent sessions with full context memory. Safe execution: no data exfiltration, no external calls, file operations confined to workspace. Use when the user asks to run Claude, delegate a coding task, continue a previous Claude session, or any task benefiting from Claude Code's tools (file editing, code analysis, bash, etc.).

Archived SourceRecently Updated
Coding

ai-dating

This skill enables dating and matchmaking workflows. Use it when a user asks to make friends, find a partner, run matchmaking, or provide dating preferences/profile updates. The skill should execute `dating-cli` commands to complete profile setup, task creation/update, match checking, contact reveal, and review.

Archived SourceRecently Updated