Update
dkit update --check # is there a newer release? changes nothing
dkit update # download it, check it, replace this dkit
Brings dkit up to date, for a copy that the install script or a manual download put in place.
This is the only command that uses the network, and only when you run it. Deskit never looks for updates by itself: not when it starts, not in the background, not from any other command. It sends nothing about you or your machine; it fetches up to three files from the project’s releases.
What it does
- Works out how this copy was installed, from where the program file is.
- Reads the release’s
version.txtwith your system’s owncurl: one line holding the version, such as0.2.0.--checkstops here, and so does an update when you already have that version. - Asks before going on, in a terminal.
- Downloads the release for your system.
- Downloads the release’s published SHA-256 checksum and compares it with the download. If the checksum is missing, is not a checksum, or does not match, the update stops and nothing is changed. This is never only a warning.
- Unpacks the program with your system’s
tarand runs it once (dkit --version), to be sure it works on this machine and is the version the release said it was. If it is not, the update stops and nothing is changed. - Writes the new program beside the old one, then renames it over the old one.
dkitis at every moment either the old program or the new one, whole, so an update that is interrupted leaves the old one working. The file keeps its permissions.
These are the same files, from the same place, that the install script uses.
Copies it leaves alone
A copy that something else installed is that tool’s to update. dkit update says so, shows the command, changes nothing, uses no network, and exits with code 0:
| Installed with | Recognised by | What to run instead |
|---|---|---|
| Homebrew | the program is under Homebrew’s folders | brew upgrade deskitdev/tap/deskit |
| cargo | the program is in cargo’s bin folder |
cargo install --git https://github.com/deskitdev/deskit deskit |
| a build from source | the program is in a folder cargo builds into | cargo build |
Links are followed first, so a dkit that Homebrew linked into its bin folder is recognised as Homebrew’s.
Options
| Option | What it does |
|---|---|
--check |
Only says which version you have and which is the latest. Changes nothing |
--yes, -y |
Update without asking. Needed when not in a terminal |
--force |
Install the release even when it is not newer, for example to repair a damaged copy |
--json |
Print the result as JSON |
In a terminal, dkit update shows the two versions and asks before replacing anything; pressing return means yes. Outside a terminal it refuses without --yes, before anything is downloaded.
When you already have the latest release it says so and exits with code 0. If your copy is newer than the latest release, it is left alone unless you pass --force.
--check reads only version.txt, a few bytes. It downloads no program and runs nothing it fetched.
It never asks for administrator rights
If the folder that holds dkit cannot be written to, the update stops before downloading anything and says so. Update that copy the way it was installed, or move dkit to a folder you own, such as ~/.local/bin. Do not run sudo dkit update.
Output
dkit update --check --json
{
"current": "0.1.0",
"latest": "0.2.0",
"state": "available",
"path": "/Users/sam/.local/bin/dkit",
"origin": "standalone",
"command": null
}
stateisup_to_date,available(a newer release exists; nothing was changed),updated,ahead(this copy is newer than the release) ormanaged(left to Homebrew, cargo or a build).originisstandalone,homebrew,cargoorbuild.latestisnullandcommandholds the command to run whenstateismanaged.
Settings for testing
The two settings the install script reads work here as well:
| Variable | Meaning |
|---|---|
DESKIT_VERSION |
A release tag such as v0.2.0, to install that release and not the latest. The version is then taken from the tag, and version.txt is not read |
DESKIT_DOWNLOAD_BASE |
A folder or address holding the release files, used in place of the project’s releases. A folder may be given as a path or as file:// |
Known limits
- The checksum proves the download arrived as it was published. It is fetched from the same place as the download, so it does not prove who published it. Releases are not signed yet.
curlis looked for at/usr/bin/curland/bin/curl, andtarin the same two folders; on Windows both are taken fromSystem32. A system that keeps them elsewhere cannot use this command.- Only releases that are published can be installed: macOS and Linux on arm64 and x86-64, and Windows on x86-64. On Linux the release is the statically linked build, whatever your copy was.
- Tried on macOS only. On Windows a running program cannot be overwritten, so the old
dkit.exeis renamed todkit.exe.oldfirst and the new one takes its name; the old file stays until the next update. That path has not been run on a real Windows machine. - An assistant cannot do this for you: there is no MCP tool for it.
From docs/commands/update.md at v0.1.0-alpha.2.