feat: add ~/.voipirc.json config file support#5
Open
dean-harel wants to merge 1 commit into
Open
Conversation
- Load defaults from .voipirc.json / XDG config paths - Config provider overrides auto-detection chain - Config voice/lang/rate merged as speak/save/synthesize defaults - Add --show-config CLI flag - Add tests for config loading and precedence
|
@dean-harel is attempting to deploy a commit to the pi0 Team on Vercel. A member of the Team first needs to authorize it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #4
Implements persistent configuration via JSON files so users don't have to pass
--provider,--voice,--lang, and--rateon every invocation.Config file locations (precedence order)
$PWD/.voipirc.jsonβ project-local override$HOME/.voipirc.jsonβ user global (primary)$XDG_CONFIG_HOME/voipi/config.jsonβ XDG compliant$HOME/.config/voipi/config.jsonβ XDG fallbackSchema
All fields optional. Unknown keys are ignored. Malformed JSON warns to stderr and falls back to the next path.
{ "provider": "edge-tts", "voice": "en-US-GuyNeural", "lang": "en", "rate": 1.2 }Precedence (highest to lowest)
speak({ voice: "X" }))new VoiPi({ providers: [...] }))--voice,--provider, etc.)~/.voipirc.json)Changes
src/_config.tsβ config discovery and loadingsrc/voipi.tsβ merge config defaults intospeak/save/synthesize; use configproviderwhen no constructor options givensrc/cli/index.tsβ add--show-configflag; mention config file in--helptest/config.test.tsβ vitest coverage for loading, precedence, malformed JSON fallback, andVoiPiintegrationtest/voipi.test.tsβ mockloadConfigto stay deterministicREADME.md&packages/pi/README.mdβ document config file usageNotes
VoiPiconstruction (not module scope), so Pi's/reloadand long-running processes pick up changes without module cache issues.