Skip to main content

Command Line Tool to use ssh simply

Project description

ussh - Smart SSH Connection Manager

A powerful command-line tool for managing SSH connections with smart tab completion.

Features

  • Smart SSH Management: Store and manage SSH connection configurations
  • Tab Completion: Intelligent tab completion for all commands and stored aliases
  • Secure: Encrypted storage for sensitive information
  • Tunneling: Support for local and remote port forwarding
  • Proxy Jump: Built-in support for bastion hosts

Installation

uv tool install ussh

Tab Completion Setup

Automatic Setup (Recommended)

Simply run the activate command:

ussh activate completion

This will:

  1. Auto-detect your shell (Bash, Zsh, or Fish)
  2. Generate appropriate completion files
  3. Configure your shell to load completions
  4. Provide instructions for immediate activation

Options:

  • --shell: Specify shell manually (bash/zsh/fish)
  • --force: Force reinstall even if already configured

Check Activation Status

ussh activate status

This shows:

  • Shell completion configuration status
  • Current shell detection
  • Installation status
  • Configuration statistics

Manual Setup

For advanced users who want manual control:

Bash

_USSH_COMPLETE=bash_source ussh > ~/.ussh-complete.bash
echo 'source ~/.ussh-complete.bash' >> ~/.bashrc
source ~/.bashrc

Zsh

mkdir -p ~/.zsh/completion
_USSH_COMPLETE=zsh_source ussh > ~/.zsh/completion/_ussh
echo 'fpath+=~/.zsh/completion' >> ~/.zshrc
echo 'autoload -Uz compinit && compinit' >> ~/.zshrc
source ~/.zshrc

Fish

mkdir -p ~/.config/fish/completions
_USSH_COMPLETE=fish_source ussh > ~/.config/fish/completions/ussh.fish

Tab Completion Features

Smart Alias Completion

  • Environment completion: ussh connect <TAB> shows all saved environments
  • Host completion: ussh add env -h <TAB> shows all saved hosts
  • Port completion: ussh add env -p <TAB> shows saved ports and common ports
  • Username completion: ussh add env -u <TAB> shows all saved usernames
  • Keypair completion: ussh add env -k <TAB> shows all saved keypairs
  • Proxy completion: ussh add env -j <TAB> shows environments suitable for proxy jump

Enhanced Smart Matching

  • Substring matching: Type any part of an alias to find matches
  • Smart scoring: Results are sorted by relevance:
    • Exact matches: Highest priority
    • Prefix matches: High priority (e.g., devdev-server)
    • Word boundary matches: Medium priority (e.g., serverdev-server)
    • Substring matches: Low priority (e.g., datadatabase-primary)
  • Multi-field search: For environments, searches across alias, host, username, and IP address

Context-Aware Suggestions

  • Completions are intelligently filtered based on any substring match
  • Help text shows relevant information (e.g., host address for host aliases)
  • Only valid options are suggested (e.g., only key-authenticated environments for proxy)

Usage Examples

Add Components

# Add a host
ussh add host -v 192.168.1.100 -l dev-server

# Add a username
ussh add user -v ubuntu -l ubuntu-user

# Add a keypair
ussh add keypair -p ~/.ssh/id_rsa -l dev-key

# Create an environment
ussh add env -h dev-server -u ubuntu-user -k dev-key -l dev-env

Connect to Environment

# Connect using stored environment (with tab completion!)
ussh connect dev-env

# Use tab to see all available environments
ussh connect <TAB>

Manage Tunnels

# Create local tunnel (with tab completion for environment and host)
ussh tunnel local -e dev-env -L 3306 -H db-server -R 3306

# List and manage active tunnels
ussh tunnel manage

Search and List

# List all stored information
ussh list

# Search for specific items
ussh find -q dev

# List specific component type
ussh list host

Advanced Features

Proxy Jump Support

Configure environments to use other environments as jump hosts:

ussh add env -h prod-server -u deploy -k prod-key -j bastion-env -l prod-env

Password and Key Authentication

Supports both password and key-based authentication:

# Password authentication
ussh add pwd -v mypassword -l prod-pass
ussh add env -h server -u user -w prod-pass -l pwd-env

# Key authentication (recommended)
ussh add kp -p ~/.ssh/id_rsa -l my-key
ussh add env -h server -u user -k my-key -l key-env

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ussh-0.2.2.tar.gz (20.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ussh-0.2.2-py3-none-any.whl (23.6 kB view details)

Uploaded Python 3

File details

Details for the file ussh-0.2.2.tar.gz.

File metadata

  • Download URL: ussh-0.2.2.tar.gz
  • Upload date:
  • Size: 20.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.3

File hashes

Hashes for ussh-0.2.2.tar.gz
Algorithm Hash digest
SHA256 d3e277f92491483fabaa33cc03fa9fa5f4f528f241e2e54ae97b2d362ab96dbb
MD5 986361bb8ee6fa4bf8c0b5eefef2feff
BLAKE2b-256 1ad0287b6ebca1c63d1ae9f24dd0dcb02e3f6b5e320e5b8912c4d064419435e9

See more details on using hashes here.

File details

Details for the file ussh-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: ussh-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 23.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.3

File hashes

Hashes for ussh-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 03355006fef5526266aecad2ba35965d40dbc1f7d2cbab6642a3c25603bc6cca
MD5 f4965b55eb8a3ef05c55a307409770a3
BLAKE2b-256 0ed2d625b8b3023bbca76087dd12e6a26428bd8fef7fe419ddfb72b5ec23c25b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page