wails
SKILL.md
What I do
- Set up and validate Wails prerequisites (Go, Node/NPM, platform deps)
- Create projects with
wails initand pick templates/frameworks - Run dev workflows with
wails devand explain live reload/browser mode - Build production binaries with
wails buildand platform-specific flags - Use runtime APIs (window, menu, dialog, events, log, browser, clipboard, screen, drag-and-drop)
- Configure
wails.jsonand 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 devand describe browser dev server athttp://localhost:34115. - For builds, use
wails build; on Linux with newer distros, add-tags webkit2_41when needed. - For runtime usage, use the Go runtime package
github.com/wailsapp/wails/v2/pkg/runtimeorwindow.runtimein JS. - For events, prefer
EventsOn,EventsOnce,EventsOnMultiple,EventsOff, andEventsEmitto coordinate Go/JS. - If issues arise, run
wails doctorand 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
wailsjsmodules. - Runtime methods are available in Go via
runtimeand in JS viawindow.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:-ttemplate (local or remote GitHub URL),-nname,-ddir,-ide.wails dev:-assetdir,-wailsjsdir,-frontenddevserverurl,-browser,-loglevel.wails build:-platform,-tags,-obfuscated,-upx,-nsis,-devtools,-debug.wails generate module: regeneratewailsjswithout 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(requiresEnableFileDrop).
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.jsand/wails/runtime.jstoindex.html. - Use
<meta name="wails-options" content="noautoinject">to opt out and inject manually. - For external dev servers (example: CRA), configure
frontend:dev:watcherandfrontend:dev:serverUrl.
Guides quick hits
- Angular: set
frontend:build,frontend:install,frontend:dev:watcher,frontend:dev:serverUrlforng. - Routing: prefer hash-based routing (Vue hash, Angular useHash, React HashRouter, Svelte SPA router).
- Frameless:
Frameless: true, use--wails-draggable:dragand--wails-draggable:no-drag. - Overscroll: disable bounce with
html { height: 100%; overflow: hidden; }. - Dynamic assets: use
AssetServer.Handlerto serve fallback/dynamic content (watch Vite v5 warning). - Obfuscation:
wails build -obfuscatedwith optional-garbleargsand rely onwailsjsbindings. - Single instance lock:
SingleInstanceLockwithUniqueIdandOnSecondInstanceLaunch. - 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 installfrom cloned repo and usereplaceingo.mod. - Linux notes: distro package support, GStreamer plugin for media, NixOS font-size workaround.
- IDEs:
-ide vscodeor-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:buildtonpx ng buildandfrontend:installtonpm installinwails.json. - Add
frontend:dev:watcher=npx ng serveandfrontend:dev:serverUrl=http://localhost:4200. - Run
wails dev.
SvelteKit integration
wails init -n <name> -t svelte.- Delete
frontend/, thennpx sv create frontend. - In
wails.jsonadd"wailsjsdir": "./frontend/src/lib"and update package manager commands. - In
main.gochange//go:embed all:frontend/distto//go:embed all:frontend/build. - Update
.gitignorefromfrontend/disttofrontend/build. - In
frontend/, install deps, replace adapter with@sveltejs/adapter-static. - Add
src/routes/+layout.tswithexport const prerender = trueandexport const ssr = false. - Run
wails dev.
Frameless window drag zones
- Set
Frameless: trueinoptions.App. - Use
--wails-draggable:dragon the container. - Use
--wails-draggable:no-dragon interactive elements. - If CSS variables are unavailable, set
CSSDragPropertyandCSSDragValuein options.
Dynamic assets
- Configure
AssetServer.Handlerinoptions.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
wailsjsbindings (notwindow.gonames).
Single instance lock
- Add
SingleInstanceLockwith a UUIDUniqueId. - Use
OnSecondInstanceLaunchto process args and bring window forward. - Treat second-instance data as untrusted input.
Custom protocols
- Add
info.protocolsinwails.jsonwithscheme,description,role. - macOS: handle
Mac.OnUrlOpen. - Windows: use NSIS installer; parse command-line args or use single instance lock.
- Linux: create
.desktopand mime entries via packaging (eg. nfpm).
File associations
- Add
info.fileAssociationsinwails.jsonwithext,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/installerinfo fromwails.json. - Run
wails build -nsisand usebuild/binoutput.
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/v2in your appgo.mod. - Revert by reinstalling CLI from
@latestand 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.exewith/fd sha256and 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
gonfor signing + notarization; configurebuild/darwin/gon-sign.jsonand entitlements. - Import certs via
Apple-Actions/import-codesign-certs@v1, then rungon.
Mac App Store submission
- Create App ID, certs, provisioning profile, and App Store Connect entry.
- Add
build/darwin/entitlements.plistwith App Sandbox settings. - Build and sign with
wails build -platform darwin/universal, thencodesignandproductbuild. - 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=4096if needed. - Run
wails build(ordAppServer/wails-build-action) and uploadbuild/bin/*.
WebView2 strategies (Windows)
- Use
wails build -webview2 <download|embed|browser|error>. - For fixed runtime, set
WebviewBrowserPathand bundle the runtime. - If running as admin, set
WebviewUserDataPathto a shared location.
Manual build process (decomposed)
- Install frontend deps (unless
-sor nofrontend:install). - Build frontend (unless
-sor nofrontend:build). - Generate assets/icons (Windows uses winicon + winres).
- Compile Go (
-tags devwith-gcflagsfor dev,-tags desktop,productionfor prod). - Optional UPX compression (
-upx).
Templates
wails generate template -name <name>to scaffold a template.- For existing frontend, use
-frontendpath and update template files. - Test with
wails init -t <path>thenwails build. - Publish to GitHub and submit to Community Templates.
IDE setup
- Use
wails init -ide vscodeor-ide goland. - For VS Code, update
.vscode/tasks.jsonto include frontend install/build steps. - For Vue + Vetur, add
vetur.config.jspointing atfrontend/.
Troubleshooting highlights
- White screen: verify
//go:embed all:frontend/distand assets infrontend/dist. - macOS blank screen: add
NSAllowsLocalNetworkingtoInfo.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
mousedownlistener and inspectevent.buttonfor button index.
NixOS font-size bug
- Add
XDG_DATA_DIRSandGIO_MODULE_DIRto yourdevShellhook.
Notes
- Wails generates Go bindings and TypeScript models for frontend calls.
- Project layout includes
main.go,frontend/,build/, andwails.json. - Runtime methods need a context from
OnStartuporOnDomReady. - 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
-webview2strategies 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.
Weekly Installs
14
Repository
codegirl-007/aiplatformGitHub Stars
2
First Seen
Feb 28, 2026
Security Audits
Installed on
opencode14
gemini-cli14
github-copilot14
amp14
cline14
codex14