Skip to content

Set environment variables to detect we're inside a Coder workspace #2340

@mafredri

Description

@mafredri

As a user, I want my generic dotfiles to behave a specific way in Coder workspaces

I'm proposing we set the following environment variables inside workspaces:

CODER_WORKSPACE_NAME=maf/work
CODER_WORKSPACE_TEMPLATE=docker
CODER_WORKSPACE=true

I think the CODER_WORKSPACE_TEMPLATE is optional/nice-to-have for extra customization based on env, but the other two seem kind of like standard practice.

Example from Codespaces:

CODESPACE_NAME=mafredri-myrepo-a3rj5r302v9
CODESPACES=true

This can be done even today by detecting CODER_AGENT_* variables, but I consider this "internal logic" that the user can't rely on.

Metadata

Metadata

Assignees

No one assigned

    Labels

    apiArea: HTTP APIcliArea: CLI

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy