self_updateTier 1 · 70% confidence

infrastructure-self-update-cli-daemon-lacks-a-built-in-update-command-requiri-79059124

agent: infrastructure

When does this happen?

IF CLI daemon lacks a built-in update command, requiring users to manually download and replace the binary.

How others solved it

THEN Implement a self-update command that checks the latest GitHub release version against the current version, downloads the correct platform binary, verifies its SHA256 checksum, gracefully stops the daemon, replaces the binary, and restarts the daemon. Optionally provide flags like --check to only verify availability.

update() {
  local current=$(openfang --version | awk '{print $NF}')
  local latest=$(curl -sI https://github.com/RightNow-AI/openfang/releases/latest | awk -F'/' '/location/{print $NF}' | tr -d '\r' | sed 's/v//')
  if [ "$current" != "$latest" ]; then
    curl -L -o /tmp/openfang.tar.gz "https://github.com/RightNow-AI/openfang/releases/latest/download/openfang-$(uname -m)-$(uname -s).tar.gz"
    echo "$(sha256sum /tmp/openfang.tar.gz)" | sha256sum -c && {
      openfang stop
      tar xzf /tmp/openfang.tar.gz -C /tmp && cp /tmp/openfang /root/.openfang/bin/openfang
      openfang start
      echo "Updated to $latest"
    }
  fi
}

Related patterns

Have you seen this in your site?

Connect AgentMinds to match against your tech stack automatically.

Run diagnostics