Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CLI for remote dev #656

Closed
ykafia opened this issue Jun 11, 2019 · 17 comments
Closed

Add CLI for remote dev #656

ykafia opened this issue Jun 11, 2019 · 17 comments
Assignees
Labels
feature-request Request for new features or functionality remote Issues in the code server support verified Verification succeeded
Milestone

Comments

@ykafia
Copy link

ykafia commented Jun 11, 2019

Would be useful to just call VsCode remote dev directly through CLI like so :

code --remote-ssh Machine1
@WSLUser
Copy link

WSLUser commented Jun 11, 2019

Better place to file is the the remote dev GitHub unless they've already said there's no API call for this.

@Tyriar Tyriar transferred this issue from microsoft/vscode Jun 11, 2019
@roblourens
Copy link
Member

I think we have an issue for this somewhere but I can't find it...

@roblourens roblourens added feature-request Request for new features or functionality remote Issues in the code server support labels Jun 19, 2019
@payonel
Copy link

payonel commented Aug 7, 2019

just starting using remote ssh, this is the first thing i was looking for. I start all my projects and tools from command line, so this (for me) would be a very valuable feature!

@robertsk50
Copy link

If you want to open a specific file/folder on a remote machine you can use the uri command line functionality:

code --folder-uri vscode-remote://ssh-remote%2B<host><path>
or
code --file-uri vscode-remote://ssh-remote%2B<host><path>

@johnbillion
Copy link

How does this translate to a vscode://-style URI that can be opened via the browser? The vscode-remote:// protocol handler doesn't appear to be registered.

@bpasero
Copy link
Member

bpasero commented Feb 10, 2020

microsoft/vscode#90367 suggests to introduce support for vscode://-style URIs in the form of: vscode://vscode-remote/<authority>/<path>

@bpasero bpasero added this to the February 2020 milestone Feb 10, 2020
@aeschli
Copy link
Contributor

aeschli commented Feb 10, 2020

Also already supported is the following:

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

It's up to each remote extension to define the format for what's behind the +.
Ideally, ssh would spec what is valid in the documentation.

@bpasero
Copy link
Member

bpasero commented Feb 12, 2020

This landed via microsoft/vscode@bdf1156. The URI must be of the form: <vscode|vscode-insiders>://<vscode-remote>/<authority>/<path> and will then internally be transformed to be <vscode-remote>://<authority>/<path>

@bpasero bpasero closed this as completed Feb 12, 2020
@d2inco
Copy link

d2inco commented Feb 12, 2020

I am assuming the vscode-remote is the SSH target.... What key is the authority?

@bpasero
Copy link
Member

bpasero commented Feb 12, 2020

Here is an example for SSH: vscode://vscode-remote/ssh-remote+<host>/<path>. Pretty much everything in vscode://vscode-remote is static and only afterwards is remote specific.

@bpasero bpasero added the verification-needed Verification of issue is requested label Feb 18, 2020
@bpasero
Copy link
Member

bpasero commented Feb 18, 2020

Verification:

Craft a vscode-remote URI as outlined above and use the "Open Link" command to open it:

image

@connor4312
Copy link
Member

I wasn't able to get this working. On the latest insiders I tried opening the link:

vscode-insiders://vscode-remote/ssh-remote+<ip>/home/connor

(as well as the non--insiders version)

However, nothing happened. I didn't see any error logs anywhere. Running Open Link on https://example.com works. The remote SSH extension is installed and I'm able to connect to the host manually.

@connor4312 connor4312 reopened this Feb 25, 2020
@connor4312 connor4312 added verification-found Issue verification failed and removed verification-needed Verification of issue is requested labels Feb 25, 2020
@bpasero
Copy link
Member

bpasero commented Feb 26, 2020

@connor4312 please clarify how you tried this and on what OS you are on.

@bpasero bpasero added the info-needed Issue requires more information from poster label Feb 26, 2020
@connor4312
Copy link
Member

Okay, I got it working. Realized that the vscode URI, unlike the https link, was not recognized in the plain text language mode.

@connor4312 connor4312 added verified Verification succeeded and removed info-needed Issue requires more information from poster verification-found Issue verification failed labels Feb 26, 2020
@svalentin
Copy link

Just to confirm, is there a way to open a remote file by URL? I only seem to get it to work with folders.
vscode://vscode-remote/ssh-remote+/<path/to/folder> works
vscode://vscode-remote/ssh-remote+/<path/to/file> tries to open the "folder" with the name of the file.

@bersbersbers
Copy link

@svalentin I just confirmed that it does work with workspace files, that is,
vscode://vscode-remote/ssh-remote+myhost/home/myuser/myproject.code-workspace
is working fine.

@svalentin
Copy link

svalentin commented Mar 30, 2020

Interesting. To me it behaved as if running vscode with code --folder-uri vscode-remote://<URI-to-file> when what I was looking for was something similar with running vscode with code --file-uri vscode-remote://<URI-to-file>.
Maybe I was doing something wrong.
I worked around it by registering my own URL handler that runs the above --file-uri command.

@vscodebot vscodebot bot locked and limited conversation to collaborators Apr 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality remote Issues in the code server support verified Verification succeeded
Projects
None yet
Development

No branches or pull requests