code-server icon indicating copy to clipboard operation
code-server copied to clipboard

code : VSCode cli

Open iwoogy opened this issue 7 years ago • 6 comments

Hello

I need to use the VSCode cli but I cannot find it.

Description

root@13857b5bdf7d:/home/coder/project# command -v code
root@13857b5bdf7d:/home/coder/project# which code
root@13857b5bdf7d:/home/coder/project# code --version
bash: code: command not found

Question

Is there a way to install VSCode command line ?

Thanks

Regards

Bobby

iwoogy avatar May 04 '19 05:05 iwoogy

Have you tried code-server?

vnijs avatar May 04 '19 05:05 vnijs

Is it the same as the reguler code cli ?

What I try to achieve is to open a file programmatically.

For example on VSCode I will call :

code --goto src/app/pages/main.tsx:24:9

and VSCode will open the file at the line 24.

I tried :

code-server --goto src/app/pages/main.tsx:24:9
error: unknown option `--goto'

iwoogy avatar May 04 '19 05:05 iwoogy

As far as I know you cannot do that. See command line help below. code-server will start a web service that, once you are in the application in your browser, will work like vscode.

image

vnijs avatar May 04 '19 05:05 vnijs

They should make an RPC plugin and make a CLI that hooks into it. That'd be cool

hbjydev avatar May 07 '19 18:05 hbjydev

This isn't supported but hopefully it will be eventually: https://github.com/cdr/code-server/issues/164.

code-asher avatar Sep 18 '19 22:09 code-asher

Any progress in that?

sandric avatar Dec 14 '19 12:12 sandric