SX.Client 1.0.0

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.0
                    
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.0
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=SX.Client&version=1.0.0
                    
nuke :add-package SX.Client --version 1.0.0
                    

SX - SSH File Transfer System

.NET 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

🎬 Quick Demo

# List files on remote server with beautiful table
$ 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 with tab completion and progress
$ sxd presentation.pdf
📥 Downloading: presentation.pdf (2.4 MB)
████████████████████████████████████████ 100% | 2.4 MB/s | 00:00:01

# Upload local files
$ 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

# Install globally via .NET tool
dotnet tool install -g SX.Client

# Or build from source
git clone https://github.com/Memphizzz/sx
cd sx
dotnet pack SX.Client --configuration Release --output ./packages
dotnet tool install --global --add-source ./packages SX.Client

2. Setup Convenient Commands

For Bash/Zsh:

./setup-sx-commands.sh

For Fish Shell:

./setup-sx-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
dotnet run --project SX.CLI -- --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

dotnet run --project SX.CLI -- [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
dotnet run --project SX.CLI -- --port 9999 --dir /data/shared

# With size limits
dotnet run --project SX.CLI -- --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     │
│   (client)      │                  │    (SX.CLI)     │
└─────────────────┘                  └─────────────────┘
  • SX.Core - Core library with protocol, file handling, and utilities
  • SX.CLI - 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.CLI -- --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.CLI -- --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)

🤝 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 143 7/2/2025
1.0.4 139 6/24/2025
1.0.3 138 6/23/2025
1.0.2 100 6/22/2025
1.0.1 72 6/21/2025
1.0.0 69 6/21/2025

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