Work on a second machine

Work on a second machine

Run the same identity on two machines. The key crosses encrypted under a passphrase, never as plain words or a bare .loot/id.

Same identity means no loot peer add for yourself and no allowlist change: both machines are one author. Your Restricted files follow through standing self-grants, which each push deposits on the remote for your own key. For a teammate, use a grant instead.

With a forge account: loot login

The forge keeps your key encrypted under your passphrase. On the new machine, outside any repo:

loot login                  # type the code at the forge's /device page, approve, then your passphrase
loot clone <forge-url> myrepo

The login unwraps the key here and keeps it under your config directory, so loot init and loot clone use it instead of minting a new one. For <forge-url>, use the /k/… address loot remote list shows on the first machine. Run loot login inside a repo instead to give that one repo the account’s key.

A script or an agent runs the same login with no terminal. It prints the code and the page first, opens no browser, and waits while you approve the code signed in; the passphrase comes from a file only you can read, or from LOOT_PASSPHRASE:

loot login --json --identity alice --passphrase-file ~/alice.pass
# {"contract":14,"login":{"code":"BCDF-GHJK","url":"https://forge.loot.build/device","expires_in":600,"interval":5}}
# {"contract":14,"signed_in":{"forge":"https://forge.loot.build","key":"…","name":"alice","first_key":false}}

Approving the code is the one step that stays yours. A code you turn down or let lapse ends the run with login_denied or login_expired. A repo or machine that already holds a live key of the account, such as the one that ran loot account open, gets no code: the key signs the login, and signed_in is the only line.

Relay only: export and import

On the first machine:

loot id export ~/alice.id    # asks for a passphrase that encrypts the file

Move the file over a direct channel (USB, LAN copy), not a cloud drive. On the second machine:

loot clone <url> myrepo --identity alice --identity-file ~/alice.id   # asks the export passphrase

The clone takes the exported key instead of minting one, so a relay with an allowlist admits it, and it collects your standing self-grants as it goes. If the relay doesn’t list that key, the clone refuses before creating anything. Run loot id lock afterwards to keep .loot/id encrypted at rest.

With no terminal, both verbs read the passphrase from the first line of a file only you can read, or from LOOT_PASSPHRASE, and refuse at once when given neither:

loot id export ~/alice.id --passphrase-file ~/alice.pass
loot clone <url> myrepo --identity alice --identity-file ~/alice.id --passphrase-file ~/alice.pass

Check it worked

loot whoami --pubkey prints the same key on both machines, and a Restricted file reads as plaintext on the new one.

Moving work between them

Finalize and push before you leave a machine:

loot new -m "wip: parser"
loot push

On the other machine:

loot pull-grants    # keys for Restricted files the other machine changed
loot pull

Take the keys first. A pull that arrives before them leaves a changed Restricted file at its old version on disk; loot pull-grants then loot surface writes the new one.

Traps

  • Your peer list does not travel. Grants from a peer this machine has not registered are quarantined: run loot peer add here too, which applies the ones already held.
  • Editing the same change on both machines makes it divergent, marked ! in loot log (see The change DAG).
  • Do not carry the 24 words instead. loot id phrase prints the key in the clear, and says itself that it is not a second-machine route.
  • Two machines are two places to lose the key. If either is lost, rotate.