SX (SSH eXchange) - Modern cross-platform file transfer system using SSH tunnels. Simple commands: sxd (download), sxu (upload), sxls (list). Features beautiful progress bars, tab completion, and secure transfers.
$ dotnet add package SX.ClientSX (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.
sxd (download), sxu (upload), sxls (list)Setup: SX.Server runs on your local workstation, SX.Client runs on remote servers you SSH into.
Workflow:
sx-server on your workstationssh -R 53690:localhost:53690 user@serversxd filename (download from workstation), sxu filename (upload to workstation), sxls (list workstation files)Note: All commands below are run from within your SSH session on the remote server. From this perspective, "download" means getting files from your local workstation, and "upload" means sending files back to your workstation.
# List files from your local workstation
$ sxls
┌──────┬─────────────────┬──────────┬──────────────┐
│ Type │ Name │ Size │ Modified │
├──────┼─────────────────┼──────────┼──────────────┤
│ DIR │ projects │ - │ 2h ago │
│ FILE │ presentation.pdf│ 2.4 MB │ yesterday │
│ FILE │ data.csv │ 156.7 KB │ 3d ago │
└──────┴─────────────────┴──────────┴──────────────┘
# Download 'presentation.pdf' from your local workstation
$ sxd presentation.pdf
📥 Downloading: presentation.pdf (2.4 MB)
████████████████████████████████████████ 100% | 2.4 MB/s | 00:00:01
# Upload from remote machine to your workstation
$ sxu myfile.txt
📤 Uploading: myfile.txt (45.2 KB)
████████████████████████████████████████ 100% | 1.2 MB/s | 00:00:01
✅ Upload completed successfully!
Option A: Via Snap
# On your local workstation:
sudo snap install sx-server --classic
# On remote servers:
sudo snap install sx-client --classic
# Create command aliases (one-time setup on remote servers):
# Note: Auto-aliases are pending approval - these commands will be automatic soon!
sudo snap alias sx-client.sxd sxd
sudo snap alias sx-client.sxu sxu
sudo snap alias sx-client.sxls sxls
Option B: Via .NET Tool
This option requires .NET 9.0 or later. If you don't have it installed:
Ubuntu/Debian:
# Ubuntu 24.10
sudo apt update && sudo apt install dotnet-sdk-9.0
# Ubuntu 24.04, 22.04, 20.04 (requires backports PPA)
sudo add-apt-repository ppa:dotnet/backports
sudo apt update && sudo apt install dotnet-sdk-9.0
Other Linux/macOS/Windows:
See Microsoft's .NET 9 installation guide
Verify installation:
dotnet --version # Should show 9.x.x
Install via .NET tool:
# On your local workstation:
dotnet tool install -g SX.Server
# On remote servers:
dotnet tool install -g SX.Client
Option C: Build from Source
Note: Requires .NET 9.0 SDK
git clone https://github.com/Memphizzz/sx
cd sx
dotnet pack SX.Server --configuration Release --output ./packages
dotnet tool install --global --add-source ./packages SX.Server
The setup scripts are included with the client package:
For Bash/Zsh:
# From the package
source ~/.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 package
source ~/.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
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:
sxls - Updates completion cache with current server filessxd <TAB> - Complete with downloadable filessxls <TAB> - Complete with directoriesSetup completion (one-time):
# Bash
echo "source ~/.sx/sx_completion.bash" >> ~/.bashrc
# Fish
echo "source ~/.sx/sx_completion.fish" >> ~/.config/fish/config.fish
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
sx-server --port 9999 --dir /data/shared
# With size limits
sx-server --max-size 1GB --no-overwrite
# Client using custom port
export 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) │ │ │
└─────────────────┘ └─────────────────┘
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
ssh -R 53690:localhost:53690 user@server# Use different port
dotnet run --project SX.Server -- --port 9999
export SX_PORT=9999
ssh -R 9999:localhost:9999 user@server
# Regenerate completion
rm -rf ~/.sx/
sxls # Regenerates completion files
# Re-source completion
source ~/.sx/sx_completion.bash
If you prefer manual setup:
Create wrapper scripts:
mkdir -p ~/.local/bin
# Download command
echo '#!/bin/bash
exec ~/.dotnet/tools/sx sxd "$@"' > ~/.local/bin/sxd
chmod +x ~/.local/bin/sxd
# Upload command
echo '#!/bin/bash
exec ~/.dotnet/tools/sx sxu "$@"' > ~/.local/bin/sxu
chmod +x ~/.local/bin/sxu
# List command
echo '#!/bin/bash
exec ~/.dotnet/tools/sx sxls "$@"' > ~/.local/bin/sxls
chmod +x ~/.local/bin/sxls
# Add to PATH
export PATH="$HOME/.local/bin:$PATH"
Fish shell functions:
mkdir -p ~/.config/fish/functions
echo 'function sxd --description "SX Download - Get file from server"
~/.dotnet/tools/sx sxd $argv
end' > ~/.config/fish/functions/sxd.fish
echo 'function sxu --description "SX Upload - Send file to server"
~/.dotnet/tools/sx sxu $argv
end' > ~/.config/fish/functions/sxu.fish
echo 'function sxls --description "SX List - List files on server"
~/.dotnet/tools/sx sxls $argv
end' > ~/.config/fish/functions/sxls.fish
# Remove tool
dotnet tool uninstall -g SX.Client
# Remove wrapper scripts
rm -f ~/.local/bin/sxd ~/.local/bin/sxu ~/.local/bin/sxls
# Remove completion
rm -rf ~/.sx/
# Remove shell config additions (manual cleanup)
This project is licensed under the MIT License - see the LICENSE file for details.
Made with ❤️ for seamless SSH file transfers
This software is provided "as is" for development and productivity purposes. While designed with security in mind through SSH tunnels, users are responsible for:
Use in production environments is at your own discretion and risk.