Skip to content

tynd build

Terminal window
tynd build
tynd build --bundle all
tynd build --bundle macos,dmg # macOS
tynd build --bundle deb # Linux
tynd build --bundle nsis,msi # Windows
Flag Effect
--cwd <dir> Run against another project directory
-o, --out <path> Override the raw executable path; a relative path stays inside the project
--bundle <targets> all or a comma-separated host-supported list
--debug-protocol Allow the debug protocol in the packaged app (diagnostic builds only; off by default). Unrelated to --verbose, which only enables debug-level CLI logs

Supported targets are host-specific:

Host OS Values
macOS macos (alias app), dmg
Linux deb, rpm, appimage, flatpak, snap, pkgbuild
Windows nsis, msi, msix

Unknown, duplicate, or cross-platform targets fail before packaging. Cross-compilation is not supported.

Packaged apps refuse to start the debug server (the socket that tynd-mcp and @tynd/test use) unless built with --debug-protocol. Without the flag, setting the debug socket environment variables (TYND_DEBUG_SOCKET, a socket or pipe path, or TYND_DEBUG_PORT, a loopback TCP port; the socket wins when both are set) has no effect. The flag writes an optional debug.flag entry in the pack, and the build prints a warning because any local process can then drive the app: do not distribute that build. A custom Rust host built in release mode never includes the debug protocol.

To drive a packaged binary with @tynd/test (a custom command in launchApp), build it with tynd build --debug-protocol.

tynd build fails when a source file value-imports a @tynd/plugin-<api> package that is not declared in plugins (run tynd add <api>); tynd validate and tynd dev only warn.

tynd build (like tynd validate) warns when the app uses fs, http, process or shell APIs, or a plugin other than the host-backed official plugins (such as @tynd/plugin-sql), and configures no security policy, because resource scopes are then open. See Security.

Without --out, the packed executable and installer artifacts land under:

release/<platform>-<arch>/

Examples: release/win32-x64/, release/darwin-arm64/, release/linux-x64/ (Node.js platform names).

The raw executable is <displayName-or-package-name>.exe on Windows and <displayName-or-package-name> elsewhere. Installer filenames are generated by the native bundler and are written beside it.

  1. Run the detected frontend production command when one exists.
  2. Bundle the backend with the exact project Bun executable to .tynd/cache/bundle.dist.js.
  3. Stage the frontend output and inject runtime/updater config.
  4. Compile the app’s Rust host (core plus the declared plugins’ APIs) with the Cargo release profile from the sources generated in .tynd/build, then copy the binary to .tynd/build/bin/release/. Cargo compiles into the shared host build cache, so only the first build on a machine takes a few minutes; in CI, cache the directory set in TYND_CACHE_DIR.
  5. Pack host, Bun, backend, frontend, sidecars, and metadata with native tynd-bundler.
  6. If --bundle is present, invoke the Rust installer bundler for the selected formats.
  7. Apply configured Windows or macOS signing to eligible artifacts.

build performs required work every time. .tynd/cache is staging data, not a source-hash skip cache.

Bun 1.3+ is required for application/frontend builds, and Rust 1.95+ (cargo and rustc on PATH) plus the platform build tools to compile the host. A missing or older toolchain stops the build with a message pointing to https://rustup.rs. Installer and signing formats may require host tools such as rpmbuild, NSIS/WiX support, AppImage utilities, hdiutil, or signtool.

Tynd does not run broad registry/WebView/toolchain preflight checks. The requested build step reports a missing prerequisite when it is used.

A macos bundle also produces the signed application archive consumed by tynd updater publish:

<binary>-<version>-macos.zip

If more than one .app is emitted, a numeric suffix distinguishes archives.