fix(cli): stop --print-effective-config from starting a container

argparse requires exactly one action, so the documented diagnostic form
`--print-effective-config --config … --start` never took the early-return
branch in main.run(): it printed the resolved config and then executed a
real do_start(), silently replacing a running container with the [default]
model. README, installation guide and manual all recommended that form.

Make it an action in the mutually exclusive group. It can no longer be
combined with --start/--check/--stop/--change/--chat (argparse error,
exit 2), and it skips the docker_available() check, so it now really is
the offline config check the docs promise. --dry-run remains a modifier
and still requires a reachable daemon.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Dieter Schlüter 2026-07-10 16:25:07 +02:00
commit 3e3dd1c150
8 changed files with 104 additions and 30 deletions

View file

@ -44,9 +44,10 @@ Voraussetzungen auf dem Zielsystem:
- Docker (CLI + laufender Daemon), für `--start`/--check`/--stop`/--change`
- Netzwerkzugriff auf den Container-Host-Port für `--chat`/--check`
`--print-effective-config` und `--dry-run` benötigen keinen laufenden Docker-Daemon
für die reine Konfigurationsprüfung; `--start`/--check`/--stop`/--change` erfordern
einen erreichbaren Docker-Daemon.
`--print-effective-config` ist eine eigenständige, nebenwirkungsfreie Aktion und
benötigt keinen laufenden Docker-Daemon. `--start`/--check`/--stop`/--change`
erfordern einen erreichbaren Docker-Daemon — auch zusammen mit `--dry-run`, weil
die Verfügbarkeit geprüft wird, bevor der Trockenlauf greift.
## Konfiguration
@ -93,8 +94,8 @@ llamacppctl --start --config llama.cpp.config
# Nur den geplanten docker-run-Befehl anzeigen, nichts ausführen
llamacppctl --start --config llama.cpp.config --dry-run
# Effektive Konfiguration als JSON ausgeben
llamacppctl --print-effective-config --config llama.cpp.config --start
# Effektive Konfiguration als JSON ausgeben (startet nichts, braucht kein Docker)
llamacppctl --print-effective-config --config llama.cpp.config
# Status prüfen
llamacppctl --check --config llama.cpp.config