Files
openchamber-android-native/third_party/mygo/packages/cli/README.md
T
OpenChamber 6c0ee61750 feat: port the client to MyGo native UI (0.3.0)
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.
2026-11-18 13:22:59 +08:00

1.8 KiB

mygo-cli

The mygo command line tool of MyGo, the desktop app framework for Go whose windows show web pages, in the system webview, or native UI written in Go, as prebuilt binaries for macOS, Linux and Windows (arm64 and x64).

Create a project, which depends on mygo-cli and runs it from its scripts:

bunx mygo-cli init my-app    # or: npx mygo-cli init my-app
cd my-app
bun run dev                  # mygo dev: the app with live reload
bun run build                # mygo build: the packaged app

In a project that depends on mygo-cli, bunx mygo <command> runs its mygo. Or install it globally with npm install -g mygo-cli. The commands are those of the CLI installed with Go (go install github.com/egoist/mygo/cmd/mygo@latest): init, dev, build, generate, install-skills, keygen and doctor. Building apps still needs Go, which compiles them.

Outside such a project, run bunx mygo-cli or npx mygo-cli rather than bunx mygo: npm has an unrelated package named mygo.

How it works

Each platform's binary is in a package of its own, such as @egoist/mygo-cli-darwin-arm64, which mygo-cli lists as an optional dependency: package managers install only the one that matches the machine. The mygo command then runs that binary. Set MYGO_CLI_BINARY to the path of another build of the CLI to use it instead.

mygo.config.ts

defineConfig types the configuration of a project, mygo.config.ts:

import { defineConfig } from "mygo-cli";

export default defineConfig({
  name: "My App",
  identifier: "com.example.myapp",
  devUrl: "http://localhost:5173",
});

The binary

From JavaScript, binaryPath() returns the path of the binary:

import { binaryPath } from "mygo-cli";

Bun.spawnSync([binaryPath(), "generate"]);