SkillsApr 12, 2026·2 min read

Wails — Build Desktop Apps with Go and Web Technologies

Wails lets you create beautiful desktop applications using Go for the backend and any web frontend. Uses the OS native WebView (like Tauri) producing ~8MB binaries. No Electron bloat, full Go power, and access to native APIs via bindings.

Agent ready

Ready-to-run agent install

This asset can be installed after the agent chooses its runtime, checks the plan, and runs the matching command.

Native · 98/100Policy: allow
Agent surface
Any MCP/CLI agent
Kind
Skill
Install
Single
Trust
Trust: Established
Entrypoint
step-1.md
Direct install command
npx -y tokrepo@latest install 42404fb6-364b-11f1-9bc6-00163e2b0d79 --target codex

Run after dry-run confirms the install plan.

TL;DR
Wails combines Go backend logic with any web frontend to produce small native desktop apps without Electron.
§01

What it is

Wails is a framework for building desktop applications using Go for the backend and any web technology (React, Svelte, Vue) for the frontend. Unlike Electron, which bundles a full Chromium instance, Wails uses the operating system's native WebView. This produces binaries around 8MB instead of 150MB+.

Wails targets Go developers who need to build desktop GUIs without learning a native UI toolkit. If you already know Go and a web framework, Wails lets you combine both into a single distributable binary for Windows, macOS, and Linux.

§02

How it saves time or tokens

Building a desktop app with native toolkits (Qt, GTK, Cocoa) requires learning platform-specific APIs. Wails eliminates this by letting you reuse existing web development skills for the UI while writing performance-critical logic in Go.

The Go-to-JavaScript binding system is automatic. You define Go methods, and Wails generates TypeScript bindings that your frontend can call directly. No REST API, no WebSocket plumbing, no serialization boilerplate.

§03

How to use

  1. Install the Wails CLI and scaffold a project:
go install github.com/wailsapp/wails/v2/cmd/wails@latest
wails init -n myapp -t svelte-ts
cd myapp
  1. Write your Go backend logic:
type App struct {
    ctx context.Context
}

func (a *App) Greet(name string) string {
    return fmt.Sprintf("Hello %s from Go!", name)
}
  1. Call Go functions from the frontend:
<script lang="ts">
import { Greet } from '../wailsjs/go/main/App';
let result = '';
async function greet() {
    result = await Greet('World');
}
</script>
<button on:click={greet}>{result || 'Click me'}</button>
  1. Run in development or build for production:
wails dev      # Hot-reload dev mode
wails build    # Production binary
§04

Example

A minimal file manager backend in Go:

func (a *App) ListFiles(dir string) ([]string, error) {
    entries, err := os.ReadDir(dir)
    if err != nil {
        return nil, err
    }
    var names []string
    for _, e := range entries {
        names = append(names, e.Name())
    }
    return names, nil
}

The frontend calls ListFiles('/home/user') and renders the result in a web-based file browser UI.

§05

Related on TokRepo

§06

Common pitfalls

  • WebView rendering varies across operating systems. Test your UI on all target platforms, especially Linux where WebView implementations differ between distributions.
  • Wails v2 does not support mobile platforms. If you need iOS or Android targets, consider alternatives like Flutter or Tauri Mobile.
  • Large file transfers between Go and JavaScript go through JSON serialization. For binary data or large datasets, consider writing results to disk and passing file paths instead.

Frequently Asked Questions

How does Wails compare to Electron?+

Wails uses the OS native WebView instead of bundling Chromium, producing 8MB binaries versus Electron's 150MB+. Memory usage is lower, and startup is faster. The trade-off is that WebView behavior varies slightly across platforms, while Electron provides a consistent Chromium environment.

What frontend frameworks work with Wails?+

Wails supports React, Vue, Svelte, Angular, and vanilla JavaScript/TypeScript. The CLI provides starter templates for each framework. You can also bring your own frontend setup by configuring the wails.json file.

Can I access native OS APIs from Wails?+

Yes. Wails provides runtime APIs for native dialogs, menus, system tray, clipboard, and window management. For anything beyond the built-in APIs, you write Go code that calls native libraries via cgo or pure Go packages.

Is Wails production-ready?+

Wails v2 is stable and used in production applications. The project is actively maintained with regular releases. Code signing and distribution packaging (DMG, MSI, AppImage) are supported through the build system.

How do Go-to-JavaScript bindings work?+

Wails scans your Go structs for exported methods and generates TypeScript bindings in the wailsjs directory. These bindings handle JSON serialization and deserialization automatically. You call Go functions from JavaScript as if they were async TypeScript functions.

Citations (3)

Discussion

Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.

Related Assets