How longbridge/nsh works
Native Shell is a cross-platform Rust UI runtime that combines Rust components and runtime-loaded TSX screens, then renders them through native, GPUI, or web backends. The principal flow is app source through the CLI/build tooling into the engine and platform surface; hosts can also embed a surface directly. The README documents signed packages, sandboxing, hot updates, development tracing, and broad platform coverage. The graph preserves those capabilities, but some implementation links are dashed because the corresponding source was not sampled.
Main entry points: lib.rs App engine · app.rs GPUI surface · nsh-cli/src NSH CLI · nsh-core/src UI core
Components 23
App authoring
- Rust and TSX app
Runtime engine
- App engine
crates/nsh-engine/src/lib.rs - UI core
crates/nsh-core/src - Ambient services
crates/nsh-core/src/ui/ambient.rs - TSX runtime
crates/nsh-js/src
Platform surfaces
- iOS surface
crates/nsh-platform-ios/src/app.rs - Android surface
crates/nsh-platform-android/src - macOS surface
crates/nsh-platform-macos/src/app.rs - Windows surface
crates/nsh-platform-windows/src/app.rs - Linux surface
crates/nsh-platform-linux/src/app.rs - GPUI surface
crates/gpui/nsh-platform-gpui/src/app.rs - Input and navigation
crates/gpui/nsh-platform-gpui/src/input.rs - Window chrome
crates/gpui/nsh-platform-gpui/src/chrome.rs - System services
crates/gpui/nsh-platform-gpui/src/system.rs - GPUI thread bridge
crates/gpui/nsh-platform-gpui/src/rt.rs - Web runtime
crates/nsh-platform-web/src - Web player
crates/nsh-platform-web/web/nsh.js
Delivery and development
- NSH CLI
crates/nsh-cli/src - TSX bundler
crates/nsh-bundler/src - Signed packages
crates/nsh-package/src - Hot updates and tracing
crates/nsh-dev/src - Docs and demos
website/src
Other components
- App developer
Connections 23
- App developer → Rust and TSX app: authors
README.md - App developer → NSH CLI: runs
README.md - Rust and TSX app → NSH CLI: builds or runs
- NSH CLI → TSX bundler: bundles TSX
- NSH CLI → App engine: runs app
- NSH CLI → Signed packages: packages app
- Signed packages → TSX runtime: delivers TSX
- TSX runtime → App engine: runs modules
- App engine → UI core: uses UI core
- UI core → Ambient services: exposes services
crates/nsh-core/src/ui/ambient.rs - App engine → iOS surface: renders on
README.md - App engine → Android surface: renders on
README.md - App engine → macOS surface: renders on
README.md - App engine → Windows surface: renders on
README.md - App engine → Linux surface: renders on
README.md - App engine → GPUI surface: renders on
README.md - App engine → Web runtime: renders on
README.md - GPUI surface → Input and navigation: routes input
crates/gpui/nsh-platform-gpui/src/app.rs - GPUI surface → Window chrome: configures chrome
crates/gpui/nsh-platform-gpui/src/app.rs - GPUI surface → System services: configures services
crates/gpui/nsh-platform-gpui/src/app.rs - GPUI surface → GPUI thread bridge: uses thread bridge
crates/gpui/nsh-platform-gpui/src/app.rs - Hot updates and tracing → App engine: updates and traces
- Docs and demos → Web player: hosts demos
README.md