Super fast sftp/ftp extension for VS Code
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github config gitapp request-info Dec 17, 2018
.vscode use webpack bundle extension Nov 15, 2018
__mocks__ new sync algorithms Oct 11, 2018
assets update assets Aug 7, 2018
resources add upload file to scm Oct 31, 2018
schema option to limit open files on remote Nov 1, 2018
src fxi ignore not work when use profile Dec 16, 2018
test transfer Oct 9, 2018
.gitignore use webpack bundle extension Nov 15, 2018
.vscodeignore don't bundle ssh2 Nov 22, 2018
CHANGELOG.md v1.8.4 Dec 16, 2018
FAQ.md v1.8.0 Dec 6, 2018
LICENSE update license Nov 12, 2018
README.md v1.7.3 Nov 1, 2018
package.json v1.8.4 Dec 16, 2018
tsconfig.json upgrade typescript Nov 15, 2018
tslint.json upload changed files Nov 22, 2018
webpack.config.js don't bundle ssh2 Nov 22, 2018
yarn.lock use webpack bundle extension Nov 15, 2018

README.md

sftp sync extension for VS Code

Very powerful, with smart features. Very simple, requires just three lines of config! Very fast, finished in a blink.

Usage

  1. Ctrl+Shift+P on Windows/Linux or Cmd+Shift+P on Mac open command palette, run SFTP: config command.
  2. Enjoy.

For detailed usage. Please go to wiki.

Example Configs

You can see the full config here.

Password Free

{
  "host": "host",
  "username": "username",
  "remotePath": "/remote/workspace"
}

Profiles

{
  "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.

Multiple Context

[
  {
    "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.

Connection Hopping.

You can connection to a target server through a proxy with ssh protocol.

Note: Variable substitution is not working in a hop config.

Single Hop

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.
  }
}

Multiple 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"
    }
  ]
}

Config in User Setting

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

remote-explorer-preview

Remote Explorer let you explore files in remote. You can open Remote Explorer by:

  1. Run Command View: Show SFTP.
  2. 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.

Debug

  1. Open User Settings.

    • On Windows/Linux - File > Preferences > Settings
    • On macOS - Code > Preferences > Settings
  2. Set sftp.debug to true and reload vscode.

  3. View the logs in View > Output > sftp.


Donation

If this project help you reduce time to develop, you can give me a cup of coffee :)

Alipay

Alipay

Wechat

Wechat

PayPal

PayPal