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.
This commit is contained in:
OpenChamber committed 2026-11-18 13:22:59 +08:00
1 parent 2fb4a8ea79
commit 6c0ee61750
2538 files changed
+675779 -4792

No files matched your search

+21
View File
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2026 MyGo contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
+57
View File
@@ -0,0 +1,57 @@
# mygo-cli
The `mygo` command line tool of [MyGo](https://github.com/egoist/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:
```sh
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](https://go.dev/dl/), 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`:
```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:
```ts
import { binaryPath } from "mygo-cli";
Bun.spawnSync([binaryPath(), "generate"]);
```
+37
View File
@@ -0,0 +1,37 @@
#!/usr/bin/env node
// Runs the mygo binary of this platform with the arguments of this script.
import { spawn } from "node:child_process";
import { binaryPath } from "../index.js";
let bin;
try {
bin = binaryPath();
} catch (err) {
console.error(err instanceof Error ? err.message : String(err));
process.exit(1);
}
const args = process.argv.slice(2);
if (process.platform !== "win32" && typeof process.execve === "function") {
// Become the binary (Node.js 23.11 and later, Bun), so that signals and
// the exit status are its own.
process.execve(bin, [bin, ...args]);
}
const child = spawn(bin, args, { stdio: "inherit" });
// Ctrl+C reaches the binary from the terminal too: let it decide when to
// exit, which mygo dev takes a moment for.
process.on("SIGINT", () => {});
process.on("SIGTERM", () => child.kill("SIGTERM"));
child.on("error", (err) => {
console.error(`mygo-cli: cannot run ${bin}: ${err.message}`);
process.exit(1);
});
child.on("exit", (code, signal) => {
if (signal) {
process.removeAllListeners(signal);
process.kill(process.pid, signal);
} else {
process.exit(code ?? 1);
}
});
+113
View File
@@ -0,0 +1,113 @@
// Builds the mygo binaries of the platform packages in npm/, for every
// platform or for those given as arguments (e.g. `bun run build.ts
// darwin-arm64`), and writes the manifests of mygo-cli and its platform
// packages with the version of the Go module (mygo.Version), and their
// license.
import { copyFile, mkdir, readFile, writeFile } from "node:fs/promises";
import { join } from "node:path";
import { platforms } from "./index.js";
export const dir = import.meta.dir;
const root = join(dir, "..", "..");
/** GOOS and GOARCH of each platform. */
export const goTargets: Record<string, [goos: string, goarch: string]> = {
"darwin-arm64": ["darwin", "arm64"],
"darwin-x64": ["darwin", "amd64"],
"linux-arm64": ["linux", "arm64"],
"linux-x64": ["linux", "amd64"],
"win32-arm64": ["windows", "arm64"],
"win32-x64": ["windows", "amd64"],
};
const osNames: Record<string, string> = { darwin: "macOS", linux: "Linux", win32: "Windows" };
const repository = { type: "git", url: "git+https://github.com/egoist/mygo.git" };
/** Returns mygo.Version, which every package is released with. */
export async function version(): Promise<string> {
const source = await readFile(join(root, "mygo.go"), "utf8");
const match = source.match(/^const Version = "([^"]+)"$/m);
if (!match?.[1]) throw new Error("mygo.go declares no Version");
return match[1];
}
/**
* Returns the name of a platform package. Its scope keeps npm from taking
* names such as mygo-cli-win32-x64 for spam.
*/
export function platformName(platform: string): string {
return `@egoist/mygo-cli-${platform}`;
}
/** Returns the directory of a platform package. */
export function platformDir(platform: string): string {
return join(dir, "npm", platform);
}
/** Writes the manifests of mygo-cli and its platform packages. */
export async function writeManifests(v: string): Promise<void> {
const main = JSON.parse(await readFile(join(dir, "package.json"), "utf8"));
main.version = v;
main.optionalDependencies = Object.fromEntries(platforms.map((p) => [platformName(p), v]));
await writeJSON(join(dir, "package.json"), main);
for (const platform of platforms) {
const [os, cpu] = platform.split("-") as [string, string];
const name = platformName(platform);
const description = `The ${osNames[os]} ${cpu} binary of mygo-cli`;
await mkdir(platformDir(platform), { recursive: true });
await writeJSON(join(platformDir(platform), "package.json"), {
name,
version: v,
description,
repository: { ...repository, directory: `packages/cli/npm/${platform}` },
license: "MIT",
os: [os],
cpu: [cpu],
files: ["bin"],
preferUnplugged: true,
});
await copyFile(join(root, "LICENSE"), join(platformDir(platform), "LICENSE"));
await writeFile(
join(platformDir(platform), "README.md"),
`# ${name}\n\n${description}, the command line tool of MyGo. Install\n` +
`[mygo-cli](https://www.npmjs.com/package/mygo-cli) instead: package managers\n` +
`install the package of the platform they run on.\n`,
);
}
}
/** Builds the binaries of platforms into their packages. */
export async function build(targets: readonly string[] = platforms): Promise<void> {
await writeManifests(await version());
for (const platform of targets) await buildBinary(platform);
}
/**
* Builds the binary of a platform into its package, whose manifest
* writeManifests wrote. It doesn't block the event loop, so that
* scripts/publish.ts publishes other packages meanwhile.
*/
export async function buildBinary(platform: string): Promise<void> {
const target = goTargets[platform];
if (!target) throw new Error(`unknown platform ${platform}, want one of ${platforms.join(", ")}`);
const [goos, goarch] = target;
const bin = join(platformDir(platform), "bin", goos === "windows" ? "mygo.exe" : "mygo");
console.log(`building ${platform}`);
const go = Bun.spawn(["go", "build", "-trimpath", "-ldflags=-s -w", "-o", bin, "./cmd/mygo"], {
cwd: root,
env: { ...process.env, GOOS: goos, GOARCH: goarch, CGO_ENABLED: "0" },
stdout: "inherit",
stderr: "inherit",
});
if ((await go.exited) !== 0) throw new Error(`go build failed for ${platform}`);
}
async function writeJSON(path: string, value: unknown): Promise<void> {
await writeFile(path, JSON.stringify(value, null, 2) + "\n");
}
if (import.meta.main) {
const args = process.argv.slice(2);
await build(args.length > 0 ? args : platforms);
}
+406
View File
@@ -0,0 +1,406 @@
/** The platforms with a prebuilt binary, as `${process.platform}-${process.arch}`. */
export declare const platforms: readonly string[];
/**
* Returns the name of the package holding the mygo binary of a platform,
* by default this one. Throws for platforms without a prebuilt binary.
*/
export declare function platformPackage(platform?: string, arch?: string): string;
/**
* Returns the path of the mygo binary to run: $MYGO_CLI_BINARY when set,
* else the binary of this platform's package. Throws when that package is
* not installed.
*/
export declare function binaryPath(): string;
/**
* Types the configuration of mygo.config.ts, which takes the place of
* mygo.json:
*
* ```ts
* import { defineConfig } from "mygo-cli";
*
* export default defineConfig({
* name: "My App",
* identifier: "com.example.myapp",
* devUrl: "http://localhost:5173",
* });
* ```
*
* A function gets the command running and returns the configuration, or a
* promise of it.
*/
export declare function defineConfig(config: Config): Config;
export declare function defineConfig(config: Promise<Config>): Promise<Config>;
export declare function defineConfig(config: ConfigFn): ConfigFn;
/** A configuration computed for the command running. */
export type ConfigFn = (env: ConfigEnv) => Config | Promise<Config>;
/** What a configuration function gets. */
export interface ConfigEnv {
/** The mygo command running. */
command: "dev" | "build" | "generate" | "init" | "publish";
}
/** The configuration of a MyGo project. Every field is optional. */
export interface Config {
/** The name users see: the app, its executable, menus and installers (default: the directory's name). */
name?: string;
/**
* The name of the app's files where a name must be plain ASCII: the disk
* images of macOS and the installers of Windows, the Linux executable,
* desktop entry, icon and Debian package, the update archives of every
* platform, and the variables of the install scripts. Lower-case
* letters and digits with single hyphens between them (default: the name
* in lower case, with hyphens between its words and Chinese, Japanese and
* Korean in Latin letters, as `my-app` of "My App" and `yun-yin-le` of
* "云音乐").
*/
slug?: string;
/**
* A reverse DNS name unique to the app, such as `com.example.myapp`, on
* which systems key preferences, permissions and registrations (default:
* `com.mygo.` and the name's letters and digits).
*/
identifier?: string;
/** The version of the app, which updates compare (default: `0.1.0`). */
version?: string;
/** The copyright notice of the app. */
copyright?: string;
/**
* Who makes the app, which Windows lists with the installed app (default:
* the copyright notice without its "©" and years).
*/
publisher?: string;
/**
* The SPDX license expression of the app, such as `MIT`, which the RPM
* package and the PKGBUILD of Arch Linux record (default: `license` in
* `package.json`).
*/
license?: string;
/** A square PNG, ideally 1024×1024 (default: `resources/icon.png` when it exists). */
icon?: string;
/** The Go package of the app, relative to the project (default: `.`). */
main?: string;
/** Where `mygo build` writes the builds, one directory per platform (default: `dist`). */
out?: string;
/**
* Where `mygo generate` writes the TypeScript client (default:
* `src/mygo.ts` when package.json at the project root depends on
* mygo-runtime; an app without a frontend gets no client).
*/
bindings?: string;
/**
* The dev server `mygo dev` points the app at, such as
* `http://localhost:5173`: windows load it for URLs without a scheme.
*/
devUrl?: string;
/** Runs in the project while `mygo dev` runs, e.g. the dev server; the app starts once `devUrl` answers. */
devCommand?: string;
/** Builds the frontend before `mygo build` compiles the app. */
buildCommand?: string;
/**
* The directory of the built frontend, which `mygo build` embeds into the
* app; `mygo dev` serves it from disk without `devUrl`.
*/
frontendDist?: string;
/**
* Files and directories copied into the app of every platform under their
* base names, next to the contents of the project's resources directory,
* whose directories named after a platform, such as
* `resources/linux-amd64`, hold the files of one platform.
*/
resources?: string[];
/**
* Files of the project's resources directory left out of the apps:
* patterns of their paths there, with slashes, where `*` matches within a
* name and `**` any number of directories, as in `design/**`. A directory
* that matches is left out with what it holds. Go source files are always
* left out; listed `resources` ship whole.
*/
resourcesExclude?: string[];
/** The URL schemes the app opens, such as `myapp` for `myapp://…`, which reach `App.OnOpenURL`. */
urlSchemes?: string[];
/** The types of files the app opens, which reach `App.OnOpenFile`. */
fileAssociations?: FileAssociation[];
/**
* The catalogs of the app's messages, which make the languages it ships.
* Without it, the app ships English only.
*/
i18n?: I18nConfig;
/** Signed updates, which `mygo.Updater` installs. */
updates?: UpdatesConfig;
/** macOS packaging. */
macos?: MacOSConfig;
/** Windows packaging. */
windows?: WindowsConfig;
/** Linux packaging. */
linux?: LinuxConfig;
/** The iOS app (`mygo build -platform ios`, `ios/simulator`). */
ios?: IOSConfig;
/** The Android app (`mygo build -platform android`). */
android?: AndroidConfig;
}
/**
* The catalogs of the app's messages: a JSON file per language in `dir`,
* named after its BCP 47 tag (`de.json`, `zh-Hant.json`), whose messages
* `mygo generate` writes typed Go and TypeScript functions for.
*/
export interface I18nConfig {
/** The directory of the catalogs, a Go package of its own (default `locales`). */
dir?: string;
/** The language the app is written in, which the others fall back to (default `en`). */
source?: string;
}
/** A type of file the app opens. */
export interface FileAssociation {
/** The file name extensions, without dots, e.g. `["md"]`. */
ext: string[];
/** What the files are, e.g. `"Markdown Document"`. */
name?: string;
/** The MIME type of the files, by which Linux identifies them; the app defines an unregistered one (`x-`) (default: `application/x-<app>-<ext>`). */
mimeType?: string;
/** The app's role for the files on macOS (default: `"Editor"`). */
role?: "Editor" | "Viewer";
}
/** Signed updates: `publicKey` and one of `github` and `url` are required. */
export interface UpdatesConfig {
/** The contents of mygo-update.pub, from `mygo keygen`. */
publicKey: string;
/** A public GitHub repository, `owner/name`, whose releases hold the updates. */
github?: string;
/**
* What precedes the version in release tags (default: `v`). Another prefix,
* such as `desktop-v`, lets the repository hold other releases: apps find
* the newest release tagged with it through the GitHub API instead of
* reading the latest release.
*/
tagPrefix?: string;
/** Instead of `github`, the HTTPS URL of a directory holding the updates. */
url?: string;
/** The bucket that serves `url`, which `mygo build -upload` uploads to. */
s3?: S3Config;
/** The path of mygo-update.key; `MYGO_UPDATER_PRIVATE_KEY`, holding the key, takes precedence. */
privateKey?: string;
/** A Markdown file whose `## <version>` section becomes the release notes (default: `CHANGELOG.md` when it exists). */
changelog?: string;
/** How many earlier versions get a delta update, a smaller download of what changed (default: `3`; `0` for none). */
deltas?: number;
}
/**
* A bucket of Amazon S3, or of a compatible service such as Cloudflare R2.
* The credentials come from `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY` and
* `AWS_SESSION_TOKEN`.
*/
export interface S3Config {
/** The name of the bucket. */
bucket: string;
/** The directory of the files in the bucket, e.g. `my-app` (default: its root). */
prefix?: string;
/** The region of the bucket (default: `AWS_REGION`, else `AWS_DEFAULT_REGION`, else `us-east-1`). */
region?: string;
/** The endpoint of a compatible service, e.g. `https://<account>.r2.cloudflarestorage.com` (default: Amazon S3's). */
endpoint?: string;
/** Names the bucket in the path of URLs rather than in the host name (default: with `endpoint`, or a bucket name with dots). */
pathStyle?: boolean;
}
/** macOS packaging. */
export interface MacOSConfig {
/**
* The icon as an asset catalog: an `Assets.car` compiled with actool (its
* app icon named `AppIcon`, unless `infoPlist` sets `CFBundleIconName`), or
* an Icon Composer `.icon`, which builds compile on a Mac with Xcode 26 or
* later and skip elsewhere. The `.icns` made from `icon` remains the
* fallback. Or an `.icns` in place of the one made from `icon`, for an
* icon drawn per size.
*/
icon?: string;
/** The oldest macOS the app runs on (default: `12.0`). */
minimumSystemVersion?: string;
/** The identity that signs the app and its disk image, e.g. `Developer ID Application: Jane Doe (TEAMID)` (default: `-`, ad hoc). */
signingIdentity?: string;
/** A property list of entitlements to sign the app with. */
entitlements?: string;
/**
* A provisioning profile embedded before signing, for restricted entitlements.
* Must match the app's identifier, entitlements and signing identity.
* Cannot be used with ad-hoc signing. Paths are relative to the project.
*/
provisioningProfile?: string;
/**
* Property lists of entitlements for code among the resources, by its path
* there, e.g. `{ "bin/server": "server.entitlements.plist" }` for a helper
* that needs `com.apple.security.cs.allow-jit` under the hardened runtime.
* Other code keeps the entitlements it is signed with.
*/
helperEntitlements?: Record<string, string>;
/** Keys added to the app's Info.plist, replacing MyGo's, e.g. `NSCameraUsageDescription`. */
infoPlist?: Record<string, unknown>;
/** The volume name of the disk image (default: the name). */
dmgTitle?: string;
/** Notarizes the app and the disk image of production builds. */
notarize?: NotarizeConfig;
}
/** Credentials of `xcrun notarytool store-credentials <profile>`. */
export interface NotarizeConfig {
/** The profile holding the credentials. */
keychainProfile: string;
/** The keychain holding the profile (default: the login keychain). */
keychain?: string;
}
/** Windows packaging. */
export interface WindowsConfig {
/**
* The name Windows shows the app by: its shortcuts, its entry in
* Settings > Apps, the installer's title and the executable's product
* name (default: the name). The executable and the install folder keep
* the name's, e.g. `天气助手` for an app named `weather`.
*/
displayName?: string;
/**
* The name of the folder the installer installs the app in, in
* `%LOCALAPPDATA%\Programs` (default: the name), e.g. an ASCII `ZhiLian`
* for an app named `智链`, whose shortcuts and entry in Settings > Apps
* keep the name. Changing it moves new installs only.
*/
installDirName?: string;
/** A code signing certificate (.pfx); its password comes from `MYGO_WINDOWS_CERTIFICATE_PASSWORD`. */
certificate?: string;
/** Instead of `certificate`, a command that signs a file, with `%1` for its path. */
signCommand?: string;
/** The time stamping server of `certificate` (default: `http://timestamp.digicert.com`). */
timestampUrl?: string;
/**
* An NSIS script that the installer includes, e.g. `build/installer.nsh`:
* the macros it defines among `customInit`, `customInstall` and
* `customUnInstall` run when the installer starts, at the end of the
* install, and in the uninstall before the app's folder is removed.
*/
installerInclude?: string;
}
/** Linux packaging. */
/** The iOS app. */
export interface IOSConfig {
/** The oldest iOS the app runs on (default: `17.0`). */
minimumSystemVersion?: string;
/** The ID of the Apple developer team that signs the app for devices. */
team?: string;
/** The provisioning profile to sign with: its name, UUID or the path of a `.mobileprovision` (default: the installed one that best fits). */
provisioningProfile?: string;
/** What the build is for (default: `app-store`, TestFlight too). */
distribution?: "app-store" | "ad-hoc" | "development" | "enterprise";
/** `CFBundleVersion`, which must grow with every upload of a version (default: the version). */
/** Lets WindowOptions.OwnScene open windows of the system's own on iPad. */
multipleWindows?: boolean;
buildNumber?: string;
/** The orientations the app turns to on iPhones (default: both); iPads take every one. */
orientations?: ("portrait" | "landscape")[];
/** Extra keys of Info.plist, which replace MyGo's own, as usage descriptions. */
infoPlist?: Record<string, unknown>;
/**
* The hosts of the app's universal links, which reach `App.OnOpenURL`:
* `example.com` signs the app with `applinks:example.com`, and a value with
* its own service, as `webcredentials:example.com`, stays as it is. The
* provisioning profile needs the capability Associated Domains.
*/
associatedDomains?: string[];
/** What the system shows while the app starts (default: the system background). */
launchScreen?: IOSLaunchScreen;
/** The app's `UIBackgroundModes`, as `audio`, `fetch` or `remote-notification`, with those its plugins ask for. */
backgroundModes?: string[];
}
/** The launch screen of the iOS app: at least one of its fields. */
export interface IOSLaunchScreen {
/** Its color, as `#102030`. */
background?: string;
/** A PNG shown centered, at the size of a 3x screen: a logo of 600×600 pixels takes 200×200 points. */
image?: string;
}
/** The Android app. */
export interface AndroidConfig {
/** The oldest Android API level the app runs on (default: `26`, Android 8.0). */
minSdk?: number;
/** The integer version Google Play orders uploads by (default: from the version, major×10000 + minor×100 + patch). */
versionCode?: number;
/** Permissions the manifest declares besides INTERNET, as `android.permission.CAMERA` or `CAMERA`. */
permissions?: string[];
/** The keystore of the upload key that signs release builds; its passwords come from `MYGO_ANDROID_KEYSTORE_PASSWORD` and `MYGO_ANDROID_KEY_PASSWORD`. Without one, builds are signed with the debug key. */
keystore?: string;
/** The alias of the upload key in the keystore. */
keyAlias?: string;
/**
* The hosts of the app's https deep links, verified by Android, which reach
* `App.OnOpenURL`: each serves `/.well-known/assetlinks.json` naming the
* app. `*.example.com` takes its subdomains.
*/
appLinks?: string[];
/** The launcher icon of Android 8.0 and later, which the launcher masks and moves. Without it, launchers show `icon` as it is. */
adaptiveIcon?: AndroidAdaptiveIcon;
/** The color of the screen the system shows while the app starts, as `#102030` (default: the theme's). */
splash?: string;
}
/** An icon of two layers. */
export interface AndroidAdaptiveIcon {
/** A square PNG, ideally 432×432 or more, with transparency around what it shows: launchers crop to the middle 72/108 of it. */
foreground: string;
/** The color under it, as `#102030`. */
background: string;
}
export interface LinuxConfig {
/** `Name <email>`, the maintainer of the Debian and RPM packages and of the PKGBUILD (default: `author` in package.json, else the app's name). */
maintainer?: string;
/** A short description, for the desktop entry and the packages. */
comment?: string;
/** The categories of the desktop entry (default: `["Utility"]`). */
categories?: string[];
/** Packages the app needs besides GTK and WebKitGTK, by package format or as Debian packages mapped to Arch Linux and RPM where MyGo knows them. */
depends?: string[] | LinuxDepends;
/**
* `false` for an app that shows no web page, in a window or a `ui.WebView`,
* as an app of native UI: its Debian and RPM packages and PKGBUILD depend on GTK alone, and
* install.sh and `mygo doctor` do not ask for WebKitGTK (default: `true`).
*/
webview?: boolean;
/**
* A command that runs the app, such as `my-app`, or a list of names, such
* as `["my-app", "ma"]`, which adds a short one: a link in `/usr/bin` from
* the Debian and RPM packages and the PKGBUILD, and in `~/.local/bin` from install.sh, for each,
* which says to run the app by the first it links (default: none; the app
* opens from the applications menu).
*/
command?: string | string[];
/**
* The packages `mygo build` writes (default: all three). The archive with
* install.sh is always written, as install.sh updates the app from it and
* the PKGBUILD packages it; `[]` writes it alone.
*/
formats?: ("deb" | "rpm" | "pkgbuild")[];
}
/**
* Extra package dependencies for Linux packages, by package format.
*/
export interface LinuxDepends {
/** Debian packages the app needs besides GTK and WebKitGTK. */
deb?: string[];
/** RPM package dependencies or library requirements besides GTK and WebKitGTK. */
rpm?: string[];
/** Arch Linux packages the app needs besides GTK and WebKitGTK. */
arch?: string[];
}
+114
View File
@@ -0,0 +1,114 @@
// mygo-cli ships the mygo command line tool of MyGo as a prebuilt binary
// per platform. Each binary is in a package of its own,
// @egoist/mygo-cli-<os>-<cpu>,
// which mygo-cli lists as optional dependencies: package managers install
// the one matching the machine's os and cpu fields.
import { execFileSync } from "node:child_process";
import { accessSync, chmodSync, constants, existsSync, readFileSync } from "node:fs";
import { createRequire } from "node:module";
import { basename, dirname, join, sep } from "node:path";
import { fileURLToPath } from "node:url";
const require = createRequire(import.meta.url);
const here = dirname(fileURLToPath(import.meta.url));
const { version } = require("./package.json");
/** The platforms with a prebuilt binary, as `${process.platform}-${process.arch}`. */
export const platforms = ["darwin-arm64", "darwin-x64", "linux-arm64", "linux-x64", "win32-arm64", "win32-x64"];
const goInstall = `go install github.com/egoist/mygo/cmd/mygo@v${version}`;
/**
* Returns the name of the package holding the mygo binary of a platform,
* by default this one.
*/
export function platformPackage(platform = process.platform, arch = process.arch) {
const target = `${platform}-${arch}`;
if (!platforms.includes(target)) {
throw new Error(`mygo-cli: there is no prebuilt mygo binary for ${target}; install the CLI with Go instead: ${goInstall}`);
}
return `@egoist/mygo-cli-${target}`;
}
/**
* Returns the path of the mygo binary to run: $MYGO_CLI_BINARY when set,
* else the binary of this platform's package. In a checkout of the MyGo
* repository it builds the CLI from its source first.
*/
export function binaryPath() {
if (process.env.MYGO_CLI_BINARY) return process.env.MYGO_CLI_BINARY;
const exe = process.platform === "win32" ? "mygo.exe" : "mygo";
const pkg = platformPackage();
const checkout = join(here, "..", "..");
if (isCheckout(checkout)) {
// The platform packages hold no binary until they are released: build
// the CLI from source, which Go's build cache makes quick.
const bin = join(here, "npm", `${process.platform}-${process.arch}`, "bin", exe);
execFileSync("go", ["build", "-o", bin, "./cmd/mygo"], { cwd: checkout, stdio: "inherit" });
return bin;
}
let dir;
try {
dir = dirname(require.resolve(`${pkg}/package.json`));
} catch {
throw new Error(
`mygo-cli: ${pkg}, the package with the mygo binary of this platform, is not installed. ` +
`${reinstallHint(pkg)} Or install the CLI with Go: ${goInstall}`,
);
}
const bin = join(dir, "bin", exe);
if (process.platform !== "win32") {
try {
accessSync(bin, constants.X_OK);
} catch {
// Some package managers drop the executable bit.
chmodSync(bin, 0o755);
}
}
return bin;
}
/**
* Types the configuration of mygo.config.ts: an object, or a function of the
* command running that returns one.
*/
export function defineConfig(config) {
return config;
}
/**
* Says how to install pkg, the missing package of the mygo binary. Package
* managers skip an optional dependency they fail to fetch, as when npm does
* not serve it yet, and bun keeps skipping it while bun.lock lacks it, even
* with --force.
*/
function reinstallHint(pkg) {
// The directory whose node_modules holds mygo-cli, at any depth.
const i = here.indexOf(`${sep}node_modules${sep}`);
const root = i < 0 ? here : here.slice(0, i);
const runner = basename(root).startsWith("bunx-") ? "bunx" : basename(dirname(root)) === "_npx" ? "npx" : "";
if (runner) {
return `${runner} installed mygo-cli without it in ${root}: remove that directory, then run ${runner} again.`;
}
const lockfile = join(root, "bun.lock");
let lock = "";
try {
lock = readFileSync(lockfile, "utf8");
} catch {}
if (lock && !lock.includes(`"${pkg}": [`)) {
return `bun installed mygo-cli without it, and does so again while ${lockfile} lacks it, even with --force: remove that file, then install again.`;
}
return "Reinstall mygo-cli without omitting optional dependencies.";
}
/** Reports whether dir is a checkout of the MyGo repository. */
function isCheckout(dir) {
try {
return (
readFileSync(join(dir, "go.mod"), "utf8").startsWith("module github.com/egoist/mygo\n") &&
existsSync(join(dir, "cmd", "mygo", "main.go"))
);
} catch {
return false;
}
}
+149
View File
@@ -0,0 +1,149 @@
import { expect, test } from "bun:test";
import { chmodSync, cpSync, mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs";
import { tmpdir } from "node:os";
import { join, sep } from "node:path";
import { build, dir, goTargets, platformDir, platformName, version } from "./build.ts";
import { defineConfig, platformPackage, platforms } from "./index.js";
const host = `${process.platform}-${process.arch}`;
const exe = process.platform === "win32" ? "mygo.exe" : "mygo";
const readJSON = (path: string) => JSON.parse(readFileSync(path, "utf8"));
test("platformPackage names the package of each platform", () => {
expect(platformPackage("darwin", "arm64")).toBe("@egoist/mygo-cli-darwin-arm64");
expect(platformPackage("win32", "x64")).toBe("@egoist/mygo-cli-win32-x64");
expect(platformName("linux-x64")).toBe(platformPackage("linux", "x64"));
expect(() => platformPackage("freebsd", "x64")).toThrow(/go install github.com\/egoist\/mygo\/cmd\/mygo@v/);
expect(Object.keys(goTargets).sort()).toEqual([...platforms].sort());
});
test("the packages have the version of the Go module", async () => {
const v = await version();
const main = readJSON(join(dir, "package.json"));
expect(main.version).toBe(v);
expect(main.optionalDependencies).toEqual(Object.fromEntries(platforms.map((p) => [platformName(p), v])));
for (const platform of platforms) {
const pkg = readJSON(join(platformDir(platform), "package.json"));
const [os, cpu] = platform.split("-");
expect(pkg).toMatchObject({ name: platformName(platform), version: v, os: [os], cpu: [cpu], license: "MIT" });
}
});
test("the published packages carry the license", () => {
const license = readFileSync(join(dir, "..", "..", "LICENSE"), "utf8");
for (const pkg of [join(dir, "..", "runtime"), dir, ...platforms.map(platformDir)]) {
expect(readJSON(join(pkg, "package.json")).license).toBe("MIT");
expect(readFileSync(join(pkg, "LICENSE"), "utf8")).toBe(license);
}
});
// install lays out mygo-cli in node_modules as a package manager would, with
// or without the package of this platform, and returns the binary's path.
function install(root: string, withPlatform: boolean) {
const cli = join(root, "node_modules", "mygo-cli");
mkdirSync(join(cli, "bin"), { recursive: true });
for (const file of ["package.json", "index.js", "bin/mygo.js"]) cpSync(join(dir, file), join(cli, file));
if (withPlatform) {
const pkg = join(root, "node_modules", platformName(host));
cpSync(platformDir(host), pkg, { recursive: true });
return join(pkg, "bin", exe);
}
}
function run(runtime: string, root: string, args: string[], env: Record<string, string> = {}) {
const r = Bun.spawnSync([runtime, join(root, "node_modules", "mygo-cli", "bin", "mygo.js"), ...args], {
env: { ...process.env, MYGO_CLI_BINARY: "", ...env },
});
return { code: r.exitCode, out: r.stdout.toString(), err: r.stderr.toString() };
}
const runtimes = ["node", "bun"].filter((r) => Bun.which(r));
test.skipIf(!platforms.includes(host))(
"mygo runs the binary of the platform's package",
async () => {
await build([host]);
const v = await version();
const root = mkdtempSync(join(tmpdir(), "mygo-cli-"));
try {
const bin = install(root, true)!;
if (process.platform !== "win32") chmodSync(bin, 0o644); // a package manager dropped the executable bit
for (const runtime of runtimes) {
expect(run(runtime, root, ["version"])).toMatchObject({ code: 0, out: `mygo ${v}\n` });
expect(run(runtime, root, ["no-such-command"]).code).toBe(2);
}
} finally {
rmSync(root, { recursive: true, force: true });
}
},
120_000,
);
// bunLock returns a bun.lock of a project depending on mygo-cli, which
// resolved the package of this platform or, when bun could not fetch it,
// did not.
function bunLock(withPlatform: boolean) {
const pkg = platformName(host);
const resolved = withPlatform ? `\n "${pkg}": ["${pkg}@0.1.1", "", {}, "sha512-"],` : "";
return `{
"lockfileVersion": 2,
"workspaces": { "": { "dependencies": { "mygo-cli": "^0.1.1" } } },
"packages": {
"mygo-cli": ["mygo-cli@0.1.1", "", { "optionalDependencies": { "${pkg}": "0.1.1" } }, "sha512-"],${resolved}
}
}
`;
}
test("mygo explains a missing platform package", () => {
const base = mkdtempSync(join(tmpdir(), "mygo-cli-"));
const missing = `${platformName(host)}, the package with the mygo binary of this platform, is not installed`;
const omitted = "Reinstall mygo-cli without omitting optional dependencies";
try {
const project = join(base, "project");
install(project, false);
const bunx = join(base, "bunx-501-mygo-cli@latest");
install(bunx, false);
const npx = join(base, "_npx", "0123456789abcdef");
install(npx, false);
for (const runtime of runtimes) {
rmSync(join(project, "bun.lock"), { force: true });
let r = run(runtime, project, ["version"]);
expect(r.code).toBe(1);
expect(r.err).toContain(missing);
expect(r.err).toContain(omitted);
// bun keeps out what its lockfile lacks. The messages name the real
// paths, which can differ from ours, as in 8.3 names on Windows.
writeFileSync(join(project, "bun.lock"), bunLock(false));
r = run(runtime, project, ["version"]);
expect(r.err).toContain(missing);
expect(r.err).toContain(`${sep}project${sep}bun.lock lacks it, even with --force: remove that file`);
writeFileSync(join(project, "bun.lock"), bunLock(true));
expect(run(runtime, project, ["version"]).err).toContain(omitted);
// bunx and npx run the install they made again.
r = run(runtime, bunx, ["version"]);
expect(r.err).toContain(missing);
expect(r.err).toContain("bunx installed mygo-cli without it in ");
expect(r.err).toContain(`${sep}bunx-501-mygo-cli@latest: remove that directory, then run bunx again`);
r = run(runtime, npx, ["version"]);
expect(r.err).toContain("npx installed mygo-cli without it in ");
expect(r.err).toContain(`${sep}_npx${sep}0123456789abcdef: remove that directory, then run npx again`);
// MYGO_CLI_BINARY points at a binary of one's own instead.
const own = run(runtime, project, ["--version"], { MYGO_CLI_BINARY: process.execPath });
expect(own.code).toBe(0);
}
} finally {
rmSync(base, { recursive: true, force: true });
}
});
test("defineConfig returns the configuration", async () => {
const config = defineConfig({
name: "My App",
fileAssociations: [{ ext: ["md"], role: "Viewer" }],
macos: { infoPlist: { NSCameraUsageDescription: "Scan documents." } },
});
expect(config.name).toBe("My App");
const fn = defineConfig(({ command }) => ({ devUrl: command === "dev" ? "http://localhost:5173" : undefined }));
expect(await fn({ command: "dev" })).toEqual({ devUrl: "http://localhost:5173" });
});
+21
View File
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2026 MyGo contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
@@ -0,0 +1,5 @@
# @egoist/mygo-cli-darwin-arm64
The macOS arm64 binary of mygo-cli, the command line tool of MyGo. Install
[mygo-cli](https://www.npmjs.com/package/mygo-cli) instead: package managers
install the package of the platform they run on.
@@ -0,0 +1,21 @@
{
"name": "@egoist/mygo-cli-darwin-arm64",
"version": "0.10.0",
"description": "The macOS arm64 binary of mygo-cli",
"repository": {
"type": "git",
"url": "git+https://github.com/egoist/mygo.git",
"directory": "packages/cli/npm/darwin-arm64"
},
"license": "MIT",
"os": [
"darwin"
],
"cpu": [
"arm64"
],
"files": [
"bin"
],
"preferUnplugged": true
}
+21
View File
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2026 MyGo contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
@@ -0,0 +1,5 @@
# @egoist/mygo-cli-darwin-x64
The macOS x64 binary of mygo-cli, the command line tool of MyGo. Install
[mygo-cli](https://www.npmjs.com/package/mygo-cli) instead: package managers
install the package of the platform they run on.
@@ -0,0 +1,21 @@
{
"name": "@egoist/mygo-cli-darwin-x64",
"version": "0.10.0",
"description": "The macOS x64 binary of mygo-cli",
"repository": {
"type": "git",
"url": "git+https://github.com/egoist/mygo.git",
"directory": "packages/cli/npm/darwin-x64"
},
"license": "MIT",
"os": [
"darwin"
],
"cpu": [
"x64"
],
"files": [
"bin"
],
"preferUnplugged": true
}
+21
View File
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2026 MyGo contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
@@ -0,0 +1,5 @@
# @egoist/mygo-cli-linux-arm64
The Linux arm64 binary of mygo-cli, the command line tool of MyGo. Install
[mygo-cli](https://www.npmjs.com/package/mygo-cli) instead: package managers
install the package of the platform they run on.
@@ -0,0 +1,21 @@
{
"name": "@egoist/mygo-cli-linux-arm64",
"version": "0.10.0",
"description": "The Linux arm64 binary of mygo-cli",
"repository": {
"type": "git",
"url": "git+https://github.com/egoist/mygo.git",
"directory": "packages/cli/npm/linux-arm64"
},
"license": "MIT",
"os": [
"linux"
],
"cpu": [
"arm64"
],
"files": [
"bin"
],
"preferUnplugged": true
}
+21
View File
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2026 MyGo contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
+5
View File
@@ -0,0 +1,5 @@
# @egoist/mygo-cli-linux-x64
The Linux x64 binary of mygo-cli, the command line tool of MyGo. Install
[mygo-cli](https://www.npmjs.com/package/mygo-cli) instead: package managers
install the package of the platform they run on.
@@ -0,0 +1,21 @@
{
"name": "@egoist/mygo-cli-linux-x64",
"version": "0.10.0",
"description": "The Linux x64 binary of mygo-cli",
"repository": {
"type": "git",
"url": "git+https://github.com/egoist/mygo.git",
"directory": "packages/cli/npm/linux-x64"
},
"license": "MIT",
"os": [
"linux"
],
"cpu": [
"x64"
],
"files": [
"bin"
],
"preferUnplugged": true
}
+21
View File
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2026 MyGo contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
@@ -0,0 +1,5 @@
# @egoist/mygo-cli-win32-arm64
The Windows arm64 binary of mygo-cli, the command line tool of MyGo. Install
[mygo-cli](https://www.npmjs.com/package/mygo-cli) instead: package managers
install the package of the platform they run on.
@@ -0,0 +1,21 @@
{
"name": "@egoist/mygo-cli-win32-arm64",
"version": "0.10.0",
"description": "The Windows arm64 binary of mygo-cli",
"repository": {
"type": "git",
"url": "git+https://github.com/egoist/mygo.git",
"directory": "packages/cli/npm/win32-arm64"
},
"license": "MIT",
"os": [
"win32"
],
"cpu": [
"arm64"
],
"files": [
"bin"
],
"preferUnplugged": true
}
+21
View File
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2026 MyGo contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
+5
View File
@@ -0,0 +1,5 @@
# @egoist/mygo-cli-win32-x64
The Windows x64 binary of mygo-cli, the command line tool of MyGo. Install
[mygo-cli](https://www.npmjs.com/package/mygo-cli) instead: package managers
install the package of the platform they run on.
@@ -0,0 +1,21 @@
{
"name": "@egoist/mygo-cli-win32-x64",
"version": "0.10.0",
"description": "The Windows x64 binary of mygo-cli",
"repository": {
"type": "git",
"url": "git+https://github.com/egoist/mygo.git",
"directory": "packages/cli/npm/win32-x64"
},
"license": "MIT",
"os": [
"win32"
],
"cpu": [
"x64"
],
"files": [
"bin"
],
"preferUnplugged": true
}
+50
View File
@@ -0,0 +1,50 @@
{
"name": "mygo-cli",
"version": "0.10.0",
"description": "The mygo command line tool: create, develop and package MyGo desktop apps",
"keywords": [
"mygo",
"desktop",
"webview",
"go",
"cli"
],
"repository": {
"type": "git",
"url": "git+https://github.com/egoist/mygo.git",
"directory": "packages/cli"
},
"license": "MIT",
"type": "module",
"bin": {
"mygo": "bin/mygo.js"
},
"exports": {
".": {
"types": "./index.d.ts",
"default": "./index.js"
}
},
"types": "./index.d.ts",
"files": [
"bin",
"index.js",
"index.d.ts",
"README.md"
],
"engines": {
"node": ">=18"
},
"scripts": {
"binaries": "bun run build.ts",
"test": "bun test"
},
"optionalDependencies": {
"@egoist/mygo-cli-darwin-arm64": "0.10.0",
"@egoist/mygo-cli-darwin-x64": "0.10.0",
"@egoist/mygo-cli-linux-arm64": "0.10.0",
"@egoist/mygo-cli-linux-x64": "0.10.0",
"@egoist/mygo-cli-win32-arm64": "0.10.0",
"@egoist/mygo-cli-win32-x64": "0.10.0"
}
}