Switch from Asuka to MyGo, keeping the API client and the feature set: - servers: saved servers, passwordless and password login, proxy, self-signed certificates, per-server device tokens (Keystore), connect form, instance list sheet with switch/disconnect - sessions: virtualized list, search, new session, rename/archive/delete, running indicator, event stream keeps it live - chat: pushed window with system back bar, streaming Markdown via ui/markdown, reasoning and tool rows with image previews, footer menu (read aloud via a Kotlin TTS plugin, copy, fork), user message menu (copy, revert, fork), context usage ring and detail sheet, attachments (photos/files via the document picker), permissions - release builds allow plain http:// LAN servers (Go's net/http dials directly, no cleartext manifest needed) - a local fork of MyGo (third_party/mygo) lowers the Android host's minSdk to 24 (Android 7.0); Go 1.27.4 via mise Version 0.3.0.
135 lines
4.0 KiB
Markdown
135 lines
4.0 KiB
Markdown
<p align="center">
|
|
<img width="800" height="360" alt="MyGo!!!!!" src="https://github.com/user-attachments/assets/c3eee9bc-5f22-4032-95b6-776e8381910a" />
|
|
</p>
|
|
|
|
**Desktop apps in Go, with native UI or a web frontend.**
|
|
|
|
Sponsored by:
|
|
|
|
<p align="center">
|
|
<a href="https://openuptime.app/?utm_source=github&utm_medium=sponsor&utm_campaign=mygo">
|
|
<picture>
|
|
<source media="(prefers-color-scheme: dark)" srcset="https://openuptime.app/sponsor/banner-dark.png">
|
|
<img width="600" alt="OpenUptime: open-source uptime monitoring and status pages" src="https://openuptime.app/sponsor/banner-light.png">
|
|
</picture>
|
|
</a>
|
|
</p>
|
|
|
|
<p align="center">
|
|
<a href="https://mygo.egoist.dev/sponsors">Become a sponsor</a>
|
|
</p>
|
|
|
|
---
|
|
|
|
Each MyGo window shows one of two kinds of interface, and one app, or one
|
|
window, 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 `ui` and
|
|
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 desktop from any machine.
|
|
- **Phones too**: the same app on iOS and Android, pages in their web
|
|
views and native UI on their GPUs, with live reload on a simulator,
|
|
an emulator or a device, and builds for the App Store and Google Play.
|
|
- **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; Liquid Glass
|
|
on every platform with the glass plugin; web pages inside native UI, under
|
|
the menus and dialogs it shows over them.
|
|
- **Desktop APIs** for both: windows, menus, tray, dialogs, notifications,
|
|
global shortcuts, deep links, file associations, recent documents, Now
|
|
Playing and the media keys, the system accent color and accessibility
|
|
settings, watching files, and more.
|
|
- **Ready to ship**: app bundles and disk images, Windows installers, Debian
|
|
and RPM packages, PKGBUILDs for Arch Linux 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:
|
|
|
|
```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)
|
|
}
|
|
}
|
|
```
|
|
|
|
```ts
|
|
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:
|
|
|
|
```go
|
|
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](https://go.dev/dl/) 1.27.3+ and [Bun](https://bun.sh), create an app
|
|
with a web frontend:
|
|
|
|
```sh
|
|
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:
|
|
|
|
```sh
|
|
go run github.com/egoist/mygo/cmd/mygo@latest init -template native my-app
|
|
cd my-app
|
|
go tool mygo dev
|
|
```
|
|
|
|
Read the [documentation](docs/README.md).
|
|
|
|
## License
|
|
|
|
MIT
|