longbridge/nsh

NSH runs modules written in TSX — natively on iOS, Android, macOS, Windows, Linux, GPUI and the web

Rust

347

129 commits

updated Oct 19, 2026

See the code

See what people are saying

README

Native Shell (NSH)

Native UI in Rust and TSX, embedded in your app or shipped on its own. Native Shell is a Rust engine for cross-platform apps and AI-generated UI. Write your app in Rust, use TSX for dynamically delivered screens, or combine both with shared Rust components. Each platform renders with its own UI: native views on iOS, Android, macOS, Windows and Linux, GPUI in GPUI apps and HTML on the web.

Embed NSH in an existing app or package it as a standalone app. Hosts can load TSX modules at run time as plugins, delivered as signed packages and run in a sandbox the host configures.

Documentation, guides and live demos: nsh.dev.

Features

  • Write apps in Rust, TSX, or both, and render with each platform's own UI, sharing the same reactive engine, flexbox and grid layout, system text, input and accessibility.
  • Embed in existing native apps alongside components such as maps and web views, or package as standalone apps and static websites.
  • Deliver TSX screens at run time with signed packages and host-controlled sandbox capabilities.
  • Build AI-generated screens with TSX and Tailwind, generated TypeScript declarations and model-readable documentation.
  • Iterate with TSX hot updates, headless tracing and a single Rust-built nsh CLI for building and packaging.

Platforms

PlatformDrawn withEmbed withRequires
iOSUIKit, CoreTextNshAppView (Swift, NativeShell.xcframework)iOS 15+
AndroidAndroid views, StaticLayoutNshView (Java / Kotlin, nsh.aar)Android 9 (API 28)+
macOSAppKit, Core Animation, CoreTextAppView (Rust, nsh-platform-macos)macOS 14+
WindowsWin32, Direct2D, DirectWriteAppView (Rust, nsh-platform-windows)Windows 10 1809+
LinuxGTK 4, PangoAppView (Rust, nsh-platform-linux)GTK 4.14+
GPUI (macOS, Windows, Linux)GPUI (GPUI Fast)AppView (Rust, a GPUI view, nsh-platform-gpui)macOS, Windows; Linux with Vulkan
WebHTML, CSScreatePlayer (JavaScript) or an iframeModern browsers

The GPUI backend (nsh run --target gpui, nsh package --target gpui) draws apps with GPUI on all three desktops and embeds in GPUI and GPUI Kit apps. The web platform (nsh run --target web, nsh package --target web) publishes apps as static sites and runs the website's live demos.

Quick start

Install the nsh command (other ways):

macOS / Linux
curl -fsSL https://nsh.dev/install.sh | sh
Homebrew
brew install longbridge/tap/nsh
Windows (PowerShell)
irm https://nsh.dev/install.ps1 | iex

Choose how to write your app:

RustTSX
Creatensh init my-app --rustnsh init my-app
WriteRust components, typed styles and signalsTSX components, Tailwind classes and signals
IterateRebuild and restart on Rust changesHot updates that preserve state
Toolchainnsh and Rustnsh

You can also combine them: TSX screens import your Rust components and modules. See Building with Rust for Rust apps and mixed projects.

Run either app on your chosen platform:

iOS
nsh run my-app --target ios        # iOS simulator; requires Xcode
nsh run my-app --target catalyst   # Mac Catalyst window on macOS
Android
nsh run my-app --target android    # emulator or device; requires the Android SDK
macOS
nsh run my-app --target macos      # AppKit window
Windows
nsh run my-app --target windows    # Win32 window
Linux
nsh run my-app --target linux      # GTK 4 window
GPUI (macOS, Windows, Linux)
nsh run my-app --target gpui
Web
nsh run my-app --target web        # open in the browser

The Rust template includes a Cargo project with its root component in src/lib.rs. The TSX template includes App.tsx, nsh.json and tsconfig.json, with generated TypeScript declarations in .nsh/types for your editor. Logs and errors show in the terminal. What each platform needs: Installation.

Examples

ExampleWhat it shows
examples/galleryA tour of what NSH supports: lists, navigation, forms, controls, gestures, animation, images, styles, text, web view and video, fetch
examples/counterThe smallest app
examples/hopperA dark, tabbed dashboard built only from primitives: interactive canvas charts, sliders, menus, animation
examples/desktopA desktop app with a title bar and menus of its own (nsh/desktop)
examples/gallery-rsThe gallery written in Rust, with a TSX entry for mixed development
examples/embed-ios, examples/embed-androidNSH inside existing native apps, with a native component the app registers
examples/benchRust components against the same components in TSX
cargo run

License

Licensed under the Apache License, Version 2.0.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this project by you, as defined in the Apache-2.0 license, shall be licensed under Apache-2.0, without any additional terms or conditions.

cross-platform
native
nsh

longbridge/nsh

NSH runs modules written in TSX — natively on iOS, Android, macOS, Windows, Linux, GPUI and the web

Rust

347

129 commits

updated Oct 19, 2026

See the code

See what people are saying

README

Native Shell (NSH)

Native UI in Rust and TSX, embedded in your app or shipped on its own. Native Shell is a Rust engine for cross-platform apps and AI-generated UI. Write your app in Rust, use TSX for dynamically delivered screens, or combine both with shared Rust components. Each platform renders with its own UI: native views on iOS, Android, macOS, Windows and Linux, GPUI in GPUI apps and HTML on the web.

Embed NSH in an existing app or package it as a standalone app. Hosts can load TSX modules at run time as plugins, delivered as signed packages and run in a sandbox the host configures.

Documentation, guides and live demos: nsh.dev.

Features

  • Write apps in Rust, TSX, or both, and render with each platform's own UI, sharing the same reactive engine, flexbox and grid layout, system text, input and accessibility.
  • Embed in existing native apps alongside components such as maps and web views, or package as standalone apps and static websites.
  • Deliver TSX screens at run time with signed packages and host-controlled sandbox capabilities.
  • Build AI-generated screens with TSX and Tailwind, generated TypeScript declarations and model-readable documentation.
  • Iterate with TSX hot updates, headless tracing and a single Rust-built nsh CLI for building and packaging.

Platforms

PlatformDrawn withEmbed withRequires
iOSUIKit, CoreTextNshAppView (Swift, NativeShell.xcframework)iOS 15+
AndroidAndroid views, StaticLayoutNshView (Java / Kotlin, nsh.aar)Android 9 (API 28)+
macOSAppKit, Core Animation, CoreTextAppView (Rust, nsh-platform-macos)macOS 14+
WindowsWin32, Direct2D, DirectWriteAppView (Rust, nsh-platform-windows)Windows 10 1809+
LinuxGTK 4, PangoAppView (Rust, nsh-platform-linux)GTK 4.14+
GPUI (macOS, Windows, Linux)GPUI (GPUI Fast)AppView (Rust, a GPUI view, nsh-platform-gpui)macOS, Windows; Linux with Vulkan
WebHTML, CSScreatePlayer (JavaScript) or an iframeModern browsers

The GPUI backend (nsh run --target gpui, nsh package --target gpui) draws apps with GPUI on all three desktops and embeds in GPUI and GPUI Kit apps. The web platform (nsh run --target web, nsh package --target web) publishes apps as static sites and runs the website's live demos.

Quick start

Install the nsh command (other ways):

macOS / Linux
curl -fsSL https://nsh.dev/install.sh | sh
Homebrew
brew install longbridge/tap/nsh
Windows (PowerShell)
irm https://nsh.dev/install.ps1 | iex

Choose how to write your app:

RustTSX
Creatensh init my-app --rustnsh init my-app
WriteRust components, typed styles and signalsTSX components, Tailwind classes and signals
IterateRebuild and restart on Rust changesHot updates that preserve state
Toolchainnsh and Rustnsh

You can also combine them: TSX screens import your Rust components and modules. See Building with Rust for Rust apps and mixed projects.

Run either app on your chosen platform:

iOS
nsh run my-app --target ios        # iOS simulator; requires Xcode
nsh run my-app --target catalyst   # Mac Catalyst window on macOS
Android
nsh run my-app --target android    # emulator or device; requires the Android SDK
macOS
nsh run my-app --target macos      # AppKit window
Windows
nsh run my-app --target windows    # Win32 window
Linux
nsh run my-app --target linux      # GTK 4 window
GPUI (macOS, Windows, Linux)
nsh run my-app --target gpui
Web
nsh run my-app --target web        # open in the browser

The Rust template includes a Cargo project with its root component in src/lib.rs. The TSX template includes App.tsx, nsh.json and tsconfig.json, with generated TypeScript declarations in .nsh/types for your editor. Logs and errors show in the terminal. What each platform needs: Installation.

Examples

ExampleWhat it shows
examples/galleryA tour of what NSH supports: lists, navigation, forms, controls, gestures, animation, images, styles, text, web view and video, fetch
examples/counterThe smallest app
examples/hopperA dark, tabbed dashboard built only from primitives: interactive canvas charts, sliders, menus, animation
examples/desktopA desktop app with a title bar and menus of its own (nsh/desktop)
examples/gallery-rsThe gallery written in Rust, with a TSX entry for mixed development
examples/embed-ios, examples/embed-androidNSH inside existing native apps, with a native component the app registers
examples/benchRust components against the same components in TSX
cargo run

License

Licensed under the Apache License, Version 2.0.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this project by you, as defined in the Apache-2.0 license, shall be licensed under Apache-2.0, without any additional terms or conditions.

cross-platform
native
nsh

Significant stargazers

邻二氮杂菲

26 followers · starred Oct 2026

Zhang

3 followers · starred Oct 2026