TheDocumentation Index
Fetch the complete documentation index at: https://theseventeen-2abbdf80.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
upgrade command updates the stored SHA-256 hash for a binary that already exists in config.json. Because keychain-auth uses cryptographic hash verification to identify callers, every time a binary is updated — by a package manager, manual install, or build — its hash changes. The daemon will reject the updated binary as unrecognized until the hash in config.json is refreshed. Running upgrade recomputes the hash and updates the config in place, without changing the binary’s configured service permissions.
Why upgrades are necessary
keychain-auth identifies every binary by both its path on disk and its SHA-256 hash. When you update a tool — for example, by runningbrew upgrade mytool or pip install --upgrade mytool — the binary at that path is replaced with a new version. The new binary has a different hash, so the daemon treats it as an unregistered binary and rejects its connections.
Rather than going through the full registration or approval flow again, upgrade handles this case: it reads the new binary, computes the updated hash, and overwrites only the hash field in the existing config.json entry. Your allowed_read_services, allowed_write_services, and can_search settings are preserved exactly as they were.
Usage
PATH:
Adding upgrade to post-install hooks
To make the process seamless for users of your tool, add theupgrade call to your package manager’s post-install or post-upgrade hook. For example, in a shell-based installer script:
When to use register instead
upgrade only works for binaries already present in config.json. If the binary path has changed — for example, the binary moved from /usr/bin/mytool to /usr/local/bin/mytool — you must use keychain-auth register to add the new path as a fresh entry.
If you run upgrade on a path that is not registered, the command will exit with an error:
If the binary was moved to a new path and you want to preserve its permissions, register the new path, then manually copy the
allowed_read_services, allowed_write_services, and can_search values from the old entry in ~/.config/keychain-auth/config.json to the new one.