DeployPilot — SFTP/FTP/Rsync Deployment
中文 · English
中文
DeployPilot 把常用的部署动作放进 VS Code:改完代码直接上传,随时下载。不用在 VS Code 和 FTP/SFTP 客户端之间来回切换。
支持 SFTP、FTP 以及 SFTP 服务器上的 Rsync 模式,支持多服务器、多项目目录、并发传输和实时进度。
核心亮点
- 在 VS Code 里完成上传和下载,不用切换 FTP/SFTP 客户端。
- 多服务器、多项目目录配置,状态栏一眼看到当前部署目标。
- 可选 Rsync 模式,利用系统
rsync 做高效传输。
- 自动上传、并发传输与实时进度。
功能说明
连接与服务器管理
- 全局服务器:保存连接信息(协议、主机、端口、账号、密码或私钥),所有项目共用。
- 项目服务器:为当前项目选择一台全局服务器,再设置远程目录、文件权限、目录权限、所有者和忽略项。
- 协议独立标识:每台服务器有独立的
protocol 字段(sftp / ftp),不靠端口猜协议;端口可以自定义。
- 测试连接:保存前可以直接验证账号和网络是否可用。
- 浏览远程目录:绑定项目时可以从服务器真实目录中选择远程根目录。
- Rsync 模式:SFTP 服务器可勾选「使用 rsync 进行上传和下载」,传输改由本机
rsync over SSH 执行;FTP 模式不显示该选项。
上传与下载
- 标题栏的上传图标:上传当前文件到默认服务器。
- 命令面板:上传到默认服务器、上传到指定服务器、上传所有打开的文件、从默认服务器下载、下载自指定服务器。
- 资源管理器 / 源代码管理右键:在文件或文件夹上使用「部署」子菜单。
- 上传到默认服务器 / 从默认服务器下载:直接用默认服务器,不再询问。
- 上传到指定服务器… / 下载自指定服务器…:先选择服务器。
- 配置…:打开服务器配置面板。
- 状态栏常驻显示默认服务器名称和
IP:端口(例如 demo · 127.0.0.1:22),鼠标悬停可看远程目录;传输完成后的提示也会带上 名称(IP:端口)。
- 支持单文件和整个目录;目录会递归上传/下载。
- 上传始终覆盖线上同名文件,不会因为线上已存在而跳过或失败。线上旧文件只读、当前账号没有写权限导致直接覆盖失败时,会自动删除旧文件再重传一次(需要目录可写)。
- 单文件上传前会先检查线上是否已有同名文件:已有则提示「已覆盖」,否则提示「已上传」。
- 状态栏显示传输进度:
- 目录:已完成文件数 / 总数 + 当前文件名
- FTP 单文件:百分比 + 已传 / 总大小
- SFTP 单文件:文件名和传输状态
- 目录传输支持并发,默认同时传 4 个文件,可通过
deploy.transferConcurrency 调整。
- 启用 Rsync 的 SFTP 服务器:上传和下载走
rsync,状态栏显示已传输文件数;可用「Rsync 设置」调整可执行文件路径、选项和 SSH 可执行文件。
- 输出面板「DeployPilot」记录每次上传、下载和错误。
自动上传
off:关闭。
onSave:保存文件时上传。
always:文件内容变化后按防抖延迟上传,适合边写边部署。
- 工具栏的自动上传开关会在
always / off 之间切换,并显示当前状态。
权限处理
- SFTP 上传后可以按项目设置执行
chmod / chown。
- FTP 不支持
chown,FTP 模式会自动跳过权限设置。
- Rsync 模式下权限由 Rsync 选项控制;默认
-zar 不做逐文件 chown / chmod,如需统一属主/权限请在服务器端单独执行一次。
Rsync 设置
通过命令面板的 Rsync 设置...、资源管理器的「部署 → Rsync 设置...」打开设置页:
- Rsync 可执行文件路径:默认
rsync(依赖 PATH)。
- Rsync 选项:默认
-zar,逗号分隔,例如 -zar,--whole-file,--omit-dir-times。
- Shell 可执行文件路径:默认
ssh,可带参数。
- 测试连接:验证本机 rsync 和 ssh 可执行文件可用。
- 恢复默认设置:恢复上述三个默认值。
- Rsync 选项列表:打开
https://download.samba.org/pub/rsync/rsync.1。
- 设置保存到用户配置;若以前保存过旧值,新默认值不会覆盖,需手动修改或点「恢复默认设置」。
使用说明
第一步:添加全局服务器
- 打开左侧「远程主机」视图。
- 点击标题栏齿轮,或运行命令
配置...。
- 点击「新增全局服务器」。
- 填写连接信息:
- 名称:自定义,例如
demo
- 协议:
SFTP 或 FTP
- 主机:例如
127.0.0.1
- 端口:SFTP 默认
22,FTP 默认 21,可自定义
- 用户名 / 密码
- SFTP 也可以选择私钥文件
- SFTP 可勾选「使用 rsync 进行上传和下载」;FTP 模式不显示该选项
- 点击「测试连接」确认可用,然后保存。
第二步:绑定项目服务器
- 打开需要部署的项目文件夹。
- 在「远程主机」视图标题栏点击列表图标,或运行命令
项目服务器管理。
- 点击「添加项目服务器」。
- 选择刚才创建的全局服务器,填写或浏览选择远程目录。
- 按需设置文件权限、目录权限、所有者和属组;FTP 模式会跳过这些权限设置。
- 设置忽略项,例如
.git, node_modules, .vscode, *.log。
- 保存后可以在服务器节点右键「设为默认服务器」。
第三步:日常部署
- 上传当前文件:点击标题栏上传图标。
- 上传到其他服务器:命令面板运行
上传到...,或右键文件选择「部署 → 上传到指定服务器…」。
- 下载:命令面板运行
下载自...,或右键文件选择「部署 → 下载自指定服务器…」。
- 自动上传:点击工具栏的「自动上传:开 / 关」,或在设置中修改
deploy.autoUpload。
配置参考
全局服务器
{
"deploy.servers": [
{
"name": "demo",
"protocol": "sftp",
"host": "127.0.0.1",
"port": 22,
"username": "www",
"password": "your-password",
"useRsync": true
}
]
}
| 字段 |
说明 |
name |
服务器名称,项目绑定时引用 |
protocol |
sftp 或 ftp,默认 sftp |
host / port / username |
连接信息;SFTP 默认 22,FTP 默认 21 |
password / privateKeyPath / passphrase |
认证信息;FTP 使用密码,SFTP 支持密码或私钥 |
useRsync |
是否对该 SFTP 服务器启用 rsync 模式,默认 false;FTP 模式忽略 |
项目服务器
{
"deploy.projectServers": [
{
"server": "demo",
"remoteRoot": "/www/wwwroot/example.com",
"fileMode": "755",
"dirMode": "755",
"owner": "www",
"group": "www",
"ignore": [".git", "node_modules", ".vscode", ".DS_Store", "*.log"]
}
],
"deploy.defaultServer": "demo"
}
| 字段 |
说明 |
server |
引用的全局服务器名称 |
remoteRoot |
当前项目的远程目录 |
fileMode |
上传后文件权限,默认 755 |
dirMode |
上传后目录权限,默认 755 |
owner / group |
上传后所有者/属组,默认 www:www |
ignore |
上传和下载时忽略的路径或 glob(minimatch 语法) |
其他设置
| 设置 |
默认值 |
说明 |
deploy.defaultServer |
空 |
默认服务器名称 |
deploy.autoUpload |
off |
off / onSave / always |
deploy.autoUploadDelay |
800 |
always 模式防抖延迟(毫秒) |
deploy.transferConcurrency |
4 |
目录传输并发文件数,建议 4,网络好可试 8(仅非 rsync 模式) |
deploy.confirmUpload |
false |
上传前是否确认 |
deploy.rsyncExecutable |
rsync |
Rsync 可执行文件路径 |
deploy.rsyncOptions |
-zar |
Rsync 选项,逗号分隔 |
deploy.rsyncShell |
ssh |
Rsync over SSH 使用的 Shell 可执行文件,可带参数 |
FTP 与 SFTP 差异
| 项目 |
SFTP |
FTP |
| 默认端口 |
22 |
21 |
| 认证 |
密码或私钥 |
用户名 + 密码 |
| 加密 |
SSH 加密 |
明文 FTP(当前不支持 FTPS) |
| 权限 |
支持 chmod / chown |
跳过 chmod / chown |
| Rsync 模式 |
可选启用 |
不显示该选项 |
| 单文件进度 |
文件名和状态 |
百分比 + 已传/总大小 |
常见问题
连接失败
先检查协议、主机、端口、用户名和密码;FTP 默认端口 21,SFTP 默认 22。确认服务器防火墙和账号权限允许连接。
上传后权限不对
SFTP 模式下检查项目服务器的 fileMode、dirMode、owner、group;chown 通常需要足够的远程账号权限。FTP 模式不支持 chown。
自动上传没有生效
确认工具栏显示「自动上传:开」,并检查 deploy.autoUpload 是否为 always 或 onSave;同时确认项目已绑定服务器和远程目录。
目录传输很慢
非 rsync 模式可提高 deploy.transferConcurrency(如 4→8)。Rsync 模式是单连接;静态站点建议用 -ar,--whole-file,--omit-dir-times 去掉压缩和逐文件权限操作,属主/权限可在部署后一次性在服务器设置。具体效果取决于网络和服务器性能。
上传失败
确认服务器账号有写入权限;FTP 模式还需要服务器允许覆盖文件。
English
DeployPilot brings file upload and download into VS Code. Upload changed files directly and download from the server. No more switching back and forth between VS Code and FTP/SFTP clients.
Supports SFTP, FTP, and Rsync mode on SFTP servers, with multiple servers, multiple project directories, concurrent transfers, and real-time progress.
Highlights
- Upload and download without leaving VS Code.
- Multiple servers and project roots, with the active target always visible in the status bar.
- Optional Rsync mode for efficient transfers using your system
rsync.
- Auto upload, concurrent transfers and live progress.
Features
Connections & Server Management
- Global servers: Save connection details (protocol, host, port, username, password or private key) shared across all projects.
- Project servers: Select a global server for the current project, then set the remote directory, file permissions, directory permissions, owner, and ignore list.
- Protocol-independent identity: Each server has its own
protocol field (sftp / ftp); the protocol is never inferred from the port, and the port is customizable.
- Test connection: Verify the account and network before saving.
- Browse remote directories: When binding a project, pick the remote root from the server's real directory tree.
- Rsync mode: SFTP servers can enable "Use rsync for upload and download"; transfers then run through local
rsync over SSH. FTP servers do not show this option.
Upload & Download
- Title-bar upload icon: upload the current file to the default server.
- Command Palette: upload to the default server, upload to a specific server, upload all open files, download from the default server, or download from a specific server.
- Explorer / Source Control context menu: a "Deploy" submenu on files and folders.
- Upload to default server / Download from default server: use the default server directly, no prompt.
- Upload to server… / Download from server…: pick a server first.
- Configure…: open the server configuration panel.
- The status bar always shows the default server name and
IP:port (e.g. demo · 127.0.0.1:22); hover to see the remote directory. Transfer notifications also include name (IP:port).
- Supports single files and entire directories; directories are uploaded/downloaded recursively.
- Uploads always overwrite the remote file of the same name — they are never skipped or rejected just because the file already exists. If the overwrite fails because the existing remote file is read-only or the account lacks write permission, DeployPilot deletes the old file and retries once (the directory must be writable).
- Before a single-file upload, DeployPilot checks whether the remote file already exists and reports "Overwritten" or "Uploaded" accordingly.
- The status bar shows transfer progress:
- Directory: completed files / total + current filename
- FTP single file: percentage + transferred / total size
- SFTP single file: filename and transfer status
- Directory transfers support concurrency, 4 files by default, adjustable via
deploy.transferConcurrency.
- On servers with Rsync enabled, upload and download run through
rsync and the status bar shows the transferred file count; paths, options and the SSH executable can be changed in "Rsync Settings".
- The "DeployPilot" output channel logs every upload, download, and error.
Auto Upload
off: disabled.
onSave: upload when a file is saved.
always: upload after a debounce delay whenever file content changes, for write-and-deploy workflows.
- The toolbar auto-upload toggle switches between
always and off and shows the current state.
Permissions
- After an SFTP upload,
chmod / chown can be applied per project.
- FTP does not support
chown; permission steps are skipped automatically in FTP mode.
- In Rsync mode permissions are controlled by rsync options; the default
-zar does not run per-file chown/chmod. To normalize ownership/permissions, run a one-off command on the server instead.
Rsync Settings
Open it from the Command Palette (Rsync Settings...) or the Explorer context menu ("Deploy → Rsync Settings..."):
- Rsync executable path: defaults to
rsync (resolved from PATH).
- Rsync options: defaults to
-zar; comma-separated, e.g. -zar,--whole-file,--omit-dir-times.
- Shell executable path: defaults to
ssh; arguments are allowed.
- Test Connection: verifies the local rsync and ssh executables.
- Restore Defaults: restores the three defaults above.
- Rsync Options List: opens
https://download.samba.org/pub/rsync/rsync.1.
- Settings are saved in user configuration; previously saved values are not overridden by new defaults — change them or click "Restore Defaults".
Getting Started
Step 1: Add a global server
- Open the "Remote Host" view on the left.
- Click the gear icon in the title bar, or run the command
Configure....
- Click "Add Global Server".
- Fill in the connection details:
- Name: anything you like, e.g.
demo
- Protocol:
SFTP or FTP
- Host: e.g.
127.0.0.1
- Port:
22 by default for SFTP, 21 for FTP, customizable
- Username / password
- SFTP also supports selecting a private key file
- SFTP can enable "Use rsync for upload and download"; FTP does not show this option
- Click "Test Connection" to confirm it works, then save.
Step 2: Bind a project server
- Open the project folder you want to deploy.
- In the "Remote Host" view title bar, click the list icon, or run
Project Server Management.
- Click "Add Project Server".
- Select the global server you just created and enter or browse for the remote directory.
- Set file permissions, directory permissions, owner, and group as needed; FTP mode skips these permission settings.
- Set ignore entries, e.g.
.git, node_modules, .vscode, *.log.
- Save, then right-click the server node and choose "Set as Default Server".
Step 3: Daily deployment
- Upload current file: click the upload icon in the title bar.
- Upload to another server: run
Upload to... in the Command Palette, or right-click a file and choose "Deploy → Upload to Server…".
- Download: run
Download from... in the Command Palette, or right-click a file and choose "Deploy → Download from Server…".
- Auto upload: click the "Auto Upload: On / Off" toggle in the toolbar, or change
deploy.autoUpload in settings.
Configuration Reference
Global server
{
"deploy.servers": [
{
"name": "demo",
"protocol": "sftp",
"host": "127.0.0.1",
"port": 22,
"username": "www",
"password": "your-password",
"useRsync": true
}
]
}
| Field |
Description |
name |
Server name, referenced when binding a project |
protocol |
sftp or ftp, defaults to sftp |
host / port / username |
Connection details; SFTP defaults to 22, FTP to 21 |
password / privateKeyPath / passphrase |
Authentication; FTP uses a password, SFTP supports password or private key |
useRsync |
Enable rsync mode for this SFTP server; defaults to false and is ignored in FTP mode |
Project server
{
"deploy.projectServers": [
{
"server": "demo",
"remoteRoot": "/www/wwwroot/example.com",
"fileMode": "755",
"dirMode": "755",
"owner": "www",
"group": "www",
"ignore": [".git", "node_modules", ".vscode", ".DS_Store", "*.log"]
}
],
"deploy.defaultServer": "demo"
}
| Field |
Description |
server |
Name of the referenced global server |
remoteRoot |
Remote directory for the current project |
fileMode |
File permissions after upload, defaults to 755 |
dirMode |
Directory permissions after upload, defaults to 755 |
owner / group |
Owner/group after upload, defaults to www:www |
ignore |
Paths or globs ignored during upload and download (minimatch syntax) |
Other settings
| Setting |
Default |
Description |
deploy.defaultServer |
empty |
Default server name |
deploy.autoUpload |
off |
off / onSave / always |
deploy.autoUploadDelay |
800 |
Debounce delay in always mode (ms) |
deploy.transferConcurrency |
4 |
Concurrent files for directory transfers; 4 recommended, try 8 on a good network (non-rsync mode only) |
deploy.confirmUpload |
false |
Whether to confirm before uploading |
deploy.rsyncExecutable |
rsync |
Path to the rsync executable |
deploy.rsyncOptions |
-zar |
Comma-separated rsync options |
deploy.rsyncShell |
ssh |
Shell executable used by rsync over SSH; arguments are allowed |
SFTP vs FTP
| Item |
SFTP |
FTP |
| Default port |
22 |
21 |
| Authentication |
Password or private key |
Username + password |
| Encryption |
SSH encrypted |
Plain FTP (FTPS not currently supported) |
| Permissions |
Supports chmod / chown |
Skips chmod / chown |
| Rsync mode |
Optional |
Not shown |
| Single-file progress |
Filename and status |
Percentage + transferred / total size |
FAQ
Connection fails
Check the protocol, host, port, username, and password; FTP defaults to port 21, SFTP to 22. Make sure the server firewall and account permissions allow the connection.
Permissions are wrong after upload
In SFTP mode, check the project server's fileMode, dirMode, owner, and group; chown usually requires sufficient remote account privileges. FTP mode does not support chown.
Auto upload isn't working
Confirm the toolbar shows "Auto Upload: On" and that deploy.autoUpload is always or onSave; also make sure the project is bound to a server with a remote directory.
Directory transfers are slow
In non-rsync mode, try raising deploy.transferConcurrency (e.g. 4→8). Rsync mode uses a single connection; for static sites, try -ar,--whole-file,--omit-dir-times to avoid compression and per-file permission operations. Ownership/permissions can be set once on the server after deployment. Results depend on the network and server performance.
Upload fails
Make sure the server account has write permission; FTP mode also requires the server to allow overwriting files.