Repository navigation
v0.2.10
The terminal and the app stop drifting apart
Installing both the desktop app and the standalone CLI leaves two copies that fall out of sync in silence — the app updates itself while ~/.local/bin/agentpit stays at whatever version it was. That is how a 0.2.5 CLI ends up sitting next to a 0.2.9 app with nothing reporting the mismatch.
Settings → アプリと更新 → BUNDLED CLI now removes the second copy instead. One click puts this bundle's CLI on your PATH, so the terminal runs the same build as the app and updating either one updates both.
Why a shim script and not a symlink
std::env::current_exe() does not resolve symlinks on macOS — measured, not assumed. So agentpit update run through a symlinked CLI hands self_replace the link's own path: the link is overwritten with a plain file, the arrangement silently undoes itself, and the bundle is never re-signed because no .app appears in that path.
exec replaces the process image, so through a shim current_exe() reports the real binary inside the bundle. The updater then replaces the sidecar in place and re-signs — the path it already knew how to handle. Update from either side and both stay correct.
The card will not overwrite a file the app did not write until you ask twice: that file is almost certainly your own standalone install. A hand-made symlink is reported as foreign for the same reason — it is exactly the arrangement that breaks.
agentpit update gained the matching guard: run through a symlink that resolves into an .app, it now refuses with the reason and points you at the desktop app, before spending a download.
Upgrading from a drifted install
If you already have a standalone CLI on PATH, update the desktop app first, then open the BUNDLED CLI card and choose 置き換えて設置. After that the standalone copy is gone and there is only one agentpit.