Skip to content

Conversation

@zeekay
Copy link
Member

@zeekay zeekay commented Dec 3, 2025

Summary

  • Add hierarchical configuration system with priority: CLI flags > project config (.luxconfig.json) > global config (~/.lux/config.json) > defaults
  • Implement smart environment detection (CI, Codespace, development, production) for optimal default suggestions
  • Add config commands: lux config init, lux config set, lux config get, lux config list
  • Integrate with deploy command to use config-based numNodes

Test plan

  • All 16 globalconfig tests pass
  • Manual test: lux config init creates config with smart defaults
  • Manual test: lux config set local.numNodes 3 updates config
  • Manual test: lux config get local.numNodes shows value with source
  • Manual test: lux config list --sources shows all config values
  • Manual test: Deploy respects numNodes from config when not overridden by flag

Files changed

  • pkg/globalconfig/ - New package with config schema, loading, merging, and smart defaults
  • cmd/configcmd/ - New commands: init.go, set.go, get.go, list.go
  • cmd/configcmd/config.go - Updated to register new commands
  • cmd/networkcmd/deploy.go - Uses globalconfig for numNodes default

Add hierarchical configuration system for Lux CLI with config hierarchy:
CLI flags > project config (.luxconfig.json) > global config (~/.lux/config.json) > defaults

Features:
- Smart environment detection (CI, Codespace, development, production)
- Auto-suggested defaults based on environment
- Config commands: init, set, get, list
- Source tracking for debugging config origins
- Integration with deploy command for numNodes
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.

3 participants