feat: unify config across all tools, add JSON config and make setup wizard - #18
Merged
Conversation
…tup wizard - Create shared config.go with ToolkitConfig, JSON load/save/validate - Create shared color.go with unified ANSI constants (fix ColorOrange) - Create config_test.go with 8 round-trip and validation tests - Add interactive setup wizard at cmd/calmstoolkit-setup/ (make setup) - Rewrite media-calendar.go: concurrent errgroup fetching, context.Context, signal.NotifyContext graceful shutdown, shared HTTP client, calculateDateRange helper, summary line, -filter/-no-banner/-quiet/-monitored-only flags, configurable instance names, fixed truncateText edge case, ANSI clearScreen - Rewrite media-streams.go: shared config, context, signal handler - Rewrite media-requests.go: shared config, context - Rewrite arr-feed.go: shared config, context, signal handler - Remove all old loadConfig/loadEnvFile/parseCommaSeparated functions - Remove per-tool ANSI color constants (use shared color.go) - Update Makefile: add setup/setup-install targets, fix build-all for package - Update .env.example to point to new config system - All 131 tests pass
This was referenced May 27, 2026
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.
Summary
Complete overhaul of CalmsToolkit configuration, performance, and code quality.
New Infrastructure
~/.config/calmstoolkit/config.json— all tools read from same filemake setup) — step-by-step prompts to generate configColorOrangefix, control sequencesToolkitConfigtype,LoadToolkitConfig()/Save()/Validate()/DefaultToolkitConfig()Bug Fixes
config.Timeoutwas dead code, all fetches hardcoded 10sconfig.Timeoutwired into sharedhttp.ClientColorOrange==ColorYellow(identical)ColorOrange= \033[38;5;208m (256-color orange)for{...}— killed via SIGKILLsignal.NotifyContext— graceful SIGINT/SIGTERMclearScreen()spawnedexec.Command("clear")\033[2J\033[HtruncateTextpanicked onmaxLen <= 3formatMoviefixedChars calculation off by 2len(timeStr) + 8Performance
errgroup(was fully sequential)http.Client{Timeout, Transport}with keep-alive (was new client per request)?pageSize=1to minimize payload (was fetching all queue items)Code Quality
calculateDateRange()helper, single sourceConfigpassed by value everywhere*CalendarToolConfigpointerSonarr-1ArrInstance.NamebuildDayContentmutated caller's sliceslices.Clone()contains/ at output end-filterflag: Comma-separated:missing,available,premieres,monitored-monitored-onlyflag-no-bannerflag — suppress header-quietflag — suppress queue warningsFile Changes
Testing
All 131 tests pass across all 5 test suites (shared + 4 tool suites).