# Koshi 0.2.0 — Update command (/docs/v0.2/cli/update)



```bash
koshi update
```

The command checks GitHub Releases. When a newer version exists, it downloads
the archive for the current OS and architecture, extracts `koshi`, and replaces
the running executable.

If the current version is latest, it prints
`koshi 0.2.0 is already the latest version` and exits successfully.
Network, platform, archive, permission, and install failures return an update
error.

On Linux and macOS, the new file replaces the old one in one rename. A program
file in a root-owned directory, such as `/usr/local/bin`, is installed with
`sudo install -m 755`. On Windows, the running `koshi.exe` is renamed to
`koshi.old` and the new one takes its path; `koshi.old` is removed on a later
launch.

<Callout type="warn">
  End your running sessions before you update. A session started by the old
  binary keeps running the old build, and a newer `koshi` that shares no
  protocol version with it cannot attach to it. See
  [Version compatibility](/docs/v0.2/using/attach-and-detach#version-compatibility).
</Callout>

## Startup checks [#startup-checks]

Interactive launches can check on an interval and ask before installing:

```kdl title="koshi.kdl"
version 1

update {
    auto-check #true
    check-interval-days 14
    allow-prerelease #false
}
```

Startup check failures never block or crash a normal launch. koshi stores only
the last-check time in `update.json` in its state directory; it never rewrites
`koshi.kdl`.

`allow-prerelease #true` chooses the highest semantic version from recent
releases, including pre-releases. Otherwise koshi uses GitHub's latest stable
release.
