4 releases
| 0.1.5 | Jan 10, 2026 |
|---|---|
| 0.1.4 | Feb 17, 2025 |
#1245 in Network programming
15KB
252 lines
ZZH - Improved SSH experience
ZZH is a cli tool that wraps SSH. It's not a drop in replacement, just a more enjoyable way of managing connections
Features
- Interactive Fuzzy Search: Quickly find and connect to your hosts using a fuzzy search menu.
- Connection History: Automatically tracks your recent SSH connections for easy access.
- Detached Sessions: Option to start sessions in detached mode (no interactive shell).
- SSH Config Integration: Reads your existing SSH configuration from
~/.ssh/configto list available hosts. - Shell Completions: Tab completion support for bash, zsh, and fish with history-aware suggestions.
- Simple & Fast: Built with performance and usability in mind.
Installation
Prerequisites
- Rust (for building from source)
- SSH installed and configured on your system
Installation via Cargo
cargo install zzh
Building from Source
-
Clone the repository:
git clone https://github.com/yourusername/zzh.git cd zzh -
Build the project:
cargo build --release -
Run the binary:
The compiled binary will be available at
target/release/zzh. You can run it directly or add it to your PATH for easier access.
Usage
Connect to a Host Directly
To connect to a specific host defined in your SSH configuration, simply pass the target host as an argument:
zzh <target-host>
Interactive Host Selection
Run zzh without any arguments to launch an interactive fuzzy search menu. This interface combines your connection history and hosts from your SSH config, allowing you to select a host easily:
zzh
Detached Sessions
If you want to establish a connection without opening an interactive shell (detached mode), use the --detached flag:
zzh <target-host> --detached
List SSH Hosts
To list all hosts defined in your SSH configuration:
zzh --hosts
Shell Completions
ZZH supports tab completion for bash, zsh, and fish shells. Completions suggest hosts from both your connection history (sorted by recency) and your SSH config.
To generate completions for your shell:
# Bash
zzh completions bash >> ~/.bashrc
# Zsh
zzh completions zsh >> ~/.zshrc
# Fish
zzh completions fish > ~/.config/fish/completions/zzh.fish
After adding the completions, restart your shell or source the config file to enable them.
How It Works
-
SSH Config Integration:
ZZH locates and reads your SSH configuration from$HOME/.ssh/configto compile a list of available hosts. -
Connection History:
Each time you connect to a host, ZZH logs the connection with a timestamp in a history file (~/.zzh/history). This history is then used to prioritize frequently accessed hosts in the interactive menu. -
Fuzzy Search Interface:
The interactive menu allows you to search through your hosts with ease, displaying connection history with timestamps for added context.
Configuration
- History Storage:
ZZH creates a.zzhfolder in your home directory where it stores the connection history in a file namedhistory. You can manually clear or edit this file as needed.
Contributing
If you encounter any issues or have suggestions for improvements, please open an issue or submit a pull request.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Enjoy a smoother SSH experience with ZZH!
Dependencies
~7–19MB
~215K SLoC