Repository navigation
feat(cli): let the login agent take its key from a key file - #2318
Merged
Merged
Conversation
aicayzer
force-pushed
the
feat/cli-autostart-key-file
branch
from
October 22, 2026 19:33
01b595c to
e0c72f9
Compare
aicayzer
marked this pull request as ready for review
October 22, 2026 19:33
aicayzer
enabled auto-merge (squash)
October 22, 2026 19:33
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
marfa folders autostart on --key-file <path>makes the login agent run the folder watch with a key file in place of the keychain, so a machine where nobody signs in to unlock the keychain can keep folders in step without raising a dialog. Without the option nothing changes.marfa folders watch --key-fileis the same thing for a watch started by hand or by a script.Closes #2313
Changes
MARFA_API_URLandMARFA_API_KEY. The rules are on the file, not the place: it must exist, be a regular file with one name (no hard link, which could put a second name inside a folder), not be a symbolic link, belong to the user running the command, be unreadable by group and others (mode 600 or stricter), hold aMARFA_API_URLline that is a server address and aMARFA_API_KEYline, and lie outside every folder the registry lists (and outside the folder being watched), because a key inside a synced folder would be sent to the server as one of its files. A fault exits 1 withinvalid, names the file and the reason, and never prints a value.folders watch --key-file <path> --log <log>), never the address or key, and the watch reads and checks the file again each time it opens a folder, so a key rotated in the file is the one used at the next open, and a file that has become unsafe, or lies inside a folder added since, is refused for that folder alone while the others go on. A watch of one directory reads it at its start.autostart onchecks the file first and writes nothing if it is refused.autostart onrun again without the option replaces the agent and goes back to the keychain; run again with the same file it changes nothing.autostart statusand theonreport showkey_file.folders/autostart-key-file,folders/autostart-key-file-refused,folders/watch-key-file, withautostart-no-credentialandautostart-statusamended. The command reference is regenerated.Testing
cargo test -p marfa-cli,cargo clippy -p marfa-cli --all-targets -- -D warnings,cargo fmt --checkandpnpm format:checkpass.export, comments) and for the agent file (the path is there, no address, key or--keyis).folders-autostart.test.ts. They run the real agent through the stand-in service manager and a scripted server: the key from the file reaches the server and is the only credential sent, with a keychain that holds nothing and cannot be asked; a folder of another server never receives it; every refusal writes no agent. They fail with themarfabuild frommain. The inside-a-folder fixture caught a first version that listed the registry through a call that also rewrites it; it now reads the file without writing.credentials::turn_off()is removed and holds a keychain credential for the folder's server as its witness.Notes for reviewers
chmodadvice.Checklist