| … | … | @@ -99,6 +99,11 @@ Files: |
| 99 | 99 | files <roomId> List local files in room |
| 100 | 100 | download <roomId> <id> Download a file |
| 101 | 101 | |
| 102 | Metadata (Device Pairing): |
| 103 | meta Show MetadataBase key info |
| 104 | meta invite Get invite key for device pairing |
| 105 | meta join <key> Pair with remote device's MetadataBase |
| 106 | |
| 102 | 107 | System: |
| 103 | 108 | status Daemon status (uptime, rooms, identity) |
| 104 | 109 | version Keet version info |
| … | … | @@ -277,6 +282,9 @@ try { |
| 277 | 282 | case 'introspect': |
| 278 | 283 | await clientIntrospect(args[1]) |
| 279 | 284 | break |
| 285 | case 'meta': |
| 286 | await clientMeta(args.slice(1)) |
| 287 | break |
| 280 | 288 | default: |
| 281 | 289 | console.error(`Unknown command: ${command}`) |
| 282 | 290 | printHelp() |
| … | … | @@ -741,4 +749,49 @@ async function clientIntrospect (api) { |
| 741 | 749 | } |
| 742 | 750 | } |
| 743 | 751 | |
| 752 | async function clientMeta (subArgs) { |
| 753 | const sub = subArgs[0] |
| 754 | |
| 755 | if (!sub || sub === 'key') { |
| 756 | const result = await rpc('meta.key') |
| 757 | if (result.ok) { |
| 758 | console.log('[keet-cli] MetadataBase key:', result.data.key) |
| 759 | console.log(' writable:', result.data.writable) |
| 760 | console.log(' localKey:', result.data.localKey) |
| 761 | } else { |
| 762 | console.error('[keet-cli] Error:', result.error) |
| 763 | } |
| 764 | return |
| 765 | } |
| 766 | |
| 767 | if (sub === 'invite') { |
| 768 | const result = await rpc('meta.invite') |
| 769 | if (result.ok) { |
| 770 | console.log(result.data.key) |
| 771 | } else { |
| 772 | console.error('[keet-cli] Error:', result.error) |
| 773 | } |
| 774 | return |
| 775 | } |
| 776 | |
| 777 | if (sub === 'join') { |
| 778 | const key = subArgs[1] |
| 779 | if (!key || key.length !== 64) { |
| 780 | console.error('Usage: meta join <64-char-hex-key>') |
| 781 | return |
| 782 | } |
| 783 | const result = await rpc('meta.join', { key }) |
| 784 | if (result.ok) { |
| 785 | console.log('[keet-cli] Paired:', result.data.ok ? 'yes' : 'no') |
| 786 | console.log(' key:', result.data.key) |
| 787 | console.log(' writable:', result.data.writable) |
| 788 | } else { |
| 789 | console.error('[keet-cli] Error:', result.error) |
| 790 | } |
| 791 | return |
| 792 | } |
| 793 | |
| 794 | console.error('Usage: meta [key|invite|join <key>]') |
| 795 | } |
| 796 | |
| 744 | 797 | // (UDS client helpers moved above client switch to avoid TDZ) |