XDS is a command-line tool written in Go for quickly managing SSH server connections and file transfers. It reads your local ~/.ssh/config configuration, allowing you to quickly upload and download files without typing complete scp commands every time.
- 📋 List Servers: Automatically reads
~/.ssh/configand lists all configured servers - ⚙️ Set Default Server: Set a default server for subsequent operations
- ⬆️ Quick Upload: One-click file upload to specified server directory
- ⬇️ Quick Download: One-click file download from server to local
- 🔐 Auto Authentication: Supports SSH key and SSH agent automatic authentication
- 📊 Progress Display: Real-time display of transfer progress, speed, and remaining time
- 🎯 Smart Path: Automatically detects directories, similar to
scpbehavior - 🔄 Rsync Integration: Sync files using rsync with resume capability
cd xds
makeThe compiled binary will be located at bin/xds.
make installThis will install xds to /usr/local/bin/.
xds listThis displays all servers configured in ~/.ssh/config and marks the current default server (if any).
Example output:
Configured servers:
* [1] aliyun_DSW3
Address: example.com
User: root
Port: 22
Key: ~/.ssh/id_rsa
[2] test_server
Address: test.example.com
User: admin
Default server: aliyun_DSW3 (use 'xds set <server>' to change)
xds set <server_name>Example:
xds set aliyun_DSW3After setting, subsequent upload, download, and sync commands will automatically use this default server if -s flag is not specified.
xds upload <local_file_path> <remote_file_path>Using default server:
xds upload ./test.txt /data/test.txtUpload to directory (automatically uses filename):
xds upload ./test.txt /data/
# Automatically uploads to /data/test.txt with progress barSpecify server (temporarily override default):
xds upload -s test_server ./test.txt /data/test.txtProgress display example:
Uploading test.txt [===================> ] 65% | 3.2 MB/5.0 MB | 1.5 MB/s | 1s
xds download <remote_file_path> <local_file_path>Using default server:
xds download /data/test.txt ./test.txtDownload to current directory (automatically uses remote filename):
xds download /data/test.txt .Specify server:
xds download -s test_server /data/test.txt ./test.txtxds sync <local_path> <remote_path>Basic sync:
xds sync ./local_dir /remote/dirSync with options:
# Dry run (preview what will be transferred)
xds sync --dry-run ./local /remote/
# Delete extraneous files from destination
xds sync --delete ./local /remote/
# Exclude patterns
xds sync --exclude "*.log" --exclude "*.tmp" ./local /remote/
# Bandwidth limiting
xds sync --limit 1m ./large_dir /remote/dir
# Verbose output
xds sync -v ./local /remote/Note: The sync command uses rsync, which must be installed on your system:
- macOS:
brew install rsync - Ubuntu/Debian:
sudo apt-get install rsync - CentOS/RHEL:
sudo yum install rsync
XDS reads the ~/.ssh/config file to get server configurations. Ensure your SSH configuration format is correct:
Host aliyun_DSW3
HostName example.com
User root
Port 22
IdentityFile ~/.ssh/id_rsa
Important Notes:
- The name after
Hostis the server name you use in XDS IdentityFileis optional; if not specified, XDS will try to use SSH agent- Ensure your SSH key has been added to the target server or SSH agent is configured
XDS saves your default server setting in ~/.xds/config.json:
{
"default_server": "aliyun_DSW3"
}# 1. View all servers
xds list
# 2. Set default server
xds set aliyun_DSW3
# 3. Upload file
xds upload ./myfile.txt /data/myfile.txt
# 4. Download file
xds download /data/result.txt ./result.txt
# 5. Sync directory
xds sync ./local_project /remote/project
# 6. Temporarily use another server for upload
xds upload -s test_server ./test.txt /tmp/test.txt- If no default server is set and
-sflag is not used, XDS will prompt you to set a default server - If server configuration doesn't exist, XDS will display an error and suggest using
xds listto view available servers - If SSH connection fails, check your SSH configuration and network connection
- If authentication fails, ensure your SSH key is correctly configured or SSH agent is running
xds/
├── cmd/
│ └── xds/
│ └── main.go # Main program entry
├── pkg/
│ ├── config/ # Configuration management
│ │ └── config.go
│ ├── ssh/ # SSH configuration parsing
│ │ └── sshconfig.go
│ ├── sftp/ # SFTP file transfer
│ │ └── sftp.go
│ ├── rsync/ # Rsync integration
│ │ └── rsync.go
│ └── transfer/ # Transfer utilities (resume, sync)
│ ├── resume.go
│ └── sync.go
├── Makefile # Build script
├── go.mod # Go module definition
└── README.md # This document
github.com/alecthomas/kingpin/v2- Command-line argument parsinggithub.com/pkg/sftp- SFTP clientgolang.org/x/crypto/ssh- SSH clientgithub.com/schollz/progressbar/v3- Progress bar display
See ROADMAP.md for planned features including:
- Resume interrupted transfers
- Batch operations
- Remote command execution
- Directory operations
- And more...
MIT License
Welcome to submit Issues and Pull Requests!