@LinearUncle: chatwise 大佬使用rust 做完waku 这个开源的harness 后,不知道在rust身上吃了什么苦,紧锣密鼓又开源了一个纯golang 写的桌面GUI 框架-MyGo. https://github.com/egoist/my…
摘要
egoist 开源了 MyGo,一个纯 Go 编写的桌面应用框架,支持系统 WebView 网页界面与纯 Go GPU 绘制的原生 UI 混合使用,无 cgo,单二进制仅几 MB,内置类型化 IPC 和完整的打包签名发布链路。
查看缓存全文
缓存时间: 2026/10/04 21:19
chatwise 大佬使用rust 做完waku 这个开源的harness 后,不知道在rust身上吃了什么苦,紧锣密鼓又开源了一个纯golang 写的桌面GUI 框架-MyGo. https://github.com/egoist/mygo 支持混合两种桌面应用形式,既能跑系统 webview的网页界面,也能用纯 Go 写原生 UI,只有几M大小,推荐!
egoist/mygo
Source: https://github.com/egoist/mygo
MyGo
Desktop apps in Go, with a web frontend or a native UI.
Each MyGo window shows one of two kinds of interface, and one app can mix them:
- A web page, in the webview the OS already has: WKWebView on macOS, WebKitGTK on Linux, WebView2 on Windows. Build the frontend with any web tools; it calls your Go code through a TypeScript client generated from it.
- Native UI, written in Go alone with package
uiand drawn by MyGo itself on the GPU: no HTML, no JavaScript and no webview, so the window opens at once and takes little memory.
Either way, an app is a single Go binary of a few megabytes, focused on low memory and CPU use.
- Pure Go, no cgo: build for every platform from any machine.
- Typed IPC for pages: bind Go services, stream values through channels and send typed events; the TypeScript client is generated from your Go code.
- A Go UI toolkit for native UI: flexbox and grid layout, widgets, text editing with input methods, virtualized lists, SVG icons, animations, screen reader support, and views you test without a window.
- Desktop APIs for both: windows, menus, tray, dialogs, notifications, global shortcuts, deep links, file associations and more.
- Ready to ship: app bundles and disk images, Windows installers, Debian packages and a Linux install script, code signing, notarization, and signed auto-updates with delta updates and an update window in the manner of Sparkle.
A window with a web page, whose frontend calls Go:
type Greeter struct{}
// Greet returns a greeting.
func (Greeter) Greet(name string) string { return "Hello, " + name }
func main() {
mygo.Bind(Greeter{})
mygo.App.WhenReady(func() {
mygo.NewWindow(mygo.WindowOptions{Title: "Hello", URL: "/"})
})
if err := mygo.App.Run(); err != nil {
log.Fatal(err)
}
}
import { Greeter } from "./mygo"; // generated
document.body.textContent = await Greeter.greet("Ada");
A window with native UI, whose view is a Go function of the app’s state:
type counter struct{ n int }
func (s *counter) view(c *ui.Context) {
ui.Column(c).Fill().Center().Gap(12).Children(func() {
ui.Text(c, fmt.Sprint(s.n)).FontSize(40).Bold()
if ui.PrimaryButton(c, "Increment").Clicked() {
s.n++
}
})
}
func main() {
s := &counter{}
mygo.App.WhenReady(func() {
mygo.NewWindow(mygo.WindowOptions{
Title: "Counter",
Content: ui.View(s.view),
})
})
if err := mygo.App.Run(); err != nil {
log.Fatal(err)
}
}
Getting started
With Go 1.27+ and Bun, create an app with a web frontend:
bunx mygo-cli init my-app # or: npx mygo-cli init my-app
cd my-app
bun run dev
An app of native UI needs Go alone:
go run github.com/egoist/mygo/cmd/mygo@latest init -template native my-app
cd my-app
go tool mygo dev
Read the documentation.
License
MIT
EGOIST (@localhost_5173): Introducing MyGo, a pure Go framework for building desktop app in webview or native UI, it’s like GPUI and Tauri had a baby, but made in Go so it compiles fast
相似文章
@geekbb: 基于 Tauri(Rust + Svelte)的桌面应用,将编程 AI 代理、API 客户端、SQL/NoSQL 编辑器、SSH 终端、远程文件浏览器和项目管理看板整合在一个界面中,开发者不用在多个应用之间切换。 https://gith…
Clauge 是一个基于 Tauri(Rust + Svelte)的桌面应用,将编程 AI 代理、API 客户端、SQL/NoSQL 编辑器、SSH 终端、远程文件浏览器和项目管理看板集成在同一界面内,让开发者无需在多个应用间切换。
@wsl8297: 逛 GitHub 时挖到一个狠角色:niri。它直接绕开传统桌面“窗口一多就被挤变形”的老毛病,把窗口管理方式彻底重做了一遍。 niri 采用可滚动的平铺思路:窗口按列铺在一条“无限延伸”的水平条带上。你开新窗口,不会强行压缩现有窗口;多…
文章介绍了开源项目 niri,这是一款基于 Wayland 的新型桌面合成器,通过可滚动平铺布局避免传统窗口拥挤问题,并支持动态工作区、多显示器独立管理及自定义着色器动画等特性。
@yff666:最近构建了 Keel,一个纯 Go 的桌面 UI 框架。基于 Gio,无需 HTML/CSS/JS/WebView。支持 macOS、Win…
一位开发者发布了 Keel,一个基于 Gio 构建的纯 Go 桌面 UI 框架,无需 HTML/CSS/JS/WebView,支持 macOS、Windows 和 Linux,并提供组件库、打包工具以及基于 MCP 的 Agent 端到端测试能力。
Show HN: 我使用 Rust 和 GPUI 构建了一个用于编码代理的原生应用
Waku 是一个使用 Rust 和 GPUI 构建的原生应用,它统一管理编码代理的命令行接口,提供本地优先存储、键盘驱动控制和检查点功能,以实现无缝的开发者工作流。
@Ryrenz: 炸裂!gpui-kit 已经为你准备好桌面应用所需的全部 75 个组件,开箱即用,你再也不用手动编写 UI …
gpui-kit 是基于 Zed 的 GPUI 引擎构建的 Rust 桌面 UI 框架,提供了 75+ 个生产可用的组件,支持 WebAssembly 与 AccessKit 无障碍能力,在 GitHub 上已获得 1.57 万颗星标,并于 9 月迅速从 v0.6.0 迭代至 v0.7.0。