keel

module
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 5, 2026 License: AGPL-3.0

README

Keel

Keel

用纯 Go 写桌面界面,不需要 HTML、CSS、JavaScript 或 WebView。界面由 Gio 绘制;Gio 没有的原生能力(权限、截图、合成输入、全局快捷键、系统通知、富剪贴板)在 native/ 下。支持 macOS、Windows、Linux,也能编译成 WebAssembly 在浏览器里运行。

新建一个应用:

go install github.com/dyike/keel/cmd/keel@latest
keel new my-app && cd my-app
keel run            # 运行
keel build          # 打包当前平台(带图标的 .app / .exe / Linux 安装包)

应用开发从生成的 app.go 开始。查看仓库中的示例和组件库:

go run ./examples/hello
go run ./examples/components   # 组件库:侧栏选择、搜索
go run ./examples/chat -sample=all
go test -race ./...

需要 Go 1.26+;macOS 上需要 Xcode Command Line Tools,Linux 上需要 Wayland/X11 的开发包(keel doctor 会检查)。在线文档和组件库:https://keel.dyike.com

文档

授权

Keel 采用 AGPL-3.0 与商业授权双授权。开源项目和个人自用按 AGPL 免费使用;在闭源软件里使用 Keel 需要购买商业授权。详见 LICENSING.md,参与贡献见 CONTRIBUTING.md。

Directories

Path Synopsis
cmd
keel command
Command keel creates, runs and packages Keel desktop apps.
Command keel creates, runs and packages Keel desktop apps.
keel-mcp command
Command keel-mcp is an MCP server that lets an agent run end-to-end tests against a Keel app: launch it, read what is on screen, click, type, press keys, scroll and take screenshots.
Command keel-mcp is an MCP server that lets an agent run end-to-end tests against a Keel app: launch it, read what is on screen, click, type, press keys, scroll and take screenshots.
examples
chat command
Chat shows streaming Markdown answers the way an AI assistant produces them: text arrives a few characters at a time, the view follows it to the bottom unless you scroll up, and the answer can be stopped.
Chat shows streaming Markdown answers the way an AI assistant produces them: text arrives a few characters at a time, the view follows it to the bottom unless you scroll up, and the answer can be stopped.
components command
Components is the kit gallery: a sidebar of every component, the selected one beside it.
Components is the kit gallery: a sidebar of every component, the selected one beside it.
frameless command
Frameless draws its own title bar: the window has no system title bar, the app puts a search box and buttons in the bar, and its empty part moves the window.
Frameless draws its own title bar: the window has no system title bar, the app puts a search box and buttons in the bar, and its empty part moves the window.
hello command
hotkey command
Hotkey shows a system-wide shortcut and a background goroutine updating the UI.
Hotkey shows a system-wide shortcut and a background goroutine updating the UI.
multiwindow command
notification command
orders command
Orders is a small order desk: search and filter a table, sort it, select rows with the mouse or keyboard, delete with confirmation, add orders through a form, and see totals per status.
Orders is a small order desk: search and filter a table, sort it, select rows with the mouse or keyboard, delete with confirmation, add orders through a form, and see totals per status.
internal
appicon
Package appicon cuts full-bleed app artwork into each platform's icon shape: Apple's macOS template, Microsoft's Windows grid, GNOME's template.
Package appicon cuts full-bleed app artwork into each platform's icon shape: Apple's macOS template, Microsoft's Windows grid, GNOME's template.
deps
Package deps only holds a test that enforces the module boundaries listed in docs/architecture.md: each module may import only what its README declares.
Package deps only holds a test that enforces the module boundaries listed in docs/architecture.md: each module may import only what its README declares.
site command
Command site builds Keel's documentation website: every Markdown file in docs/ and every module and example README becomes a static HTML page, the component pages embed the live component gallery (the WebAssembly build of examples/components), and a search index covers all of it.
Command site builds Keel's documentation website: every Markdown file in docs/ and every module and example README becomes a static HTML page, the component pages embed the live component gallery (the WebAssembly build of examples/components), and a search index covers all of it.
svgicon
Package svgicon rasterizes the small SVG subset app icons use into PNG.
Package svgicon rasterizes the small SVG subset app icons use into PNG.
Package native holds the errors shared by Keel's platform capabilities.
Package native holds the errors shared by Keel's platform capabilities.
clipboard
Package clipboard reads a bounded snapshot of text, encoded images and file paths without linking to the UI.
Package clipboard reads a bounded snapshot of text, encoded images and file paths without linking to the UI.
hotkey
Package hotkey registers system-wide shortcuts that fire even when another application is in front.
Package hotkey registers system-wide shortcuts that fire even when another application is in front.
input
Package input synthesizes mouse and keyboard events.
Package input synthesizes mouse and keyboard events.
internal/sys
Package sys binds the platform code.
Package sys binds the platform code.
internal/wlclip
Package wlclip reads the Wayland clipboard through an application's own wl_display.
Package wlclip reads the Wayland clipboard through an application's own wl_display.
notification
Package notification posts local operating-system notifications independently of Keel's UI.
Package notification posts local operating-system notifications independently of Keel's UI.
permission
Package permission checks and requests macOS privacy permissions.
Package permission checks and requests macOS privacy permissions.
screen
Package screen lists displays and captures screenshots.
Package screen lists displays and captures screenshots.
ui
base
Package base holds the behavior of Keel's components without their look: keyboard navigation over a list, type-to-find, multi-selection with ranges, and open/closed state.
Package base holds the behavior of Keel's components without their look: keyboard navigation over a list, type-to-find, multi-selection with ranges, and open/closed state.
core
Package core is the foundation every UI module builds on: what a Widget is, how a component runs a user callback, and how other goroutines change the UI.
Package core is the foundation every UI module builds on: what a Widget is, how a component runs a user callback, and how other goroutines change the UI.
el
highlight
Package highlight colors source code in CodeEditor, TextView and Markdown code blocks.
Package highlight colors source code in CodeEditor, TextView and Markdown code blocks.
internal/editorstyle
Package editorstyle supplies the shared input appearance for widget and el.
Package editorstyle supplies the shared input appearance for widget and el.
internal/imageload
Package imageload loads images off the UI thread and draws them with a placeholder until they arrive.
Package imageload loads images off the UI thread and draws them with a placeholder until they arrive.
internal/inputcontent
Package inputcontent keeps editable text and atomic references together.
Package inputcontent keeps editable text and atomic references together.
internal/loop
Package loop owns the state shared by every window: one lock that serializes rendering and callbacks, a queue of updates from other goroutines, and the windows to redraw.
Package loop owns the state shared by every window: one lock that serializes rendering and callbacks, a queue of updates from other goroutines, and the windows to redraw.
internal/uitest
Package uitest drives UI code without a window: it lays it out through a real Gio input router, so tests click and type as the platform would.
Package uitest drives UI code without a window: it lays it out through a real Gio input router, so tests click and type as the platform would.
kit
Package kit provides components built on ui/el.
Package kit provides components built on ui/el.
locale
Package locale holds the text Keel itself shows or reports to agents: button captions such as 确定 and 复制, accessible names such as 关闭, placeholders and counts.
Package locale holds the text Keel itself shows or reports to agents: button captions such as 确定 and 复制, accessible names such as 关闭, placeholders and counts.
markdown
Package markdown renders Markdown as ui/el elements, built for AI chat: text that streams in a few characters at a time.
Package markdown renders Markdown as ui/el elements, built for AI chat: text that streams in a few characters at a time.
netimage
Package netimage lets Keel load images from http and https URLs.
Package netimage lets Keel load images from http and https URLs.
plot
Package plot provides scales, data layouts and immediate-mode chart drawing.
Package plot provides scales, data layouts and immediate-mode chart drawing.
theme
Package theme holds the colors, text sizes and fonts every UI module reads.
Package theme holds the colors, text sizes and fonts every UI module reads.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL