From 7ee68d080a50f9241683c509fd4a50728697e422 Mon Sep 17 00:00:00 2001 From: Sam Catlow Date: Mon, 10 Aug 2026 02:48:59 +1000 Subject: [PATCH] feat(archied): add -version so the installed build can be read from a shell gatewayVersion and runtimeVersion were reachable only through the chat /version command, which needs a running daemon and a configured channel. An update-check adapter has to answer "what is installed?" before it can compare against what is available, and had no way to ask. Prints one "name version" pair per line so a shell adapter can parse it without a JSON dependency. --- cmd/archied/main.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cmd/archied/main.go b/cmd/archied/main.go index 48c94920d..b884d621a 100644 --- a/cmd/archied/main.go +++ b/cmd/archied/main.go @@ -328,7 +328,16 @@ func run() int { noConfigOverlay := flag.Bool("no-config-overlay", false, "skip the runtime config overlay (recovery hatch for the DB overlay; the -config-overlay file overlay still applies)") once := flag.Bool("once", false, "run a single poll+process cycle and exit (systemd timer / testing)") requeue := flag.Int64("requeue", 0, "requeue a parked/waiting task by id (keeps its workflow), then exit unless -once is also set") + showVersion := flag.Bool("version", false, "print the gateway and runtime versions and exit") flag.Parse() + // The versions were only reachable through the chat /version command, + // which needs a running daemon and a configured channel. An update-check + // adapter has to answer "what is installed?" from a shell, so expose the + // same two values here. Machine-readable: one "name version" per line. + if *showVersion { + fmt.Printf("archied %s\narchie-agent %s\n", gatewayVersion, runtimeVersion) + return 0 + } ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt, syscall.SIGTERM) defer stop()