NSH
NSH (Native Shell) is a cross-platform native UI runtime. Modules written in TSX and Tailwind are rendered as each platform's own native interface on iOS, Android, macOS, Windows, Linux, GPUI and the Web. Modules can be loaded at runtime as plugins inside an existing app, or packaged as standalone apps.
Alternatives
Tech stack
No tech stack added yet. Sign in to suggest some
NSH stands for Native Shell. Developed by Longbridge, it is a cross-platform native UI runtime implemented in Rust. Developers or AI models write UI modules in TSX and Tailwind, and NSH renders them on each platform using that platform's own UI. On iOS, Android, macOS, Windows and Linux they become native views, in GPUI apps they become GPUI elements, and on the Web they become HTML. An app can load these modules as plugins at runtime. The same module can also be packaged as a standalone app.
Key features
- Truly native UI: Every element maps to a platform view, including UIKit, Android views, AppKit, Win32 drawn with Direct2D, and GTK 4. Layout uses flexbox and grid (based on Taffy). The system's built-in text, input, scrolling and accessibility capabilities can be used directly. Native components such as maps and WebViews can also be layered with NSH views.
- Works as a plugin or a standalone app: Embed
NshAppView(iOS),NshView(Android) orAppView(desktop and GPUI) in any screen of an existing app, or usecreatePlayerfor Web pages. Modules can be loaded from a built-in bundle, a dev server or a downloaded signed package, so feature updates can be decoupled from the host app's release cycle. - AI-friendly: A module is a single TSX file made up of components, signals and Tailwind class names, which is the format large models are best at generating. All elements, properties and modules have TypeScript type declarations generated from the Rust source. Documentation is provided to models as llms.txt.
nsh tracecan run a module headlessly without a device for checking. - Sandboxing and signing: Each view's module runs in its own QuickJS virtual machine, with limits on memory, call time and node count, and can only use the capabilities granted by the host. Release packages are signed with Ed25519, release keys are certified by an offline root key, and devices check a revocation list.
- Performance: Only the app's own code is JavaScript. Signals, the renderer, layout, animation and all built-in modules are implemented in Rust, and each frame is passed to the UI thread as a single batch.
- One command-line tool for the whole toolchain: A single
nshbinary handles packaging, type checking, the hot-reload dev server and publishing.
Supported platforms
| Platform | Rendering | Requirements |
|---|---|---|
| iOS | UIKit, CoreText | iOS 15+ |
| Android | Android views | Android 9 (API 28)+ |
| macOS | AppKit, Core Animation | macOS 14+ |
| Windows | Win32, Direct2D, DirectWrite | Windows 10 1809+ |
| Linux | GTK 4, Pango | GTK 4.14+ |
| GPUI (macOS/Windows/Linux) | GPUI | macOS, Windows; Linux requires Vulkan |
| Web | HTML, CSS | Modern browsers |
Target users and use cases
- Cross-platform app developers who want to build UIs with a web technology stack while getting native look and performance.
- Teams that want to embed dynamic modules in existing native apps and ship them through signed packages, independent of app store releases.
- AI application developers who want large models to generate UIs and run them safely in a sandbox.
- Rust developers building desktop apps with GPUI.
Installation and usage
curl -fsSL https://nsh.dev/install.sh | sh # macOS、Linux
irm https://nsh.dev/install.ps1 | iex # Windows(PowerShell)
brew install longbridge/tap/nsh # Homebrew
Create an app and run it with hot reload:
nsh init my-app
nsh run my-app
nsh run my-app --target ios # 也支持 android、macos、gpui、web
To publish a signed update, first generate a root key and a release key with nsh keygen, then certify with nsh certify, and finally generate a signed .nshpkg with nsh publish. A standalone app can be packaged with nsh package --target <platform>.
Technical requirements and notes
- Running on the iOS simulator requires Xcode, and running on Android requires the Android SDK.
- Building from source requires the Rust toolchain; the
rust-toolchain.tomlin the repository specifies the version. - The project is licensed under Apache-2.0.
- The project is new, with about 121 stars on GitHub. Documentation, guides and an online demo are available at nsh.dev.
- The repository provides sample apps such as gallery, counter and hopper, as well as examples of embedding in native iOS and Android apps.
Discover more
Bencher
Suite of continuous benchmarking tools designed to catch performance regressions in CI.
Aastro
Extensible API Gateway written in Go. Load custom plugins to extend functionality.
Dify.ai
Build, test and deploy LLM applications.
DreamFactory
Turns any SQL/NoSQL/Structured data into Restful API.
Gerrit
Code review and project management tool for Git-based projects.
Gitblit
Pure Java stack for managing, viewing, and serving Git repositories.
