Skip to content

v0.11.0 — Multi-Miniserver Contexts

Latest

Choose a tag to compare

@discostu105 discostu105 released this 24 Mar 06:54
ca4d193

Manage multiple Miniserver connections from a single CLI — switch between home, office, or client installations instantly. Inspired by kubectl config use-context.

✨ New: lox ctx — Context Management

lox ctx add home --host 192.168.1.100 --user admin --pass secret
lox ctx add office --host 10.0.0.50 --user admin --pass secret
lox ctx use office        # switch active context
lox ctx list              # show all contexts with ● active marker
lox ctx current           # print active context name
lox --ctx home status     # one-off command against a different context

All subcommands

Command Description
lox ctx add <name> Add a named Miniserver context
lox ctx use <name> Switch the active context
lox ctx list List all contexts (supports --json)
lox ctx current Print the active context name
lox ctx remove <name> Delete a context
lox ctx rename <old> <new> Rename a context
lox ctx init Create project-local .lox/ directory with .gitignore
lox ctx migrate Convert existing flat config to a default context
--ctx <name> Global flag — run any command against a specific context

📁 Project-Local Configs

Like .git, lox now walks up from your working directory to find project-specific Miniserver configs:

cd ~/projects/smart-home
lox ctx init --host 192.168.1.100 --user admin --pass secret
# Creates .lox/config.yaml — all lox commands in this tree use it automatically

🔀 Config Resolution Order

  1. LOX_CONFIG env var (absolute priority)
  2. Project-local .lox/config.yaml (walk up from cwd)
  3. Global ~/.lox/config.yaml (flat or multi-context)
  4. --ctx flag overrides context selection within global config

📦 New Multi-Context Config Format

active_context: home
contexts:
  home:
    host: https://192.168.1.100
    user: admin
    pass: secret
  office:
    host: https://10.0.0.50
    user: admin
    pass: secret

Existing flat configs continue to work — opt in with lox ctx migrate.

🐛 Bug Fixes

  • Gen2 Miniserver compatibility — all commands now handle numeric JSON Code/value fields returned by Gen2 firmware (previously only string values were accepted). Fixes print_resp, input set, set, and all token commands. (#99)

Install / Upgrade

# macOS / Linux (Homebrew)
brew upgrade lox

# Windows (PowerShell)
irm https://raw.githubusercontent.com/discostu105/lox/main/install.ps1 | iex

# From source
cargo install --git https://github.com/discostu105/lox --tag v0.11.0

Full Changelog: v0.10.1...v0.11.0

What's Changed

Full Changelog: v0.10.1...v0.11.0