Skip to content

Provide VS Code flags in VSCODE_OPTIONS #1528

Closed

Description

@kylecarbs

VSCODE_OPTIONS can be an environment variable providing flags to code-server much like NODE_OPTIONS.

Activity

  1. nhooyr commented on Apr 17, 2020

    @nhooyr
    Contributor

    When do you see this being useful over flags?

  2. nhooyr commented on Apr 17, 2020

    @nhooyr
    Contributor

    Oh nvm I misunderstood the issue.

  3. added
    featureNew user visible feature
    and removed
    enhancementSome improvement that isn't a feature
    on Dec 8, 2020
  4. added this to the Backlog milestone on Apr 29, 2021
  5. stale commented on Oct 26, 2021

    @stale

    This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no activity occurs in the next 5 days.

  6. stale commented on Jul 13, 2022

    @stale

    This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no activity occurs in the next 5 days.

  7. softov commented on Aug 12, 2026

    @softov
    Contributor

    I'm trying to implement/use AHP within vscode.

    When doing $ code-server --agent-host-bridge-port 12345 --agent-host-bridge-host 10.10.10.10.
    I get a "Unknown option".

    More like missing options/flags. I have made some changes to enable it..

    --- a/src/node/cli.ts
    +++ b/src/node/cli.ts
    @@ -56,6 +56,14 @@
       "session-socket"?: string
       "cookie-suffix"?: string
       "link-protection-trusted-domains"?: string[]
    +  // Agent host bridge. These belong to the VS Code server, which already
    +  // understands them; code-server only has to accept them so `toCodeArgs`
    +  // can pass them through. Without the declaration the parser rejects them
    +  // with "Unknown option" even though the bundled server supports them.
    +  "agent-host-bridge-port"?: string
    +  "agent-host-bridge-path"?: string
    +  "agent-host-bridge-host"?: string
    +  "agent-host-bridge-connection-token"?: string
       // locale is used by both VS Code and code-server.
       locale?: string
     }
    @@ -322,6 +330,25 @@
           "Override the reconnection grace time in seconds. Clients who disconnect for longer than this duration will need to \n" +
           "reload the window. Defaults to 10800 (3 hours).",
       },
    +  "agent-host-bridge-port": {
    +    type: "string",
    +    description:
    +      "Bridge agent-host traffic to an already-running agent host listening on this port. Does not spawn one; "  +
    +      "start one with `code agent host --port <port>`.",
    +  },
    +  "agent-host-bridge-path": {
    +    type: "string",
    +    description:
    +      "Bridge agent-host traffic to an already-running agent host listening on this socket path. Does not spawn one.",
    +  },
    +  "agent-host-bridge-host": {
    +    type: "string",
    +    description: "Host the externally-running agent host is reachable at. Defaults to localhost.",
    +  },
    +  "agent-host-bridge-connection-token": {
    +    type: "string",
    +    description: "Connection token required by the externally-running agent host.",
    +  },
     }
     
     export const optionDescriptions = (opts: Partial<Options<Required<UserProvidedArgs>>> = options): string[] => {
    

    I have tried to find some doc or info in how to pass more options to the running instance, but I had no success.

    There is more options I needed to set on the instance.
    I stumble on this old ISSUE. It would be great if we had something like VSCODE_OPTIONS. So any option could be enabled without changes in the code.

    If I'm wrong, pardon me... But I cannot find any place with the right documentation.

  8. softov commented on Aug 12, 2026

    @softov
    Contributor

    The locker is mainly on the line 402 on cli.ts file /coder/code-server/blob/main/src/node/cli.ts#L402

                if (!key || !exports.options[key]) {
                    throw error(`Unknown option ${arg}`);
                }

    The case is...
    A - only accepted options (current status)
    B - curate options and add as the community asks for new options
    C - validate only some options, bypass others options accepting any other option user configured

    I would go with C if possible... this does not breaks current code and will work with any param code needs.

  9. code-asher commented on Aug 17, 2026

    @code-asher
    Member

    Yeah I think we should implement a VSCODE_OPTIONS along with probably a flag like --vscode-option, then people can do --vscode-option flag=value or something like that.

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

    featureNew user visible feature

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions