SX.Server 1.0.7

dotnet tool install --global SX.Server --version 1.0.7
                    
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
                    
if you are setting up this repo
dotnet tool install --local SX.Server --version 1.0.7
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=SX.Server&version=1.0.7
                    
nuke :add-package SX.Server --version 1.0.7
                    

SX - SSH File Transfer System

.NET NuGet Client NuGet Server Snap License Platform

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.

✨ Features

  • 🚀 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)
  • ⚡ Tab Completion - Smart shell completion for remote file paths
  • 📁 Directory Browsing - Explore remote directories with file sizes and dates
  • 🎨 No Dependencies - Self-contained executables

🎯 How It Works

Setup: SX.Server runs on your local workstation, SX.Client runs on remote servers you SSH into.

Workflow:

  1. Start sx-server on your workstation
  2. SSH with reverse tunnel: ssh -R 53690:localhost:53690 user@server
  3. From within your SSH session, use: sxd filename (download from workstation), sxu filename (upload to workstation), sxls (list workstation files)

🎬 Quick Demo

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!

🚀 Quick Start

1. Install SX

Every install path ends with the same command: sx setup on remote servers, sx-server setup on your workstation. No sudo, no shell-specific scripts.

  • sx setup installs the sxd/sxu/sxls commands into ~/.local/bin and writes the shell completion scripts.
  • sx-server setup only places the sx-server binary in ~/.local/bin — the server is a single command, so it has no wrappers or completions of its own.

Both are no-ops when the command already runs from a managed location such as a .NET tool install.

Option A: Standalone Binary (recommended for remote servers)

Self-contained — no .NET runtime needed on the remote box.

# On remote servers (pick your arch: linux-x64 or linux-arm64):
curl -sL https://github.com/Memphizzz/SX/releases/latest/download/sx-linux-x64.tar.gz | tar xz
./sx setup

# On your local workstation:
curl -sL https://github.com/Memphizzz/SX/releases/latest/download/sx-server-linux-x64.tar.gz | tar xz
./sx-server setup

setup copies the binary into ~/.local/bin, so you can delete the download afterwards.

Option B: Via Snap

# On your local workstation:
sudo snap install sx-server --classic

# On remote servers:
sudo snap install sx-client --classic
sx-client.sx setup

Snapd exposes the client as sx-client.sxd/.sxu/.sxls; setup installs the short names into ~/.local/bin pointing back at the snap.

Option C: Via .NET Tool

Prerequisites

This option requires .NET 10.0 or later. If you don't have it installed:

Ubuntu/Debian:

# Ubuntu 24.10
sudo apt update && sudo apt install dotnet-sdk-10.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-10.0

Other Linux/macOS/Windows:
See Microsoft's .NET 10 installation guide

Verify installation:

dotnet --version  # Should show 10.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
sx setup

Option D: Build from Source

Note: Requires .NET 10.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

2. Enable Tab Completion

sx setup writes the completion scripts; source them from your shell config:

# Bash — add to ~/.bashrc
source ~/.sx/sx_completion.bash

# Fish — add to ~/.config/fish/config.fish
source ~/.sx/sx_completion.fish

# Zsh — add to ~/.zshrc (the script uses bash's completion builtins)
autoload -U bashcompinit && bashcompinit
source ~/.sx/sx_completion.bash

If setup warned that ~/.local/bin is not on your PATH, add that too:

export PATH="$HOME/.local/bin:$PATH"   # bash
fish_add_path ~/.local/bin             # fish

3. Start Local Server

# Start SX server to serve files from a directory
sx-server --dir ~/Downloads

4. Create SSH Tunnel

# Connect to remote server with reverse tunnel
ssh -R 53690:localhost:53690 user@remote-server

5. Use on 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

📖 Commands

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

🎯 Tab Completion

SX includes intelligent shell completion that updates automatically:

  1. Run sxls - Updates completion cache with current server files
  2. Press TAB - Get smart completions:
    • sxd <TAB> - Complete with downloadable files
    • sxls <TAB> - Complete with directories

Setup completion (one-time):

# Bash
echo "source ~/.sx/sx_completion.bash" >> ~/.bashrc

# Fish  
echo "source ~/.sx/sx_completion.fish" >> ~/.config/fish/config.fish

⚙️ Configuration

Server Options

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

Examples

# 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

🏗️ Architecture

┌─────────────────┐    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

🛠️ Development

Build

dotnet build
dotnet build --configuration Release

Local Development

# 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

🔧 Troubleshooting

Connection refused

  1. Check if SX server is running locally
  2. Verify SSH tunnel: ssh -R 53690:localhost:53690 user@server
  3. Check firewall settings
  4. Try different port if conflicts occur

Port conflicts

# Use different port
dotnet run --project SX.Server -- --port 9999
export SX_PORT=9999
ssh -R 9999:localhost:9999 user@server

Completion not working

# Regenerate completion
rm -rf ~/.sx/
sxls  # Regenerates completion files

# Re-source completion
source ~/.sx/sx_completion.bash

📜 Manual Installation

setup is the supported path, but the wrappers it writes are three-line shell scripts — there is nothing magic to reproduce by hand:

mkdir -p ~/.local/bin

for cmd in sxd sxu sxls; do
    printf '#!/bin/sh\nexec /path/to/sx %s "$@"\n' "$cmd" > ~/.local/bin/$cmd
    chmod +x ~/.local/bin/$cmd
done

export PATH="$HOME/.local/bin:$PATH"

Point /path/to/sx at wherever the binary lives — the extracted tarball, ~/.dotnet/tools/sx, or /snap/bin/sx-client.sx.

🗑️ Uninstall

Run setup --uninstall before removing the underlying install, otherwise the wrappers are left pointing at a binary that no longer exists. It removes only what setup recorded creating.

# Remote server — use whichever command your install provides
sx setup --uninstall              # binary or .NET tool
sx-client.sx setup --uninstall    # snap

# Local workstation
sx-server setup --uninstall

# Then remove the install itself
dotnet tool uninstall -g SX.Client   # .NET tool
sudo snap remove sx-client           # snap
rm ~/.local/bin/sx                   # standalone binary (if setup did not already)

# Shell config lines sourcing ~/.sx need manual cleanup

📋 Requirements

  • .NET 10.0 or later (only for .NET Tool installation or building from source; Snap packages bundle everything)
  • SSH 2.0 or later (for reverse port forwarding support)

🚧 Known Issues & Planned Features

Known Issues

  • Upload disconnection detection: Server detects client disconnections during upload with ~1 second delay

Planned Features

  • 🔄 1.0.10: Multiple simultaneous client support with request queuing
  • 🔄 Future: Resume interrupted transfers
  • 🔄 Future: Directory synchronization

🤝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

🙏 Acknowledgments


Made with ❤️ for seamless SSH file transfers

Disclaimer

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.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last Updated
1.0.7 0 7/28/2026
1.0.6 95 7/18/2026
1.0.5 369 7/2/2025
1.0.4 324 6/24/2025
1.0.3 306 6/23/2025
1.0.2 283 6/22/2025
1.0.1 249 6/21/2025
1.0.0 253 6/21/2025

Initial release of SX Server - SSH File Transfer Server component.