Skip to content

Commit 7e5d315

Browse files
committed
refactor: CLI-mediate credentials and move global-config to globalFlags
Replace the dedicated `coder.globalConfig` setting with a `--global-config` passthrough in `coder.globalFlags`, honored on 2.31.0+. The extension no longer reads/writes the CLI credential files itself: it writes via `coder login` (0.25.0+, `--use-token-as-session`), reads via `coder login token` (2.31.0+), and deletes via `coder logout` (keyring or file with `--global-config`). Direct file writes remain only as a pre-0.25 fallback. The binary cache no longer follows the config dir.
1 parent e67abdc commit 7e5d315

14 files changed

Lines changed: 407 additions & 340 deletions

package.json

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -181,14 +181,8 @@
181181
],
182182
"scope": "machine"
183183
},
184-
"coder.globalConfig": {
185-
"markdownDescription": "Path to the global Coder CLI config directory passed with `--global-config`. Defaults to `CODER_CONFIG_DIR` if not set, otherwise the extension's per-deployment global storage directory. Set this to a shared CLI config directory such as `~/.config/coderv2` to share login/auth with the Coder CLI. Ignored when `#coder.useKeyring#` is active and supported.\n\nSupports `${env:VAR}`, `${userHome}`, and a leading `~`.",
186-
"type": "string",
187-
"default": "",
188-
"scope": "machine"
189-
},
190184
"coder.globalFlags": {
191-
"markdownDescription": "Global flags to pass to every Coder CLI invocation. Enter each flag as a separate array item, in order. Do **not** include the `coder` command itself. See the [CLI reference](https://coder.com/docs/reference/cli) for available global flags.\n\nSupports `${env:VAR}`, `${userHome}`, and a leading `~`. For `--flag=value` items the expansion applies to the value half, so `--cfg=~/coder` works.\n\nFor `--header-command`, precedence is: `#coder.headerCommand#` setting, then `CODER_HEADER_COMMAND` environment variable, then the value specified here. The `--global-config` and `--use-keyring` flags are silently ignored; use `#coder.globalConfig#` and `#coder.useKeyring#` instead.",
185+
"markdownDescription": "Global flags to pass to every Coder CLI invocation. Enter each flag as a separate array item, in order. Do **not** include the `coder` command itself. See the [CLI reference](https://coder.com/docs/reference/cli) for available global flags.\n\nSupports `${env:VAR}`, `${userHome}`, and a leading `~`. For `--flag=value` items the expansion applies to the value half, so `--cfg=~/coder` works.\n\nSet `--global-config` here to point the CLI at a shared config directory (e.g. `--global-config=~/.config/coderv2` to share login/auth with the Coder CLI); requires a deployment on 2.31.0+ and is ignored when `#coder.useKeyring#` is active. The `--use-keyring` flag is ignored; use `#coder.useKeyring#` instead.\n\nFor `--header-command`, precedence is: `#coder.headerCommand#` setting, then `CODER_HEADER_COMMAND` environment variable, then the value specified here.",
192186
"type": "array",
193187
"items": {
194188
"type": "string"

0 commit comments

Comments
 (0)