# Native Shell (NSH)

> Rust-based engine that runs TSX modules as native UI on iOS, Android, macOS, Windows, Linux, GPUI and the web, designed for AI-generated screens.

Native Shell (NSH) is an open-source engine from Longbridge that runs modules written in TSX natively on iOS, Android, macOS, Windows, Linux, GPUI and the web. It is designed for AI-generated, dynamically delivered native UI, and modules can be embedded in existing apps or packaged as standalone apps. The latest listed release is v0.1.1.

## What It Is

NSH is a cross-platform UI runtime and toolchain. A module is a TSX file using signals, host elements and Tailwind classes. Each platform renders it with its own UI: UIKit on iOS, Android views, AppKit on macOS, Win32 with Direct2D on Windows, GTK 4 on Linux, GPUI in GPUI apps and HTML on the web. Apps can also be written in Rust, or combine Rust components with TSX screens.

## How a Module Runs

The single `nsh` CLI bundles the module's files and compiles them to QuickJS bytecode. On the device, the bytecode runs in a QuickJS VM. The reactive graph, layout (Taffy), text and rendering are implemented in Rust, and view operations reach the main thread as one batch per frame. The docs describe fine-grained, Solid-style signals in which components run once.

## AI-Generated UI Workflow

A model writes a TSX module, and the server type-checks it, runs `nsh trace` headless to catch errors, builds and signs it. The app verifies the Ed25519-signed `.nshpkg` package, including revocation checks, then runs it in a sandbox. Each view gets memory, call-time and node limits and only the capabilities the host grants, such as network hosts. TypeScript declarations are generated from the Rust sources, and the docs are served as llms.txt for models.

## Embedding and Standalone Use

Hosts embed `NshAppView` (iOS), `NshView` (Android), `AppView` (desktop and GPUI) or `createPlayer` (web) to load modules at run time, alongside native components such as maps and web views. `nsh package` also produces standalone apps and static sites. Documented minimums: iOS 15+, Android 9 (API 28)+, macOS 14+, Windows 10 1809+, GTK 4.14+.

## Features
- TSX modules rendered with each platform's native UI
- Rust and TSX app authoring, including mixed projects
- Embedding via NshAppView, NshView, AppView and createPlayer
- Signed Ed25519 .nshpkg packages with revocation checks
- Sandboxed QuickJS VM per view with memory, call-time and node limits
- Host-granted capabilities
- Headless nsh trace for checking generated modules
- Generated TypeScript declarations and llms.txt docs
- Fine-grained signals reactivity
- Tailwind, flexbox and CSS grid styling
- Hot reload during development
- Standalone app and static site packaging with nsh package
- Host-registered native components

## Integrations
GPUI, GPUI Kit, QuickJS, Taffy, Tailwind, UIKit, GTK 4, Direct2D

## Platforms
WINDOWS, MACOS, LINUX, ANDROID, IOS, WEB, API, DEVELOPER_SDK, CLI

## Pricing
Open Source

## Version
v0.1.1

## Links
- Website: https://nsh.dev
- Documentation: https://nsh.dev/docs
- Repository: https://github.com/longbridge/nsh
- EveryDev.ai: https://www.everydev.ai/tools/native-shell-nsh
