| Crates.io | sshui |
| lib.rs | sshui |
| version | 0.1.3 |
| created_at | 2025-12-28 16:28:23.518094+00 |
| updated_at | 2026-01-20 19:45:16.83519+00 |
| description | A rust lib to make a customizable user-interface over SSH with Ratatui |
| homepage | |
| repository | https://github.com/KodeurKubik/SSHUI |
| max_upload_size | |
| id | 2009086 |
| size | 1,990,176 |
A Rust framework for building interactive terminal user interfaces (TUIs) that run over SSH. Built on top of Ratatui and russh.
https://github.com/user-attachments/assets/f3a5bf04-11df-4d3f-a8c0-1e2e67021fa4
Add to your Cargo.toml:
[dependencies]
sshui = "0.1"
ratatui = "0.28"
anyhow = "1.0"
Implement the App trait for your TUI:
use sshui::{App, SSHUITerminal, InputEvent, KeyCode, KeyEvent};
use anyhow::Result;
struct MyApp {
counter: i32,
exit: bool,
}
impl App for MyApp {
fn render(&mut self, terminal: &mut SSHUITerminal) -> Result<Option<String>> {
terminal.draw(|frame| {
let area = frame.area();
// Draw your UI here
})?;
Ok(if self.exit {
Some("Exited".to_string())
} else {
None
})
}
fn input(&mut self, event: InputEvent) {
if let InputEvent::Key(KeyEvent { key, .. }) = event {
match key {
KeyCode::Char('q') => self.exit = true,
KeyCode::Up => self.counter += 1,
KeyCode::Down => self.counter -= 1,
_ => {}
}
}
}
}
impl Default for MyApp {
fn default() -> Self {
Self {
counter: 0,
exit: false,
}
}
}
Start the SSH server:
#[tokio::main]
async fn main() -> anyhow::Result<()> {
let config = sshui::Config::default();
// also include ssh keys
// which you can get using the keyring feature
// and the sshui::get_ssh_key function
sshui::new_server(config, ("0.0.0.0", 2222), || Box::new(MyApp::default()))
.await?;
Ok(())
}
Connect via SSH:
ssh -p 2222 localhost
Press Ctrl+C to exit.
The repository includes example applications:
Run an example: (you can specify the port with --port {number})
cargo run -p example --release
Then connect via SSH:
ssh -p 2222 localhost
get_cursor() always returns (0, 0)auth_password() if needed)© Kodeur_Kubik - Code available under the MIT License