Skip to content

Pass flags to code #305

Closed
Closed

Description

@lshamis

Is there a way to pass flags through code-server to code? For example, how would I pass:
--user-data-dir=$HOME/vscode/data and --extensions-dir=$HOME/vscode/extensions?

Activity

  1. added
    enhancement
    on Mar 20, 2019
  2. Aaaaash commented on Mar 21, 2019

    @Aaaaash

    You can pass flags through code-server to vscode, in code-server packages/server/src/vscode/sharedProcess.ts pass some args to vscode SharedProcess

    this.ipcHandler.once("handshake:hello", () => {
    	const data: {
    		sharedIPCHandle: string;
    		args: Partial<ParsedArgs>;
    		logLevel: Level;
    	} = {
    		args: {
    			"builtin-extensions-dir": this.builtInExtensionsDir,
    			"user-data-dir": this.userDataDir,
    			"extensions-dir": extensionsDir,
    		},
    		logLevel: this.logger.level,
    		sharedIPCHandle: this.socketPath,
    	};
    	this.ipcHandler!.send("handshake:hey there", "", data);
    });
  3. kylecarbs commented on Mar 21, 2019

    @kylecarbs
    Member

    We can update the CLI to include additional arguments.

  4. vnijs commented on May 1, 2019

    @vnijs

    @kylecarbs Could you explain how --builtin-extensions-dir is supposed to be used? I could not find documentation. It seems that in 1.939 the --builtin-extensions-dir argument is unknown (see output below).

    I hoped that this would be a way to install some extensions that would be available for all users on a server and/or a way to install extensions when building a docker image. The user would then still have --extensions-dir to install any extensions they want in addition to the ones already on the system or in the container. That would mean that code-server would have to look in two places for available extensions and give priority to --extensions-dir if that has a newer version for example. Thx

    code-server --builtin-extensions-dir /opt/code-server/extensions --install-extension ms-python.python
    error: unknown option `--builtin-extensions-dir'
    
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

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      ⌂ Proxy