Skip to content

About

SSH client for React Native: Rust (russh) core, native terminal views

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

@kilocode/react-native-ssh

An SSH client for React Native and Expo, with the protocol implementation in Rust (russh) and the Kotlin/Swift bridge generated by uniffi.

Status: pre-release. Only the native pipeline is wired up so far: the Rust core exposes two functions, the uniffi bindings are generated for both platforms, and the Expo module surfaces them to TypeScript. Connecting and authenticating, the terminal views, SFTP and port forwarding land in later releases.

Layout

Path Contents
rust/ssh-core The Rust library (core_version, generate_ed25519_key)
rust/uniffi-bindgen Bindings generator binary used by the build scripts
android/, ios/ The Expo module and its native build files
src/ TypeScript API
example/ Expo app that prints the core version and a generated key
scripts/ Native build scripts

Building

Generated code is not committed. Run the script for the platform you target before building the module or the example app:

scripts/build-android.sh   # libssh_core.so + Kotlin bindings (needs the Android NDK)
scripts/build-ios.sh       # SshCore.xcframework + Swift bindings (needs macOS and Xcode)

Android output lands in android/src/main/jniLibs and android/src/main/java/ai/kilo/reactnativessh/uniffi; iOS output lands in ios/Frameworks and ios/Generated.

Development

npm install
npm run build                       # TypeScript -> build/
cd example && npm install
npx expo prebuild --platform android
npx expo run:android

Terminal input

Shell input and resize requests share one ordered queue. Shutdown stops accepting new input immediately, and remote closure stops the writer. A closed channel returns ChannelClosed; transport failures and writes through a closed or unbound Android terminal are reported through onClosed with an error message.

The SSH integration tests run only when SSH_TEST_HOST is set. The shell_preserves_rapid_single_byte_writes test sends 16,384 individual writes, interleaves resizes, and compares the remote file byte for byte.

License

Apache-2.0. See LICENSE.

About

SSH client for React Native: Rust (russh) core, native terminal views

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages