23

I use the new VS Code remote feature all the time and it is superb. I'm wondering if it is possible to open a specific ssh host / folder from the cli. That way I can script a spin up of my dev environment (vm, vs-code, etc.)!

I had a look at code-insiders --help but couldn't see anything that would allow me to do this. That perhaps makes this a feature request, but thought I'd post here before doing so on the GitHub repo.

2 Answers 2

39

Run this on your cmd or PowerShell

code --remote ssh-remote+<remoteHost> <remotePath> 

source: https://github.com/microsoft/vscode-remote-release/issues/656#issuecomment-584209378

Sign up to request clarification or add additional context in comments.

4 Comments

Also now documented here, with some additional options: code.visualstudio.com/docs/remote/…
note that unlike most other ssh tools the remote path must be the full absolute path
missing the username in this command
Yes, it's a pity you cannot give "." as a working directory to use whatever home directory is linked to that user.
2

The accepted answer didn't work for me, but this did:

code --folder-uri vscode-remote://ssh-remote+<remoteHost><remotePath> 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.