From 56641bbc09e7f177a4470466765444d5fad57b5e Mon Sep 17 00:00:00 2001 From: CGH0S7 Date: Thu, 11 Dec 2025 14:56:33 +0800 Subject: [PATCH] README added --- README.md | 72 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..8cad1d7 --- /dev/null +++ b/README.md @@ -0,0 +1,72 @@ +# sshx + +`sshx` is a simple, terminal-based SSH connection manager written in Rust. It provides a TUI (Text User Interface) to manage your SSH connections, allowing you to add, edit, delete, and connect to servers quickly. + +## Features + +- **TUI Interface**: built with `ratatui` for a smooth terminal experience. +- **Manage Servers**: Add, edit, and delete server configurations easily. +- **One-Key Connection**: Connect to your saved servers via standard `ssh` with a single keypress. +- **Mosh Support**: Launch `mosh` sessions directly from the interface. +- **Key Management**: Quickly copy your public key to a server using `ssh-copy-id`. +- **Persistent Storage**: Server configurations are saved in JSON format in your user configuration directory. + +## Installation + +### Prerequisites + +- [Rust](https://www.rust-lang.org/tools/install) (cargo) +- `ssh` client +- `mosh` (optional, for mosh support) +- `ssh-copy-id` (optional, for key copying) + +### Building from Source + +1. Clone the repository: + ```bash + git clone https://github.com/yourusername/sshx.git + cd sshx + ``` + +2. Build and run: + ```bash + cargo run --release + ``` + + Or install it locally: + ```bash + cargo install --path . + ``` + +## Usage + +Start the application by running `sshx` (if installed) or `cargo run`. + +### Key Bindings + +**Navigation & General:** +- `j` / `Down` / `Tab`: Select next server +- `k` / `Up` / `Shift+Tab`: Select previous server +- `q` / `Esc`: Quit application + +**Actions:** +- `Enter`: Connect to selected server via `ssh` +- `m`: Connect to selected server via `mosh` +- `n`: Add a new server +- `N` (Shift+n): Run `ssh-copy-id` for the selected server +- `i`: Edit the selected server +- `d`: Delete the selected server + +**Input Mode (Adding/Editing):** +- `Tab` / `Down`: Move to next field +- `Shift+Tab` / `Up`: Move to previous field +- `Enter`: Save and close +- `Esc`: Cancel and return to list + +## Configuration + +Server configurations are stored in `~/.config/sshx/servers.json` (on Linux) or the equivalent configuration directory for your OS. + +## License + +This project is licensed under the terms defined in the `Cargo.toml` file.