Skip to content
/ sushi Public

A modern, terminal-based SSH connection manager written in Rust. Features hierarchical configuration, jump hosts support, and a beautiful TUI powered by Ratatui. 🍣

License

Notifications You must be signed in to change notification settings

yatoub/sushi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

69 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🍣 Sushi

Sushi is a modern, terminal-based SSH connection manager written in Rust. It helps you organize your servers into groups and environments, handle complex connection scenarios (jumphosts, bastions), and connect quickly with a beautiful TUI with Catppuccin theme.

✨ Features

  • Hierarchical Organization: Structure your infrastructure with Groups, Environments, and Servers.
  • Connection Modes:
    • Direct: Standard SSH connection.
    • Jump/Rebond: Connect via one or more jump hosts (-J). Supports multi-hop chains.
    • Bastion: Connect via a hardened bastion using custom login string.
    • Mode Inheritance: Connection mode inherits from defaults β†’ group β†’ environment β†’ server.
  • Configuration Inheritance: Define defaults globally or at the group/environment level to avoid repetition.
    • Full cascading support for user, ssh_key, mode, port, options, and connection configs.
    • use_system_ssh_config: opt in to respecting ~/.ssh/config (ControlMaster, aliases…).
  • CLI β€” connect without opening the TUI:
    • --direct, --rebond, --bastion [user@]host[:port] β€” instant SSH connection.
    • -u/--user, -p/--port, -k/--key β€” override any SSH parameter.
    • -c/--config β€” use an alternate configuration file.
    • -v/--verbose β€” enable SSH verbose output.
  • Advanced Search:
    • Multi-field Search: Search by server name OR hostname.
    • Live Results Counter: See matching servers in real-time (e.g., "45 / 387 servers").
    • Visual Feedback: Color-coded borders (sapphire during search, green for results, red for no match).
    • Smart Expansion: Auto-expands groups when searching.
  • Interactive TUI:
    • Mouse Support: Click to select, double-click to connect.
    • Configurable Theme: Choose from four Catppuccin flavors β€” latte, frappe, macchiato, or mocha (default) via defaults.theme in your config.
    • Verbose Mode: Toggle SSH verbose output with v.
    • Rich Detail Pane: Shows port (highlighted when non-standard), connection mode, jump host, bastion host, and SSH options.
    • Quick Diagnostic (d): Press d on any server to run a non-blocking SSH probe. The detail pane displays a System block with kernel, CPU model, load average, and color-coded RAM/Disk progress bars (green < 60%, yellow 60–85%, red > 85%). Additional mount points configured via probe_filesystems are also shown: each extra path gets its own bar, or a yellow ⚠ /path β€” not mounted warning if absent. An animated spinner shows while the probe is running. Press d again to refresh; changing server resets it.
    • Clipboard: Copy the SSH command for any server with y (requires a running clipboard manager on Linux).
  • State Persistence: Expanded groups are saved to ~/.sushi_state.json and restored on next launch.
  • In-TUI Error Screen: Connection errors are displayed as an overlay instead of crashing β€” press Enter/Esc/q to dismiss.
  • Smart Sorting: Automatically sorts groups and servers alphabetically.

πŸš€ Installation

Prerequisites

  • Rust & Cargo
  • A terminal with truecolor support (e.g., Alacritty, Kitty, WezTerm, iTerm2, Tilix).

Build from Source

git clone https://github.com/yatoub/sushi.git
cd sushi
cargo build --release
sudo cp target/release/sushi /usr/local/bin/

βš™οΈ Configuration

Sushi looks for a configuration file at ~/.sushi.yml.
A fully annotated example covering every feature is available at examples/full_config.yaml.

Example ~/.sushi.yml

defaults:
  user: "admin"
  ssh_key: "~/.ssh/id_ed25519"
  ssh_port: 22
  theme: mocha  # latte | frappe | macchiato | mocha (default)
  ssh_options:
    - "StrictHostKeyChecking=no"
    - "UserKnownHostsFile=/dev/null"
  # Set to true to honour ~/.ssh/config (ControlMaster, aliases, etc.)
  use_system_ssh_config: false
  rebond:
    - host: "jump.example.com"
      user: "jump"
  # Multi-hop example:
  # rebond:
  #   - host: "jump1.example.com"
  #     user: "jump"
  #   - host: "jump2.example.com"
  #     user: "jump"
  bastion:
    host: "bastion.example.com"
    user: "bastion"

groups:
  # Level 3: Group β†’ Environment β†’ Server
  - name: "Projet Alpha"
    user: "dev"             # overrides default user for this group
    environments:
      - name: "Production"
        servers:
          - name: "web-01"
            host: "192.168.1.10"
            mode: "direct"
          - name: "db-01"
            host: "192.168.1.11"  # inherits mode from defaults
      - name: "Staging"
        servers:
          - name: "web-stg"
            host: "192.168.1.20"
            mode: "jump"          # override at server level

  # Level 2: Group β†’ Server
  - name: "Infrastructure"
    servers:
      - name: "proxmox-host"
        host: "192.168.1.100"
        mode: "direct"
      - name: "internal-nas"
        host: "192.168.1.200"
        user: "root"
        mode: "bastion"

  # Level 1: Single server at root
  - name: "Raspberry-Pi-Home"
    host: "raspberrypi.local"
    user: "pi"
    mode: "direct"

See examples/full_config.yaml for a complete reference with all options and inline comments.

⚠️ Breaking change (v0.5.0) β€” rebond is now a list of jump hosts, even for a single hop. If you used the old map syntax, wrap it in a list:

# Before (v0.4.x)
rebond:
  host: "jump.example.com"
  user: "jump"

# After (v0.5.0+)
rebond:
  - host: "jump.example.com"
    user: "jump"

Configuration Breakdown

  • defaults: Global settings applied to all servers unless overridden.
    • mode: Default connection mode (direct, jump, or bastion).
    • theme: UI color theme β€” latte, frappe, macchiato, or mocha (default).
    • rebond: Jump host chain β€” a list of { host, user } entries. SSH receives -J user1@host1,user2@host2. Even a single hop must be written as a list item.
    • bastion: Bastion configuration (required when using bastion mode).
    • use_system_ssh_config: Set to true to honour ~/.ssh/config instead of passing -F /dev/null. Defaults to false.
    • probe_filesystems: List of extra mount points to inspect during the quick diagnostic (d). Uses additive inheritance: each level appends its paths to the parent list (unlike user or ssh_key which replace). If a path is not mounted on the target server a yellow ⚠ warning is shown instead of a progress bar.
  • groups: The top-level hierarchy. Can contain environments or direct servers.
    • Can override any default setting including mode.
  • environments: A sub-grouping under a Group.
    • Inherits from group and can override any setting.
  • servers: The actual connection endpoints.
    • Inherits all settings through the chain: defaults β†’ group β†’ environment β†’ server.
    • mode: Connection mode inherits but can be overridden at server level.

⌨️ Keybindings

Key Action
j / ↓ Move selection down
k / ↑ Move selection up
/ Enter search mode (search by name or hostname)
v Toggle verbose SSH mode (-v)
q Quit application
Space Toggle expand/collapse group
Enter Connect to server / Toggle group
Tab Cycle connection mode (Direct/Rebond/Bastion)
1 Select Direct mode
2 Select Rebond mode
3 Select Bastion mode
Ctrl+U Clear search query (while in search mode)
d Run quick SSH diagnostic (kernel, CPU, load, RAM, disk)
y Copy SSH command to clipboard
Esc Cancel search / dismiss error overlay

Mouse Support

  • Click: Select server or change tab
  • Double-click: Connect to selected server

πŸ–₯️ CLI Usage

Sushi can connect directly without opening the TUI:

# Connect directly
sushi --direct root@myserver
sushi --direct admin@10.0.1.5:2222

# Connect via jump host
sushi --rebond root@192.168.1.50

# Connect via bastion
sushi --bastion web-01.prod.example.com

# Override SSH parameters
sushi --direct myserver.com --user deploy --port 2222 --key ~/.ssh/deploy_rsa

# Use a custom config file
sushi --config ~/work/.sushi.yml

# Show all options
sushi --help

🎨 Theme & UI

Sushi uses the Catppuccin palette. Choose a flavor in your config:

defaults:
  theme: mocha   # latte | frappe | macchiato | mocha (default)

Color Scheme (Mocha)

  • Blue: Default borders
  • Sapphire: Active search border
  • Green: Successful search results, verbose mode active, environment headers
  • Red: No search results, error overlay border
  • Sky: Active connection mode tab, jump / bastion host in detail pane
  • Yellow: Port number when different from 22
  • Mauve: Group headers
  • Surface2: Selection background

UI Elements

  • Search Bar: Dynamic title showing result count ("πŸ” 45 / 387 servers")
  • Connection Modes: Tab interface with visual highlight
  • Verbose Toggle: Checkbox indicator (☐/β˜‘) with color feedback
  • Detail Pane: Port, mode, identity file, jump/bastion host, SSH options, and System block (kernel, CPU, load, RAM/Disk bars, plus extra mount points) after running d
  • Error Overlay: Centered popup for connection errors β€” press Enter to dismiss

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

πŸ“„ License

This project is licensed under the MIT License.

About

A modern, terminal-based SSH connection manager written in Rust. Features hierarchical configuration, jump hosts support, and a beautiful TUI powered by Ratatui. 🍣

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages