DevPort
A lightweight VS Code extension to sync local workspace files with a remote server over SFTP.
No telemetry. No tracking. No accounts. Everything runs locally between your editor and your server.
Features
- SFTP: Connect — connect using
.vscode/sftp.json (auto-creates a template on first run)
- SFTP: Disconnect — close the active connection
- Upload File — upload the active or selected file
- Download File — download a file from the remote server
- Download Folder — recursively download a remote folder
- Sync Folder — upload only changed files (size / modification-time comparison)
- Delete Remote File — delete the remote copy of a file (with confirmation)
- Upload on Save — optionally upload files automatically when you save
- Upload Log — an SFTP Log view (in the Explorer) lists every uploaded
file with its time, action, and a
+added / -removed line summary. Click an
entry to open a diff of the previously uploaded version vs. the one you just
sent, so you can see exactly which lines changed.
- Automatic remote folder creation — parent directories are created as needed (
mkdir -p)
- Progress notifications — every long operation reports progress and can be cancelled
- Output logs — all activity is logged to the DevPort output channel
- Automatic reconnect — dropped connections are re-established with backoff and one retry
- Graceful error handling — failures are reported without crashing the editor
Requirements
- VS Code
1.75.0 or newer
- Node.js
18+ (for building)
- An SFTP-accessible server (password or private-key authentication)
Configuration
On first SFTP: Connect, a template is created at .vscode/sftp.json:
{
"host": "",
"port": 22,
"username": "",
"password": "",
"remotePath": "",
"privateKey": "",
"uploadOnSave": false,
"ignore": [".git", "node_modules", ".vscode/sftp.json"]
}
| Field |
Type |
Required |
Description |
host |
string |
yes |
Server hostname or IP |
port |
number |
no |
SFTP port (default 22) |
username |
string |
yes |
SSH username |
password |
string |
* |
Password auth. Required unless privateKey is set |
remotePath |
string |
yes |
Remote base directory that mirrors your workspace root |
privateKey |
string |
* |
Path to a private key file (absolute, or relative to the workspace root) |
passphrase |
string |
no |
Passphrase for an encrypted private key |
uploadOnSave |
boolean |
no |
Upload files automatically on save (default false) |
ignore |
string[] |
no |
Path fragments to skip during upload/sync |
* Provide either password or privateKey.
Path mapping
Local files map to remote paths by preserving their path relative to the
workspace root under remotePath. For example, with remotePath: "/var/www/app":
<workspace>/src/index.js -> /var/www/app/src/index.js
Security tip: add .vscode/sftp.json to your .gitignore if it contains
a password, so credentials are never committed.
Usage
- Open a workspace folder.
- Run SFTP: Connect from the Command Palette (
Ctrl+Shift+P). A config
template opens on first run — fill it in and run SFTP: Connect again.
- Right-click files/folders in the Explorer for Upload, Download,
Sync, and Delete actions, or run them from the Command Palette.
Build & Run
# Install dependencies
npm install
# Compile TypeScript -> out/
npm run compile
# Or watch mode during development
npm run watch
To run the extension in a development host:
- Open this folder in VS Code.
- Press
F5 (uses .vscode/launch.json → Run Extension).
- A new Extension Development Host window opens with DevPort loaded.
Package a .vsix
npm install -g @vscode/vsce
vsce package
This produces harshkajale-syncfiles-1.0.0.vsix (displayName DevPort), installable via
Extensions → … → Install from VSIX.
Architecture
src/
extension.ts Command registration, VS Code wiring, upload-on-save, progress UI
config.ts Load / validate / template .vscode/sftp.json
sftp.ts SftpManager: connection lifecycle, reconnect, file operations
sync.ts Folder walking, changed-only sync, recursive download
history.ts UploadHistory: snapshots + line-diff of each uploaded file
logView.ts SftpLogProvider: the "SFTP Log" tree view
statusBar.ts Connection-state status-bar indicator
utils.ts Logger/OutputChannel, path mapping, ignore matching, helpers
Upload snapshots for the log are kept in the extension's own global storage
(namespaced per workspace) — never inside your project and never uploaded.
Each module has a single responsibility; extension.ts orchestrates the others
and owns all VS Code API interaction.
License
MIT — see LICENSE.