zot/internal/agent
patriceckhart f47996bc82 agent: add 'zot update' subcommand for in-place self-update
Adds a CLI subcommand that downloads the latest GitHub release for
the current GOOS/GOARCH, verifies its sha256 against checksums.txt,
extracts the archive, and atomically replaces the running binary.

  zot update           install the latest release
  zot update --check   show whether one is available, install nothing
  zot update --help    usage

Dispatch follows the same router shape as runBotCommand /
runExtCommand in cli.go. Asset naming stays in sync with the
archives.name_template in .goreleaser.yaml (zot_<ver>_<os>_<arch>).
Reuses fetchLatestRelease + versionLess from update.go so the
"what's latest" answer is identical to the in-TUI banner.

Refuses to operate on dev builds (version 0.0.0) since the version
comparison is meaningless and we'd happily downgrade a freshly
compiled local build back to whatever ships on GitHub. $GITHUB_TOKEN
is honoured so private-repo releases work.

Unix: atomic os.Rename in place (the kernel keeps the running
binary's inode alive until exit). Windows: rename current aside
to .old, drop the new exe in, leave the .old for next-update
cleanup since the running process has it locked.
2026-05-12 21:27:11 +02:00
..
extensions feat(ext): interactive extension panels + persistence 2026-04-22 08:53:21 +02:00
modes tui: reset auto-follow baseline on new turn to stop viewport jump 2026-05-12 20:43:43 +02:00
tools telegram: let zot send images and files back through the bridge 2026-04-28 08:23:04 +02:00
args.go agent: add 'zot update' subcommand for in-place self-update 2026-05-12 21:27:11 +02:00
botcmd.go Improve Telegram status and stop commands 2026-05-07 19:05:57 +02:00
botcmd_unix.go fix ci on windows: split detach helper into posix/windows variants 2026-04-18 10:58:10 +02:00
botcmd_windows.go fix ci on windows: split detach helper into posix/windows variants 2026-04-18 10:58:10 +02:00
build.go add deepseek provider (api-key, openai-compatible v4 catalog) 2026-05-10 16:49:31 +02:00
build_test.go Support AGENTS.md context files 2026-05-09 18:37:27 +02:00
changelog.go fix(changelog): strip commit/date suffix from version strings 2026-04-25 17:50:35 +02:00
cli.go agent: add 'zot update' subcommand for in-place self-update 2026-05-12 21:27:11 +02:00
config.go add deepseek provider (api-key, openai-compatible v4 catalog) 2026-05-10 16:49:31 +02:00
extcmd.go feat: extension system (subprocess + json-rpc, any language) 2026-04-19 14:09:43 +02:00
modelsync.go add Google Gemini provider 2026-05-07 21:15:34 +02:00
rpc.go feat(ext): interactive extension panels + persistence 2026-04-22 08:53:21 +02:00
settings_store.go interactive: load resumed sessions asynchronously 2026-05-04 15:47:55 +02:00
systemprompt.go feat(tui): context diffs + framed tool blocks + paced streaming 2026-04-20 15:50:39 +02:00
update.go fix(update): re-check every launch when the cache says up-to-date 2026-04-20 18:31:51 +02:00
updatecmd.go agent: add 'zot update' subcommand for in-place self-update 2026-05-12 21:27:11 +02:00