Very powerful, with smart features. Very simple, requires just three lines of config! Very fast, finished in a blink.
- Features
- Browser remote with Remote Explorer
- Diff local and remote
- Sync directory
- Upload/Download
- Upload on save
- File Watcher
- Multiple configs
- Switchable profiles
- Commands
- Debug
- Support SFTP Project
Ctrl+Shift+P
on Windows/Linux orCmd+Shift+P
on Mac open command palette, runSFTP: config
command.- Enjoy.
For detailed usage. Please go to wiki.
You can see the full config here.
{
"host": "host",
"username": "username",
"remotePath": "/remote/workspace"
}
{
"username": "username",
"password": "password",
"remotePath": "/remote/workspace/a",
"watcher": {
"files": "dist/*.{js,css}",
"autoUpload": false,
"autoDelete": false
},
"profiles": {
"dev": {
"host": "dev-host",
"remotePath": "/dev",
"uploadOnSave": true
},
"prod": {
"host": "prod-host",
"remotePath": "/prod"
}
},
"defaultProfile": "dev"
}
Note: context
and watcher
are only avaliable at root level.
Use SFTP: Set Profile
to swtich profile.
The context must not be same.
[
{
"name": "server1",
"context": "/project/build",
"host": "host",
"username": "username",
"password": "password",
"remotePath": "/remote/project/build"
},
{
"name": "server2",
"context": "/project/src",
"host": "host",
"username": "username",
"password": "password",
"remotePath": "/remote/project/src"
}
]
Note: name
is required in this mode.
You can connection to a target server through a proxy with ssh protocol.
Note: Variable substitution is not working in a hop config.
local -> hop -> target
{
"name": "target",
"host": "targetHost",
"username": "targetUsername",
"privateKeyPath": "~/.ssh/id_rsa",
"remotePath": "/path/in/target",
"hop": {
"host": "hopHost",
"username": "hopUsername",
"privateKeyPath": "/Users/hopUsername/.ssh/id_rsa" // The key file is assumed on the hop.
}
}
local -> hopA -> hopB -> target
{
"name": "target",
"host": "targetHost",
"username": "targetUsername",
"privateKeyPath": "~/.ssh/id_rsa",
"remotePath": "/path/in/target",
"hop": [
{
"host": "hopAHost",
"username": "hopAUsername",
"privateKeyPath": "/Users/hopAUsername/.ssh/id_rsa"
},
{
"host": "hopBHost",
"username": "hopBUsername",
"privateKeyPath": "/Users/hopBUsername/.ssh/id_rsa"
}
]
}
You can use remote
to tell sftp to get the config from remote-fs.
In User Setting:
"remotefs.remote": {
"dev": {
"scheme": "sftp",
"host": "host",
"username": "username",
"rootPath": "/path/to/somewhere"
},
"projectX": {
"scheme": "sftp",
"host": "host",
"username": "username",
"privateKeyPath": "/Users/xx/.ssh/id_rsa",
"rootPath": "/home/foo/some/projectx"
}
}
In sftp.json:
{
"remote": "dev",
"remotePath": "/home/xx/",
"uploadOnSave": true,
"ignore": [".vscode", ".git", ".DS_Store"]
}
Remote Explorer let you explore files in remote. You can open Remote Explorer by:
- Run Command
View: Show SFTP
. - Click SFTP view in Activity Bar.
You can only view files content with Remote Explorer. Run command SFTP: Edit in Local
to edit it in local.
Note: You need manually refresh the parent folder after delete a file to make the explorer updated.
-
Open User Settings.
- On Windows/Linux -
File > Preferences > Settings
- On macOS -
Code > Preferences > Settings
- On Windows/Linux -
-
Set
sftp.debug
totrue
and reload vscode. -
View the logs in
View > Output > sftp
.
If this project help you reduce time to develop, you can give me a cup of coffee :)