Skip to content

feat: add --env flag for "coder ssh" #12991

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 22, 2024
Merged

Conversation

aaronlehmann
Copy link
Contributor

This allows environment variables to be set on the SSH session.

Example:

coder ssh myworkspace --env VAR1=val1,VAR2=val2

@cdr-bot cdr-bot bot added the community Pull Requests and issues created by the community. label Apr 17, 2024
@aaronlehmann aaronlehmann changed the title feat: Add --env flag for "coder ssh" feat: add --env flag for "coder ssh" Apr 17, 2024
Copy link
Member

@kylecarbs kylecarbs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will let @mafredri review, but seems reasonable to me!

@kylecarbs kylecarbs requested a review from mafredri April 17, 2024 20:17
@aaronlehmann aaronlehmann force-pushed the ssh-setenv branch 2 times, most recently from 064956f to e99d184 Compare April 18, 2024 15:57
This allows environment variables to be set on the SSH session.

Example:

   coder ssh myworkspace --env VAR1=val1,VAR2=val2
Copy link
Member

@mafredri mafredri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thanks for adding this functionality!

@mafredri mafredri merged commit 8a12162 into coder:main Apr 22, 2024
25 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Apr 22, 2024
@matifali
Copy link
Member

Can this be done using API, too?

@kylecarbs
Copy link
Member

@matifali realistically, it already is.

This just uses the SSH protocol to set env vars.

@matifali
Copy link
Member

I was looking into a use case where someone is developing a custom skin over Coder API and would like to set env variables at workspace start.
It can be done already on a template level using coder_env and could be scripted to customize for each of the workspaces.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
community Pull Requests and issues created by the community.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants