Skip to content

Add key:export, key:import and key:fingerprint - #4

Merged
kv4u merged 1 commit into
mainfrom
feat/key-commands
Oct 13, 2026
Merged

kv4u merged 1 commit into
mainfrom
feat/key-commands

Conversation

@kv4u

@kv4u kv4u commented Oct 9, 2026

Copy link
Copy Markdown
Owner

Summary

Sync and encrypted bundles only work if every machine has the same ~/.movez/key. Until now that meant finding and copying a hidden file by hand.

Command What it does
movez key:export Prints the key, or writes it to a file with --output (0600 permissions). Only the key goes to stdout, so movez key:export | ssh other movez key:import works.
movez key:import Installs a key from --file, from stdin, or from a hidden prompt, never from a command-line argument. Refuses to replace a different existing key unless --force is given, because that would make existing bundles unreadable.
movez key:fingerprint Prints a non-secret fingerprint (e.g. 0198:f427:2a27:3f58) so two machines can confirm they hold the same key.
  • doctor and sync:push show the fingerprint, and the "no encryption key" error now points to these commands.
  • The README, sync server guide and extension docs now describe this workflow instead of "copy ~/.movez/key".

Test plan

  • cd movez && php vendor/bin/pest: 101 passed, 1 skipped. New tests cover the A→B round-trip (B decrypts A's ciphertext), the overwrite guard with --force, a no-op re-import, malformed keys and the fingerprint format.
  • Manual pipe test: key:export 2>/dev/null | key:import installs the key, and both fingerprints match.

🤖 Generated with Claude Code

Sync and encrypted bundles need the same ~/.movez/key on every machine,
which meant finding and copying a hidden file by hand.

- key:export prints the key (only the key goes to stdout, so it can be
  piped over SSH) or writes it to a 0600 file with --output
- key:import reads from --file, stdin, or a hidden prompt — never from a
  command-line argument — and refuses to replace a different key without
  --force, since that would make existing bundles unreadable
- key:fingerprint prints a non-secret fingerprint to compare machines;
  doctor and sync:push show it, and the missing-key error points at the
  new commands
- Docs replace "copy ~/.movez/key" with the new workflow

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kv4u
kv4u merged commit 105cecb into main Oct 13, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant