nsgo.yaml
The project file every build reads: targets, build flags and tags, minimum system versions, icons and the launch screen.
nsgo refuses unknown keys in this file, including misspellings nested under a section. Free-form maps such as apple.info and macos.entitlements remain open for platform-specific keys.
Tools written in Go can read nsgo.yaml with the same schema, validation and defaults as nsgo build through github.com/nsgo-dev/nsgo/project: project.Load(dir) decodes the file strictly into a *project.Config and resolves paths such as Build.Output (defaulting to dist) against dir without making network or Git calls, and (*project.Config).Channel() returns the effective distribution channel (updates.channel, else direct when updates.key is set, else none).
name: Helloid: dev.example.hello # the bundle ID; without it, dev.nsgo. and the name's letters and digitsversion: 0.1.0build_number: 1 # CFBundleVersion and Android's versionCode; else from version# copyright: © 2026 Example # the Windows executable's details and installer, and the macOS About panel# appearance: dark # light or dark whatever the system's# i18n: { dir: locales, source: en, coverage: warn } # coverage: off allows dependency translations to fall back without a warningicon: apple: assets/AppIcon.icon # macOS, iOS and watchOS, or an .icns for macOS windows: assets/IconWindows.png # optional Windows artwork linux: assets/IconLinux.png # optional Linux artwork png: assets/Icon.png # every other target tvos: assets/AppIconTV.brandassets # the Apple TV's layered icon and top shelf art, or a wide PNG watchos: assets/AppIconWatch.icon # the Apple Watch's own, drawn in circles, or a square PNG android: png: assets/IconAndroid.png # optional bitmap; valid without adaptive layers foreground: assets/IconForeground.png # Android's adaptive icon: 432 px, the logo within the center 264 px background: "#1F1F1F" # a color or a square PNG monochrome: assets/IconMonochrome.png # optional: the shape Android 13's themed icons tintdev: target: native # native, web, ios, ios_simulator, tvos, tvos_simulator, watchos, watchos_simulator, android, harmonyos, miniprogram_<platform> or minigame_<platform> hot_reload: true # false builds once, watching no files # services: [{name: db, run: docker compose up db, ready: 127.0.0.1:5432}] # processes dev runs beside the app (debugging.md#services) # env: { SERVER_URL: http://localhost:8080 } # what the apps dev starts on this machine get in their environment # icon: { png: assets/Icon-dev.png } # replaces icon's files in dev's builds; defaults to assets/*-dev.*build: output: dist tags: [] # Go build tags every build, test and check of the app takes, such as timetzdata release_tags: [release] # additional Go build tags for release builds # allow_resources: [resources/.well-known/] # exact exceptions to the bundled asset checks ldflags: [] # the app's own linker flags, such as -X main.releaseDate=2026-11-17 open: false # true opens the output directory after building installers: true # false leaves out the disk image, the Windows installer and the Linux packages # skip_installers: [macos] # omit installers for the listed desktop systems jobs: 0 # how many targets build at once; 0 is half the CPUs, 1 one after another targets: [macos_arm64, macos_x64, windows_arm64, windows_x64, linux_arm64, linux_x64, ios, ios_simulator, tvos, tvos_simulator, watchos, watchos_simulator, android_arm64, web]# apple: { sign_in_with_apple: true } # the Sign in with Apple entitlement, for iOS, tvOS and Mac App Store builds# apple: { purchases: true } # StoreKit's library, which in-app purchases go through, in macOS, iOS and tvOS packages# apple: { privacy: { accessed_apis: { NSPrivacyAccessedAPICategoryDiskSpace: [E174.1] }, tracking: false } } # add required-reason APIs and tracking declarations to PrivacyInfo.xcprivacy# apple: { requires_full_screen: false } # let an iPad run the app in Split View, Slide Over and Stage Manager, in all four orientations# apple: { orientations: [portrait, landscape_left] } # the orientations a full-screen app takes on an iPad# apple: { multiple_scenes: true } # let an iPad open more than one window of the app, each showing the main view with its own state# apple: { info: { UIBackgroundModes: [audio] } } # background playback for iOS Picture in Picture# android: { permissions: [REQUEST_INSTALL_PACKAGES] } # manifest permissions beyond the runtime's# android: { recording: true } # the microphone service microphone.RecordWAV records in, with RECORD_AUDIO, the foreground-service permissions and POST_NOTIFICATIONS, which RecordWAV asks for so its notification shows from Android 13; a refusal still records# android: { uses_cleartext_traffic: true } # allow plain HTTP to any host in the APK and App Bundle# android: { background_downloads: true } # dataSync foreground service for cx.Download# android: { data_sync: true } # generic dataSync foreground service for mobile.StartDataSync# android: { background_motion: true } # explicit finite motion shortService; streams also need a notification title# android: { loopback_cleartext: true } # allow plain HTTP to loopback in the APK and App Bundle# commands: [{ name: hello-cli, package: ./cmd/hello-cli }] # command-line programs the desktop packages ship beside the app: see Commands# windows: { command_line: true } # add <name>.com, a console companion that forwards arguments and streams to <name>.exe; not in store builds# windows: { path: true } # the installer puts the app's folder on the user's Path, so consoles find its commands# windows: { publisher: Example Ltd } # the company the Windows executable's details, its installer and the uninstall entry name; else windows.store.publisher_name# linux: { maintainer: "Jane Doe <jane@example.com>" } # the Linux packages' maintainer, else the app's name# linux: { categories: [Office, Dictionary] } # the freedesktop menu categories of the app's desktop entry, at least one a main category such as Office, Utility or Game, else menus file it under Other; your own start with X-# linux: { share: packaging/share } # files the .deb and Arch package install under /usr/share and the AppImage in its usr/share, such as metainfo/<id>.metainfo.xml or bash-completion/completions/<command># linux: { depends: { deb: [gstreamer1.0-plugins-good], arch: [gst-plugins-good] }, recommends: { deb: [gstreamer1.0-libav], arch: ["gst-libav: H.264 and AAC video"] } } # packages the .deb and Arch package also depend on and recommend, after GTK 4 and WebKitGTK 6, each as dpkg or pacman writes it# release: { github: me/hello } # the GitHub repository the install scripts and updates install from, else the Git remote origin's; tag_prefix: v by default# updates: { key: <public key> } # how the app updates, by platform and channel: see Updates# store: { dir: store } # store listings directory (YAML and Markdown per language)# registries: { "@acme": https://nsgo.acme.example/registry.yaml, "@team": tools/registry.yaml } # custom registries for nsgo add @name/item# plugins: { github.com/nsgo-dev/nsgo-tsx/cmd/nsgo-tsx: { limits: default } } # tools go.mod declares that join build, dev, check and test, with their settings: see Plugins# miniprogram: { appid: { wechat: wx0123456789abcdef, alipay: "2021000000000000" }, custom_navigation: false } # the mini programs'# minigame: { appid: { wechat: wx0123456789abcdef }, orientation: landscape, ios_high_performance: false, webgl: false, subpackages: [{ name: levels, resources: [levels], preload: false }] } # the mini games'Targets
Section titled “Targets”A bare OS name in targets — or in nsgo build -target and nsgo check -target — means its architectures (windows is windows_arm64 and windows_x64; android is android_arm64 only, as the x86_64 build needs an NDK). A tool that writes or checks targets shares the tool’s own table through github.com/nsgo-dev/nsgo/targets: targets.Names() lists every accepted name, and targets.Expand replaces all, tui, miniprogram, minigame and a bare OS name as nsgo build does.
macos_universal, which macos and all leave out, builds both macOS architectures and joins them into one app, its libraries and widgets included. The Steam channel uses the universal app bundle. Installer builds wrap it in one disk image, with one Sparkle feed on the direct channel. nsgo test -target also takes the name of the architecture its tests run for: a desktop OS’s on this machine’s architecture and Android’s on arm64, so windows_x64 runs the windows target on an x64 Windows machine, while an architecture the target does not run for is refused with the name to use.
Flags, tags and linker flags
Section titled “Flags, tags and linker flags”Flags replace the values they name, such as -target, -version or -output; -h lists them all.
build.ldflags holds the app’s own linker flags, each written as go build’s -ldflags takes it, such as -X main.releaseDate=2026-11-17 or -X 'main.channel=beta builds'. Every build that links the app takes them: dev and its reloads, build with -embed too and test with -target too, on every target. -ldflags on build and test adds to them rather than replacing them, repeated for more. They come before the tool’s own -X flags, and the linker keeps a variable’s last, so the name, ID and version in core.App stay those of nsgo.yaml. The tool passes go its own -ldflags, which replaces one in GOFLAGS, so linker flags belong here; a headless test’s -ldflags after the directory is go test’s and replaces them all.
Every go command the tool runs for the app takes build.tags, in dev and its reloads, build with -embed too, test with -target too and check, on every target. NSGo’s own tags, such as nsgodev in dev or nsgotest in target tests, are added to them, as are the tags of -tags in GOFLAGS, which would otherwise be replaced; the rest of GOFLAGS applies as it is.
build.release_tags adds tags to build.tags for nsgo build -release (including with -embed) and builds using the store or steam channel, whether chosen by -channel or updates.channel. Plain builds without either channel, nsgo dev (even with -release) and nsgo test do not add them. nsgo check runs go vet with and without the extra tags for the host or each requested target. Both lists take one Go build tag per item.
Publishing Go app artifacts does not rebuild them. Build first with nsgo build -release for direct distribution, or with the appropriate store channel.
Every build also takes NSGo’s own flags as it starts, such as --nsgo-fps (Running and debugging). In nsgo dev, Command/Control+R reloads from every open window and remains available after the main view closes when another window keeps an app function running.
Minimum system versions
Section titled “Minimum system versions”apple.info.LSMinimumSystemVersion raises the macOS package’s minimum, and apple.info.MinimumOSVersion raises the selected iOS, tvOS or watchOS package’s. Write quoted version strings, such as "14.2" or "18.0", with one to three numeric parts. The runtime floors are macOS 13.0 (Go 1.27), iOS 15.0, tvOS 17.0 and watchOS 26.0; lower or malformed values fail. The mobile key must meet every selected mobile target’s floor. App Clips keep their own app_clip.minimum. The values reach package metadata, asset compilation, signing projects and the app’s linker; embedded iOS frameworks use them too, with Mac Catalyst at least 16.0 for Go’s macOS 13 runtime.
icon.windows and icon.linux select square PNGs for their app packages, installer art and store logos. They default to assets/IconWindows.png and assets/IconLinux.png, then fall back to icon.png; dev.icon accepts the same settings and -dev default files. icon.android.png selects an Android bitmap independently, including when no adaptive layers are configured. Other targets keep the shared icon.png fallback.
On macOS, an Icon Composer .icon needs Xcode 26 or later. With older Xcode, NSGo uses a sibling .icns if present, then the selected icon.png (Icon-dev.png when present in dev), and warns that the layered icon is unavailable.
An Apple TV’s icon is a layered card, not a square: tvos takes Xcode’s .brandassets, its App Icon stacks and top shelf images, or a wide image such as 1280×768, which the tool draws to fit the card over its edge color and centers on the top shelf images. Without either, the PNG sits at three quarters of the card’s height. An Apple Watch masks its icon to a circle, so watchos takes an .icon drawn for watchOS’s circles or a square PNG; without it the app uses apple, then png. Both fall back to assets/AppIconTV.* and assets/AppIconWatch.*, as apple and png do.
On Android, icon.android.foreground and background make the launcher icon adaptive, so launchers mask it to their shape and move it as they like instead of shrinking png onto a plate of their own. Each layer is 108 dp square, a PNG scaled to 432 px; the launcher shows the center 72 dp, 288 px, and masks it to a shape that may cut into everything outside the center 66 dp, 264 px, so keep the logo in that circle and let the background fill the whole square. background is a PNG or a color such as "#1F1F1F". monochrome, a shape whose alpha is all that counts, is what Android 13 and later tint when the user turns on themed icons; without it the icon keeps its colors there. The package keeps icon.android.png, else icon.png, as the plain bitmap icon, which no launcher of Android 9 or later, the oldest NSGo runs on, picks over the adaptive one; without png, the tool draws it from the foreground over the background. Without adaptive layers, the launcher shows the Android bitmap or the shared png.
Launch screen
Section titled “Launch screen”Set launch_screen to show an opaque background, a centered PNG, or both on iOS, Android 12 or later and the web. Image paths are relative to nsgo.yaml, and nsgo check reports a missing image. The image fits proportionally inside 128 × 128 points or dp. A transparent PNG with a longest side of at least 512 pixels keeps it sharp on high-density screens.
launch_screen: background: "#F5F1EA" image: assets/Launch.png progress: "#C2410C" dark: background: "#201C26" image: assets/LaunchDark.png progress: "#F2C14E"The system selects the appearance unless appearance pins it. Omit any dark field to reuse the corresponding value. An omitted background or image keeps the platform’s default. Embedded apps get their launch screen from the host.
On the web, the launch screen is the page while the WebAssembly downloads and starts: the background from the first paint, the image or, without one, the app’s icon and name, and a download bar in progress, which only the web shows, or in black or white, whichever reads on the background. It fades out once the app draws its first frame, at once for readers who ask for reduced motion. A published site names the image by its content and preloads it, like the icon, and an installed web app’s splash screen takes the background.
Plain HTTP on Android
Section titled “Plain HTTP on Android”android.uses_cleartext_traffic: true opts an APK or App Bundle into plain HTTP to any host, setting both the manifest flag and its network security policy. Without that opt-in, android.loopback_cleartext: true allows plain HTTP only from localhost, 127.0.0.1 and ::1, such as video served by the app itself. The loopback-only policy denies cleartext to other hosts; the all-host opt-in takes precedence when both settings are true. For an embedded AAR, configure the host app’s Android network security policy.
Android native classes
Section titled “Android native classes”List precompiled Android classes in the app’s nsgo.yaml to use a custom View from core.Native.
android: classes: [java/BadgeView.jar, java/Helpers.dex]Paths are relative to nsgo.yaml unless absolute. Each path names a .dex file or a JAR containing D8’s root classes.dex, classes2.dex and later shards. Prepare those files with D8 using --min-api 28. On arm64, NSGo builds the APK or App Bundle from these precompiled files with Go alone. Android development sessions rebuild when a listed file changes. For an embedded AAR, the host’s Android build supplies its Java dependencies. D8 documentation
The Android native example registers a class with a public Context constructor and configures it with a Go prop.