opencode icon indicating copy to clipboard operation
opencode copied to clipboard

[FEATURE]: Add command palette action to reload configuration without restart

Open leeweisern opened this issue 2 weeks ago • 1 comments

Feature Description

Add a command to the command palette that reloads/restarts OpenCode to reflect configuration changes without having to manually exit and start again.

Use Case

When making changes to OpenCode configuration files (e.g., opencode.json, AGENTS.md, etc.), users currently need to:

  1. Exit OpenCode completely
  2. Restart OpenCode manually

This is similar to how shell users need to run source ~/.zshrc after editing their zsh configuration - but ideally OpenCode could handle this more seamlessly.

Proposed Solution

Add a command in the command palette (accessible via ctrl+p) such as:

  • /reload or /restart - Reloads configuration and restarts the session
  • Or a keyboard shortcut like ctrl+shift+r

This command would:

  1. Re-read all configuration files
  2. Reload any changed settings (providers, models, keybindings, hooks, etc.)
  3. Optionally preserve the current session/conversation state

This would greatly improve the developer experience when:

  • Testing new model configurations
  • Adding/modifying custom tools or MCP servers
  • Tweaking keybindings or hooks
  • Updating AGENTS.md instructions

leeweisern avatar Jan 04 '26 07:01 leeweisern