Skip to content

feat(cli): daily update check + README update instructions#88

Merged
mostlydev merged 3 commits intomasterfrom
feat/self-update-check
Mar 27, 2026
Merged

feat(cli): daily update check + README update instructions#88
mostlydev merged 3 commits intomasterfrom
feat/self-update-check

Conversation

@mostlydev
Copy link
Copy Markdown
Owner

@mostlydev mostlydev commented Mar 27, 2026

Summary

  • Adds cmd/claw/update_check.go: checks GitHub releases API once per hour, caches result to ~/.claw/.claw-update-check, and prints a notice to stderr at the end of any command when a newer release is available
  • Hooks into PersistentPostRun on the root command so all subcommands benefit automatically
  • Skipped entirely for dev builds (local source builds without ldflags)
  • 3-second HTTP timeout — never blocks or hangs a command; silent on any network/parse error
  • Adds claw update subcommand — pipes install.sh through sh, same verified path as initial install
  • Update notices say run: claw update instead of the raw curl
  • Adds ## Update section to README

Test plan

  • Build with go build ./cmd/claw and confirm it compiles clean
  • Run any claw subcommand — no update notice expected when on latest
  • Manually set version to an old tag (e.g. v0.1.0) via ldflags and confirm notice prints after command output
  • Confirm second run within an hour uses cache and skips the network check
  • Confirm version == "dev" suppresses the check entirely
  • claw update installs the latest release

🤖 Generated with Claude Code

claw now checks GitHub releases once per 24h and prints a notice at
the end of any command when a newer version is available. Skipped for
dev builds. Cache lives at ~/.claw/.claw-update-check. Added ## Update
section to README documenting the install.sh update path.
@mostlydev mostlydev merged commit c7d30da into master Mar 27, 2026
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.

1 participant