Skip to content

Add 'config edit' to open the config file in your editor#255

Merged
jongio merged 2 commits into
mainfrom
idea/config-edit
Jul 7, 2026
Merged

Add 'config edit' to open the config file in your editor#255
jongio merged 2 commits into
mainfrom
idea/config-edit

Conversation

@jongio

@jongio jongio commented Jul 7, 2026

Copy link
Copy Markdown
Owner

What

Adds a dispatch config edit subcommand that opens the config file in your editor.

dispatch config edit

It writes the current config to disk first (so the file always exists, even on a
fresh install), opens it in your editor, and then re-reads the file after the
editor exits. If the edit left the file unparseable, the error is reported
instead of being silently applied.

Why

Today the only way to change settings is one config set key value call at a
time, or hunting down the file path with config path and opening it by hand.
For anyone who wants to review or change several settings at once, opening the
file directly is faster. This lines up with how tools like git config --edit
and gh config behave.

Editor resolution

  1. $VISUAL
  2. $EDITOR
  3. Platform default: notepad on Windows, vi elsewhere

The editor value is split on whitespace, so entries like code --wait keep
their flags.

Changes

  • New runConfigEdit handler plus resolveEditorArgv / launchEditor helpers in cmd/dispatch/config.go
  • Help text updated in cmd/dispatch/main.go
  • Shell completions (bash, zsh, powershell) updated in cmd/dispatch/cli.go
  • README example added
  • Tests covering success, argument rejection, editor failure, post-edit validation, and editor resolution

Testing

  • go build ./...
  • go test ./... -count=1
  • go vet ./...
  • golangci-lint run

All green.

Closes #254

Adds a 'dispatch config edit' subcommand that writes the current config to disk, opens it in \/\ (falling back to notepad on Windows, vi elsewhere), and re-validates the file after the editor exits so a broken edit is reported instead of silently applied.

Updates help text, shell completions (bash/zsh/powershell), and the README.

Closes #254

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@jongio jongio added the idea Feature idea from the idea pipeline label Jul 7, 2026
@jongio jongio self-assigned this Jul 7, 2026
@jongio jongio merged commit b771579 into main Jul 7, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

idea Feature idea from the idea pipeline

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add 'config edit' to open the config file in your editor

1 participant