Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>sftp teamcode workNew to Visual Studio Code? Get it now.

sftp teamcode work

andi wiryawan

|
43 installs
| (1) | Free
SFTP/FTP sync Teamcode Work
This extension is now unpublished from Marketplace. You can choose to uninstall it.

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.

  • 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

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.

  • Simple
  • Profiles
  • Multiple Context
  • Connection Hopping
    • Single Hop
    • Multiple Hop
  • Config in User Setting

Simple

{
  "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 available at root level.

Use SFTP: Set Profile to switch profile.

Multiple Context

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.

Connection Hopping

You can connect 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": "/Users/hopUser/.ssh/id_rsa", // The key file is assumed on the hop.
  "remotePath": "/path/in/target",
  "hop": {
    "host": "hopHost",
    "username": "hopUsername",
    "privateKeyPath": "/Users/localUser/.ssh/id_rsa" // The key file is assumed on the local.
  }
}

Multiple Hop

local -> hopa -> hopb -> target

{
  "name": "target",
  "host": "targetHost",
  "username": "targetUsername",
   "privateKeyPath": "/Users/hopbUser/.ssh/id_rsa", // The key file is assumed on the hopb.
  "remotePath": "/path/in/target",
  "hop": [
    {
      "host": "hopAHost",
      "username": "hopAUsername",
      "privateKeyPath": "/Users/hopAUsername/.ssh/id_rsa" // The key file is assumed on the local.
    },
    {
      "host": "hopBHost",
      "username": "hopBUsername",
      "privateKeyPath": "/Users/hopaUser/.ssh/id_rsa" // The key file is assumed on the hopa.
    }
  ]
}

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 lets 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 a files content with Remote Explorer. Run command SFTP: Edit in Local to edit it in local.

Note: You need to manually refresh the parent folder after you 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.

  • Contact us
  • Jobs
  • Privacy
  • Terms of use
  • Trademarks
© 2019 Microsoft