Skip to content

feat: auto-reload config file on changes#62

Open
hyldmo wants to merge 1 commit into
mainfrom
hyldmo/config-watch
Open

feat: auto-reload config file on changes#62
hyldmo wants to merge 1 commit into
mainfrom
hyldmo/config-watch

Conversation

@hyldmo
Copy link
Copy Markdown
Owner

@hyldmo hyldmo commented Feb 28, 2026

Summary

  • Watches the config file (numux.config.ts/.js) for changes and automatically applies updates to running processes — restarting modified, starting added, stopping removed
  • Enabled by default in TUI mode when using a config file; opt out with --no-config-watch
  • Skipped automatically for prefix mode, CLI-command mode, and all-one-shot configs

Changes

  • src/config/diff.ts — Pure diffConfigs() function comparing two configs (added/removed/modified)
  • src/config/config-watcher.tswatchConfig() using fs.watch() with 500ms debounce
  • src/config/loader.ts — Added resolveConfigPath() and cache-busting on import()
  • src/process/manager.tsapplyConfigChange() to stop/restart/start processes based on diff
  • src/ui/app.ts — Dynamic pane add/remove, config watcher lifecycle
  • src/ui/tabs.tsaddProcess()/removeProcess() for dynamic tab management
  • src/cli-flags.ts / src/cli.ts--no-config-watch flag
  • src/types.tsadded/removed event types

Test plan

  • bun test — 413/413 pass
  • bun run typecheck — clean
  • bun run lint — clean
  • Manual: run with config file, edit to add/remove/modify a process, verify live update
  • Manual: --no-config-watch disables the watcher
  • Manual: invalid config edit logs error, keeps running with old config

🤖 Generated with Claude Code

Watch the config file for changes and automatically apply updates
to running processes — restarting modified services, starting new
ones, and stopping removed ones. Enabled by default in TUI mode
when using a config file. Opt out with --no-config-watch.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant