個人 GitHub 帳號下公開儲存庫的擁有者可以登入並驗證所有權,自行管理介紹,無需管理員核准。
登入並產生驗證檔案,在 30 分鐘內將其提交至此儲存庫的預設分支。其他分支或分叉儲存庫中的檔案無效。然後在下方檢查檔案,即可無需管理員核准直接管理專案。請保留檔案以維持管理權限。
如需登入,將前往登入頁面。登入後請回到此處,再次點擊所選的驗證按鈕。
在專案資料夾中執行 /nomorevibe verify,即可驗證所有權並自行管理介紹。
一分鐘完成驗證NSH runs modules written in TSX — natively on iOS, Android, macOS, Windows, Linux, GPUI and the web
翻譯準備中
取自儲存庫 README
正在載入完整 README。
檢視完整 README ↗Build once, native everywhere. Native Shell is a native UI framework for iOS, Android, macOS, Windows, Linux and the web, built in Rust. It unifies components, state, logic and API, with app-owned visual design and platform rendering: native views on iOS, Android, macOS, Windows and Linux, HTML on the web, GPUI in GPUI apps, with the platform's own text, input and interaction (a menu is a popup on the desktop and a sheet on a phone). Write the whole app in Rust, its screens in TSX, or combine both with shared Rust components.
Package it as a standalone app on every platform, or embed it in an existing one. On the same engine, apps load TSX modules at run time — plugins, features, UI generated by AI — delivered as signed packages and run in a sandbox the host configures.
Documentation, guides and live demos: nsh.dev.
Native views and interaction, with an app-owned design: NSH shares components, state and APIs across platforms,
while the app controls colors, typography, spacing, shapes and motion. nsh/base provides the behavior and accessible
structure of common controls such as Button, Checkbox and Switch; apps and community libraries give them a look.
Platform modules expose capabilities specific to their platforms, such as the mobile system tab bar.
Read Goals and design principles for the component boundaries and how these goals guide Rust apps, TSX modules and AI-generated UI.
nsh/base: navigation, safe areas, dialogs, the keyboard, the status bar), and your app draws its components from
them in TSX or Rust.nsh CLI for building and packaging.| Platform | Drawn with | Embed with | Requires |
|---|---|---|---|
| iOS | UIKit, CoreText | NshAppView (Swift, NativeShell.xcframework) | iOS 15+ |
| Android | Android views, StaticLayout | NshView (Java / Kotlin, nsh.aar) | Android 9 (API 28)+ |
| macOS | AppKit, Core Animation, CoreText | AppView (Rust, nsh-platform-macos) | macOS 14+ |
| Windows | Win32, Direct2D, DirectWrite | AppView (Rust, nsh-platform-windows) | Windows 10 1809+ |
| Linux | GTK 4, Pango | AppView (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 |
| Web | HTML, CSS | createPlayer (JavaScript) or an iframe | Modern browsers |
Each desktop runs and packages apps with its own backend (AppKit, Win32, GTK 4). The GPUI backend draws with GPUI on
all three desktops and embeds NSH in GPUI and GPUI Kit apps; nsh run --target gpui shows an app as they do. The web
platform (nsh run --target web, nsh package --target web) publishes apps as static sites and runs the website's
live demos.
Install the nsh command (other ways):
curl -fsSL https://nsh.dev/install.sh | sh
Build and install the latest main from source (Git, Rust and the
platform build dependencies required):
curl -fsSL https://nsh.dev/install.sh | sh -s -- --source
nsh -V # nsh 0.1.1 (abcdef0)
Re-run to update. The checkout stays in ~/.nsh/source for runtime builds.
brew install longbridge/tap/nsh
irm https://nsh.dev/install.ps1 | iex
Choose how to write your app:
| Rust | TSX | |
|---|---|---|
| Create | nsh init my-app --template rust | nsh init my-app --template ts |
| Write | Rust components, typed styles and signals | TSX components, Tailwind classes and signals |
| Iterate | Rebuild and restart on Rust changes | Hot updates that preserve state |
| Toolchain | nsh and Rust | nsh |
You can also combine them (nsh init my-app --template mixed): 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:
nsh run my-app --target ios # iOS simulator; requires Xcode
nsh run my-app --target catalyst # Mac Catalyst window on macOS
nsh run my-app --target android # emulator or device; requires the Android SDK
nsh run my-app --target macos # AppKit window
nsh run my-app --target windows # Win32 window
nsh run my-app --target linux # GTK 4 window
nsh run my-app --target gpui # as GPUI apps that embed it show it
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.
| Example | What it shows |
|---|---|
examples/gallery-rs | The gallery written in Rust: an app with no TSX and no QuickJS |
examples/rust-exports | A TSX app using a component, a module and a class of its own Rust crate |
examples/gallery | A tour of what NSH supports: lists, navigation, forms, controls, gestures, animation, images, styles, text, web view and video, fetch |
examples/counter | The smallest app |
examples/hopper | A dark, tabbed dashboard built only from primitives: interactive canvas charts, sliders, menus, animation |
examples/desktop | A desktop app with a title bar and menus of its own (nsh/desktop) |
examples/embed-ios, examples/embed-android | NSH inside existing native apps, with a native component the app registers |
examples/bench | Rust components against the same components in TSX |
cargo run
NSH builds on the ideas of these projects:
Points, Point, Size,
Bounds, Edges), SharedString, typed styles in Rust and much of the vocabulary of NSH's API.gpui-base's unstyled base components, which nsh-base
follows in names and scope, and the Coding and Design Guides.neutral) and the
cssVars theme files apps write or export from shadcn's themes and tweakcn.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.