troupe login links the daemon on this machine with the plane token there and then, starting the installed troupe-daemon where none runs, and troupe config offers the plane the machine is signed in to instead of a second sign-in¶
TUI decision 168 · accepted · 2026-10-27
Root Decision 958. The installer's troupe config ran troupe login, which wrote
credentials.json and nothing more: the daemon was linked only when a troupe session
next attached (root 764), so a machine set up by the installer, with the daemon started at
login, had a daemon nobody had linked until somebody opened the terminal client.
- Login links. After the credentials are saved,
login/2connects to the daemon (Troupe.Protocol.Daemon.connect/1, through the protocol door), asksidentity.get, and where the daemon is unlinked or linked to this person at this plane sendsidentity.linkwith the plane token, asLinkdoes on attach; the ownership test and the link's params areLink.ours/3andLink.link_params/3, public now, so the two cannot drift. It says who the daemon is linked to, or that it was somebody else's and left, or that it could not be reached. Thedaemon:option goes to the connect, and the tests passspawn: falseso notroupe-daemonon a developer'sPATHis started. - Starting the daemon. Where none is running, the installed
troupe-daemonis started, astroupewould start one: the label persists inidentity.json, and a daemon that restarts later is handed the token by the first client to connect. A machine with notroupe-daemoninstalled is told, andtroupelinks the daemon it embeds when it next opens. Not embedded here: a daemon embedded introupe logindies with the command. troupe configreuses the sign-in. The plane choice's prompt defaults to the plane the machine is signed in to (io.signed_in, fromcredentials.json), and an answer that names it, or Enter, pulls its settings with the sign-in it has rather than running the device flow again. Another plane is signed in to as before.- Proof.
private_link_test(login links the daemon this VM embeds, with a token the fake plane honours, and says so; a daemon linked to somebody else is left with its own link and no token),config_setup_test(the prompt names the signed-in plane; Enter or the same plane pulls without a login; another plane logs in).
Governs: clients/tui/lib/troupe/cli/remote.ex, clients/tui/lib/troupe/cli/config_setup.ex, clients/tui/lib/troupe/client/daemon/link.ex