WWSync for VSCode
A VSCode extension port of the WWSync tool.
It allows you to synchronize your project with a remote server using rsync directly from VSCode, with safeguards against accidental deletions.
Features
- Safe Sync ($(cloud-upload)): Uploads files without deleting anything on the remote server.
- Full Sync ($(sync)): Mirrors the local folder to the remote, deleting extra files (with confirmation).
- Artifacts Download ($(cloud-download)): Downloads only new remote files into
.wwsync_<server>_artifacts. Changed remote files are listed as warning and are not downloaded.
- Run ($(terminal)): Opens an SSH session to the project folder.
- Interactive Auth: Handles password and key passphrase prompts with secure input and session-based caching.
User Interface
WWSync provides two ways to interact with your servers:
Status Bar:
- Displays the current connected server for the active file's directory (e.g.
WWSync: production).
- Click the status bar item to open a Reference Menu where you can run sync commands or switch the default server for the session.
- The server list is filtered to only show servers configured for the current workspace folder.
Title Bar Buttons:
- Quick access buttons in the editor title area for Safe Sync, Full Sync, Download Artifacts, and Run.
Configuration
You can customize the extension appearance in VSCode Settings:
wwsync.showButtons: Show/hide the buttons in the editor title bar (default: true).
wwsync.showStatusBar: Show/hide the status bar item (default: true).
Usage
- Open a folder in VSCode.
- Click the WWSync status bar item or title bar buttons to start.
- Config: The extension uses a
~/.wwsync config file. It will prompt you to create it if missing, or add a new server/mapping if none exists for the current directory.
Config Example
{
"servers": {
"production": {
"host": "user@example.com",
"mappings": [
{
"local": "/Users/dev/my-project",
"remote": "/var/www/html/api",
"excludes": [".git", "node_modules", ".env"],
"artifact_excludes": ["*.tmp", "*.cache", ".DS_Store"]
}
]
}
}
}
For full details on the underlying logic, see the original script.