Problem
The config file path is fixed at the OS config directory (%APPDATA%\dispatch on Windows, ~/.config/dispatch on Linux, ~/Library/Application Support/dispatch on macOS). There is no way to point dispatch at a different config file. That makes it hard to keep separate profiles (for example work and personal launch defaults) or to run a throwaway config for testing.
Proposed solution
Honor a DISPATCH_CONFIG environment variable that names an absolute path to the config file. When set, Load, Save, config path, and doctor all use that path instead of the default. When unset, behavior is unchanged. This matches the KUBECONFIG style of config path override.
For safety, reject a relative path and a UNC path (the same rule already used for the log file), falling back to the default when the value is unusable.
Acceptance criteria
- With
DISPATCH_CONFIG set to an absolute path, dispatch config path prints that path and config get/set/edit read and write it.
dispatch doctor reports the overridden config path.
- An unset
DISPATCH_CONFIG keeps the current default path behavior.
- A relative or UNC
DISPATCH_CONFIG value is ignored and the default path is used.
- README documents the variable and the resolution order.
- Tests cover set, unset, and the rejected-path cases.
Complexity
S
Priority
High
Problem
The config file path is fixed at the OS config directory (
%APPDATA%\dispatchon Windows,~/.config/dispatchon Linux,~/Library/Application Support/dispatchon macOS). There is no way to point dispatch at a different config file. That makes it hard to keep separate profiles (for example work and personal launch defaults) or to run a throwaway config for testing.Proposed solution
Honor a
DISPATCH_CONFIGenvironment variable that names an absolute path to the config file. When set,Load,Save,config path, anddoctorall use that path instead of the default. When unset, behavior is unchanged. This matches theKUBECONFIGstyle of config path override.For safety, reject a relative path and a UNC path (the same rule already used for the log file), falling back to the default when the value is unusable.
Acceptance criteria
DISPATCH_CONFIGset to an absolute path,dispatch config pathprints that path andconfig get/set/editread and write it.dispatch doctorreports the overridden config path.DISPATCH_CONFIGkeeps the current default path behavior.DISPATCH_CONFIGvalue is ignored and the default path is used.Complexity
S
Priority
High