Show HN: SX – Transfer files from within SSH sessions without reconnecting
6 hours ago
2
SX (SSH eXchange) is a modern, cross-platform file transfer system that enables seamless file transfers between remote SSH sessions and local machines without requiring separate connections or re-authentication.
🚀 Blazing Fast - Native .NET performance with progress bars
🔒 Secure - Uses SSH reverse tunnels for encrypted transfers
🌐 Cross-Platform - Works on Windows, Linux, and macOS
📊 Beautiful UI - Rich console output with progress indicators and file tables
🎯 Simple - Just three commands: sxd (download), sxu (upload), sxls (list)
The setup scripts are included with the client package:
For Bash/Zsh:
# From the packagesource~/.dotnet/tools/.store/sx.client/1.x.x/sx.client/1.x.x/scripts/setup-sx-commands.sh
# Or download from GitHub if you prefer
curl -sL https://raw.githubusercontent.com/Memphizzz/SX/main/setup-sx-commands.sh | bash
For Fish Shell:
# From the packagesource~/.dotnet/tools/.store/sx.client/1.x.x/sx.client/1.x.x/scripts/setup-sx-fish.fish
# Or download from GitHub
curl -sL https://raw.githubusercontent.com/Memphizzz/SX/main/setup-sx-fish.fish | fish
Or manually create aliases:
# Add to your shell config (.bashrc, .zshrc, etc.)alias sxd='~/.dotnet/tools/sx sxd'alias sxu='~/.dotnet/tools/sx sxu'alias sxls='~/.dotnet/tools/sx sxls'
# Start SX server to serve files from a directory
dotnet run --project SX.Server -- --dir ~/Downloads
# Connect to remote server with reverse tunnel
ssh -R 53690:localhost:53690 user@remote-server
# List files with beautiful table (generates completion cache)
sxls
# Enable tab completion (first time only, after running sxls)source~/.sx/sx_completion.bash # or .fish for fish shell# Download files (with tab completion!)
sxd <TAB># Shows available files
sxd largefile.zip
# Upload files (shell handles local completion)
sxu mylocal.txt
Command
Description
Example
sxls [path]
List files and directories
sxls, sxls projects/
sxd <remote> [local]
Download file from server
sxd file.pdf, sxd data.csv backup.csv
sxu <local>
Upload file to server
sxu document.pdf
SX includes intelligent shell completion that updates automatically:
Run sxls - Updates completion cache with current server files
Press TAB - Get smart completions:
sxd <TAB> - Complete with downloadable files
sxls <TAB> - Complete with directories
Setup completion (one-time):
# Bashecho"source ~/.sx/sx_completion.bash">>~/.bashrc
# Fish echo"source ~/.sx/sx_completion.fish">>~/.config/fish/config.fish
dotnet run --project SX.Server -- [options]
Options:
-p, --port <port> Port to listen on (default: 53690)
-d, --dir <path> Directory to serve (default: ~/Downloads)
--max-size <size> Maximum file size (default: 10GB)
--no-overwrite Don't overwrite existing files -h, --help Show help
# Custom server port and directory
dotnet run --project SX.Server -- --port 9999 --dir /data/shared
# With size limits
dotnet run --project SX.Server -- --max-size 1GB --no-overwrite
# Client using custom portexport SX_PORT=9999
sxd file.txt # Client connects to port 9999
┌─────────────────┐ SSH Tunnel ┌─────────────────┐
│ Remote Server │◄─────────────────┤ Local Machine │
│ │ │ │
│ sxd/sxu/sxls │ Port 53690 │ SX.Server │
│ (SX.Client) │ │ │
└─────────────────┘ └─────────────────┘
SX.Core - Core library with protocol, file handling, and utilities
SX.Server - Server executable (local machine)
SX.Client - Client commands (remote machine via SSH)
Protocol - JSON-based communication over TCP
dotnet build
dotnet build --configuration Release
# Start server
dotnet run --project SX.Server -- --dir ./test-files
# Test client (in another terminal)
dotnet run --project SX.Client -- sxls
dotnet run --project SX.Client -- sxd testfile.txt
This software is provided "as is" for development and productivity purposes. While designed with security in mind through SSH tunnels, users are responsible for:
Ensuring secure SSH configurations
Validating file transfer permissions
Implementing appropriate access controls
Compliance with organizational security policies
Use in production environments is at your own discretion and risk.