SX.Client 1.0.4

There is a newer version of this package available.
See the version list below for details.
dotnet tool install --global SX.Client --version 1.0.4
                    
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.Client --version 1.0.4
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=SX.Client&version=1.0.4
                    
nuke :add-package SX.Client --version 1.0.4
                    

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

Prerequisites

SX 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

1. Install SX

Option A: Via .NET Tool

# Install globally via .NET tool
# On your local workstation:
dotnet tool install -g SX.Server
# On remote servers:
dotnet tool install -g SX.Client

Option B: Via Snap

# Install the packages
sudo snap install sx-client
sudo snap install sx-server

# Create command aliases (one-time setup)
sudo snap alias sx-client.sxd sxd
sudo snap alias sx-client.sxu sxu
sudo snap alias sx-client.sxls sxls

Option C: Build from Source

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. Setup Convenient Commands

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'

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

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

🗑️ Uninstall

# 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)

📋 Requirements

  • .NET 9.0 or later
  • 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

  • 🔄 v1.0.3: 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 net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  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.5 135 7/2/2025
1.0.4 133 6/24/2025
1.0.3 131 6/23/2025
1.0.2 93 6/22/2025
1.0.1 65 6/21/2025
1.0.0 62 6/21/2025

Initial release of SX - SSH File Transfer System with tab completion and beautiful UI.