You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#2989 added support for showing resource metadata in the web UI. Implement the corresponding functionality in the CLI, to make it easier to use metadata items like API keys.
Proposed syntax:
coder metadata <workspace> to list all items, with sensitive values obscured by a placeholder
coder metadata --all <workspace> to list all items
coder metadata --get <workspace> <resource> <key> to print just the value of a specific key, without formatting or headers (for scripts)
Reacted by Ben Potter, Ammar Bandukwala and Johan Siebens
What's the difference between --all and the first invokation?
The only difference is by default the values of sensitive fields are obscured (for consistency with the web UI) and --all would cause them to be shown. Open to suggestions for a better name for this. I also considered something like --include-sensitive-values but it seems unnecessarily verbose.
Why use --get here instead of inferring the operation from the number of arguments?
There are a couple of reasons I think it makes sense to do it this way:
I think of "present a formatted, human-readable table" and "fetch the exact value of a single item" as conceptually different operations. So at least one of them should have a name that distinguishes it from the other, as opposed to just being two unnamed modes of the same command
The main use case for fetching a single value is likely to be scripting (e.g. fetching an API key in .bashrc and using it to populate an environment variable) and in a non-interactive situation, it's better to be as explicit as possible
This issue is becoming stale. In order to keep the tracker readable and actionable, I'm going close to this issue in 7 days if there isn't more activity.
This issue is becoming stale. In order to keep the tracker readable and actionable, I'm going close to this issue in 7 days if there isn't more activity.
Activity
ammario commentedon Aug 10, 2022
What's the difference between
--alland the first invokation?Why use
--gethere instead of inferring the operation from the number of arguments?dwahler commentedon Aug 10, 2022
The only difference is by default the values of sensitive fields are obscured (for consistency with the web UI) and
--allwould cause them to be shown. Open to suggestions for a better name for this. I also considered something like--include-sensitive-valuesbut it seems unnecessarily verbose.There are a couple of reasons I think it makes sense to do it this way:
.bashrcand using it to populate an environment variable) and in a non-interactive situation, it's better to be as explicit as possiblegithub-actions commentedon Oct 10, 2022
This issue is becoming stale. In order to keep the tracker readable and actionable, I'm going close to this issue in 7 days if there isn't more activity.
github-actions commentedon Dec 18, 2022
This issue is becoming stale. In order to keep the tracker readable and actionable, I'm going close to this issue in 7 days if there isn't more activity.