Skip to content

"Code" CLI does not have advanced options while trying to install a .vsix extension on my remote Linux VM over the SSH session #2749

Open

Description

@vinayrao123
  • VSCode Version: 1.44.0
  • Local OS Version: MacOS Catalina (Version 10.15.2)
  • Remote OS Version:"14.04.6 LTS, Trusty Tahr"
  • Remote Extension/Connection Type: SSH/Docker/WSL

Steps to Reproduce:

  1. Build your VSCode extension on your Mac and test it using the debug steps as outlined here: https://www.digitalocean.com/community/tutorials/how-to-create-your-first-visual-studio-code-extension
  2. Create a .vsix file on your Mac by following the steps outlined here: https://code.visualstudio.com/api/working-with-extensions/publishing-extension#packaging-extensions
  3. Now connect to your remote Linux server using the remote-ssh extension
  4. Using the Terminal as exposed by the VSCode client, try to issue the CLI "code --install-extension <path-to-.vsix-file>" and you see this error:
:~/workspace/restricted$ code --install-extension
/home/cohesity/.vscode-server/bin/2aae1f26c72891c399f860409176fe435a154b13
Ignoring option install-extension: not supported for code.
At least one file or folder must be provided.

Further, when I try to look at the --help options on the remote machine, I see this:

$ code --help
/home/cohesity/.vscode-server/bin/2aae1f26c72891c399f860409176fe435a154b13
code 1.44.0

Usage: code [options][paths...]

To read from stdin, append '-' (e.g. 'ps aux | grep code | code -')

Options
  -d --diff <file> <file>           Compare two files with each other.
  -g --goto <file:line[:character]> Open a file at the path on the specified line and character position.
  -n --new-window                   Force to open a new window.
  -r --reuse-window                 Force to open a file or folder in an already opened window.
  --folder-uri <uri>                Opens a window with given folder uri(s)
  --file-uri <uri>                  Opens a window with given file uri(s)
  -w --wait                         Wait for the files to be closed before returning.
  -h --help                         Print usage.

Troubleshooting
  -v --version Print version.
  -s --status  Print process usage and diagnostics information.

However, on my Mac, I see the right set of options, for the same version of "code" (1.44.0):

% code --help
Visual Studio Code 1.44.0

Usage: code [options][paths...]

To read from stdin, append '-' (e.g. 'ps aux | grep code | code -')

Options
  -d --diff <file> <file>           Compare two files with each other.
  -a --add <folder>                 Add folder(s) to the last active window.
  -g --goto <file:line[:character]> Open a file at the path on the specified line and character position.
  -n --new-window                   Force to open a new window.
  -r --reuse-window                 Force to open a file or folder in an already opened window.
  --folder-uri <uri>                Opens a window with given folder uri(s)
  --file-uri <uri>                  Opens a window with given file uri(s)
  -w --wait                         Wait for the files to be closed before returning.
  --locale <locale>                 The locale to use (e.g. en-US or zh-TW).
  --user-data-dir <dir>             Specifies the directory that user data is kept in. Can be used to open multiple distinct instances of
                                    Code.
  -h --help                         Print usage.

Extensions Management
  --extensions-dir <dir>                            Set the root path for extensions.
  --list-extensions                                 List the installed extensions.
  --show-versions                                   Show versions of installed extensions, when using --list-extension.
  --category                                        Filters installed extensions by provided category, when using --list-extension.
  --install-extension <extension-id | path-to-vsix> Installs or updates the extension. Use `--force` argument to avoid prompts.
  --uninstall-extension <extension-id>              Uninstalls an extension.
  --enable-proposed-api <extension-id>              Enables proposed API features for extensions. Can receive one or more extension IDs to
                                                    enable individually.

Troubleshooting
  -v --version                       Print version.
  --verbose                          Print verbose output (implies --wait).
  --log <level>                      Log level to use. Default is 'info'. Allowed values are 'critical', 'error', 'warn', 'info', 'debug',
                                     'trace', 'off'.
  -s --status                        Print process usage and diagnostics information.
  --prof-startup                     Run CPU profiler during startup
  --disable-extensions               Disable all installed extensions.
  --disable-extension <extension-id> Disable an extension.
  --sync <on> <off>                  Turn sync on or off
  --inspect-extensions <port>        Allow debugging and profiling of extensions. Check the developer tools for the connection URI.
  --inspect-brk-extensions <port>    Allow debugging and profiling of extensions with the extension host being paused after start. Check the
                                     developer tools for the connection URI.
  --disable-gpu                      Disable GPU hardware acceleration.
  --max-memory                       Max memory size for a window (in Mbytes).
  --telemetry                        Shows all telemetry events which VS code collects.

Further, I checked the output of "vsce package" and I do see all the npm packages being included.

Does this issue occur when you try this locally?: No (The 'code' CLI has all the options available on my Mac)
Does this issue occur when you try this locally and all extensions are disabled?: No

I looked at other bugs but could not find any issue that pointed towards a truncated set of options with the "code" CLI...

Another point to note: I did not have an active installation of VSCode on my remote machine. I just installed VSCode on my Mac and used the "Remote SSH" extension to help out with the installation of the VSCode server on that machine.

Any pointers on what I might be doing wrong would be really helpful.

Activity

  1. added
    remote
    on Oct 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    remote

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions