pal-explorer-cli 0.4.11 → 0.4.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (99) hide show
  1. package/README.md +149 -149
  2. package/bin/pal.js +63 -2
  3. package/extensions/@palexplorer/analytics/extension.json +20 -1
  4. package/extensions/@palexplorer/analytics/index.js +19 -9
  5. package/extensions/@palexplorer/audit/extension.json +14 -0
  6. package/extensions/@palexplorer/auth-email/extension.json +15 -0
  7. package/extensions/@palexplorer/auth-oauth/extension.json +15 -0
  8. package/extensions/@palexplorer/chat/extension.json +14 -0
  9. package/extensions/@palexplorer/discovery/extension.json +17 -0
  10. package/extensions/@palexplorer/discovery/index.js +1 -1
  11. package/extensions/@palexplorer/email-notifications/extension.json +23 -0
  12. package/extensions/@palexplorer/groups/extension.json +15 -0
  13. package/extensions/@palexplorer/share-links/extension.json +15 -0
  14. package/extensions/@palexplorer/sync/extension.json +16 -0
  15. package/extensions/@palexplorer/user-mgmt/extension.json +15 -0
  16. package/lib/capabilities.js +24 -24
  17. package/lib/commands/analytics.js +175 -175
  18. package/lib/commands/api-keys.js +131 -131
  19. package/lib/commands/audit.js +235 -235
  20. package/lib/commands/auth.js +137 -137
  21. package/lib/commands/backup.js +76 -76
  22. package/lib/commands/billing.js +148 -148
  23. package/lib/commands/chat.js +217 -217
  24. package/lib/commands/cloud-backup.js +231 -231
  25. package/lib/commands/comment.js +99 -99
  26. package/lib/commands/completion.js +203 -203
  27. package/lib/commands/compliance.js +218 -218
  28. package/lib/commands/config.js +136 -136
  29. package/lib/commands/connect.js +44 -44
  30. package/lib/commands/dept.js +294 -294
  31. package/lib/commands/device.js +146 -146
  32. package/lib/commands/download.js +240 -226
  33. package/lib/commands/explorer.js +178 -178
  34. package/lib/commands/extension.js +1060 -970
  35. package/lib/commands/favorite.js +90 -90
  36. package/lib/commands/federation.js +270 -270
  37. package/lib/commands/file.js +533 -533
  38. package/lib/commands/group.js +271 -271
  39. package/lib/commands/gui-share.js +29 -29
  40. package/lib/commands/init.js +61 -61
  41. package/lib/commands/invite.js +59 -59
  42. package/lib/commands/list.js +58 -58
  43. package/lib/commands/log.js +116 -116
  44. package/lib/commands/nearby.js +108 -108
  45. package/lib/commands/network.js +251 -251
  46. package/lib/commands/notify.js +198 -198
  47. package/lib/commands/org.js +273 -273
  48. package/lib/commands/pal.js +403 -180
  49. package/lib/commands/permissions.js +216 -216
  50. package/lib/commands/pin.js +97 -97
  51. package/lib/commands/protocol.js +357 -357
  52. package/lib/commands/rbac.js +147 -147
  53. package/lib/commands/recover.js +36 -36
  54. package/lib/commands/register.js +171 -171
  55. package/lib/commands/relay.js +131 -131
  56. package/lib/commands/remote.js +368 -368
  57. package/lib/commands/revoke.js +50 -50
  58. package/lib/commands/scanner.js +280 -280
  59. package/lib/commands/schedule.js +344 -344
  60. package/lib/commands/scim.js +203 -203
  61. package/lib/commands/search.js +181 -181
  62. package/lib/commands/serve.js +438 -438
  63. package/lib/commands/server.js +350 -350
  64. package/lib/commands/share-link.js +199 -199
  65. package/lib/commands/share.js +336 -323
  66. package/lib/commands/sso.js +200 -200
  67. package/lib/commands/status.js +145 -145
  68. package/lib/commands/stream.js +562 -562
  69. package/lib/commands/su.js +187 -187
  70. package/lib/commands/sync.js +979 -979
  71. package/lib/commands/transfers.js +152 -152
  72. package/lib/commands/uninstall.js +188 -188
  73. package/lib/commands/update.js +204 -204
  74. package/lib/commands/user.js +276 -276
  75. package/lib/commands/vfs.js +84 -84
  76. package/lib/commands/web-login.js +79 -79
  77. package/lib/commands/web.js +52 -52
  78. package/lib/commands/webhook.js +180 -180
  79. package/lib/commands/whoami.js +59 -59
  80. package/lib/commands/workspace.js +121 -121
  81. package/lib/core/billing.js +16 -5
  82. package/lib/core/dhtDiscovery.js +9 -2
  83. package/lib/core/discoveryClient.js +13 -7
  84. package/lib/core/extensions.js +142 -1
  85. package/lib/core/identity.js +33 -2
  86. package/lib/core/imageProcessor.js +109 -0
  87. package/lib/core/imageTorrent.js +167 -0
  88. package/lib/core/permissions.js +1 -1
  89. package/lib/core/pro.js +11 -4
  90. package/lib/core/serverList.js +4 -1
  91. package/lib/core/shares.js +12 -1
  92. package/lib/core/signalingServer.js +14 -2
  93. package/lib/core/su.js +1 -1
  94. package/lib/core/users.js +1 -1
  95. package/lib/protocol/messages.js +12 -3
  96. package/lib/utils/explorer.js +1 -1
  97. package/lib/utils/help.js +357 -357
  98. package/lib/utils/torrent.js +1 -0
  99. package/package.json +4 -3
package/lib/utils/help.js CHANGED
@@ -1,357 +1,357 @@
1
- export const HelpRegistry = {
2
- general: {
3
- title: "Palexplorer",
4
- description: "Decentralized P2P file sharing from the command line. Share files, folders, and drives directly with your pals — no cloud required."
5
- },
6
- commands: {
7
- init: {
8
- summary: "Create a new identity",
9
- details: "Generates an Ed25519 keypair and a 24-word recovery phrase. Required before any other command.",
10
- subcommands: {},
11
- examples: [
12
- "pe init alice",
13
- "pe init bob --force"
14
- ]
15
- },
16
- whoami: {
17
- summary: "Display your current identity",
18
- details: "Shows your name, handle, public key, device ID, and creation date.",
19
- subcommands: {},
20
- examples: [
21
- "pe whoami"
22
- ]
23
- },
24
- register: {
25
- summary: "Register a handle on the discovery network",
26
- details: "Claims a unique @handle via direct signature or email OTP verification.",
27
- subcommands: {},
28
- examples: [
29
- "pe register alice",
30
- "pe register alice --email a@b.com"
31
- ]
32
- },
33
- verify: {
34
- summary: "Complete OTP email verification",
35
- details: "Finishes the email-based handle registration started by `pe register --email`.",
36
- subcommands: {},
37
- examples: [
38
- "pe verify 123456"
39
- ]
40
- },
41
- recover: {
42
- summary: "Recover identity from mnemonic phrase",
43
- details: "Restores your Ed25519 keypair from the 24-word BIP-39 phrase shown during `pe init`.",
44
- subcommands: {},
45
- examples: [
46
- "pe recover word1 word2 ... word24",
47
- "pe recover word1 word2 ... word24 -n alice"
48
- ]
49
- },
50
- share: {
51
- summary: "Share a file, folder, or drive via P2P",
52
- details: "Adds a resource to your share list. Use `pe serve` to start seeding. Supports public (global) and private (encrypted) shares.",
53
- subcommands: {},
54
- options: {
55
- "-v, --visibility <type>": "Share visibility: global or private (default: global)",
56
- "-w, --with <pals...>": "Specific pals to share with",
57
- "--with-group <group>": "Share with all members of a group"
58
- },
59
- examples: [
60
- "pe share ./photos",
61
- "pe share ./docs -v private -w alice",
62
- "pe share ./project --with-group team",
63
- "pe share ./file.zip"
64
- ]
65
- },
66
- list: {
67
- summary: "List shared resources",
68
- details: "Shows all active shares with their visibility, ID, path, and type.",
69
- subcommands: {},
70
- options: {
71
- "--by-drive": "Group shares by drive letter"
72
- },
73
- examples: [
74
- "pe list",
75
- "pe list --by-drive"
76
- ]
77
- },
78
- revoke: {
79
- summary: "Revoke access to a shared resource",
80
- details: "Removes a share entirely, or removes a specific recipient and rotates encryption keys.",
81
- subcommands: {},
82
- options: {
83
- "--pal <palId>": "Remove a specific pal (triggers key rotation)"
84
- },
85
- examples: [
86
- "pe revoke abc123",
87
- "pe revoke ./photos",
88
- "pe revoke abc123 --pal alice"
89
- ]
90
- },
91
- serve: {
92
- summary: "Start the sharing daemon",
93
- details: "Seeds all active shares via WebTorrent. Supports foreground, daemon, and web dashboard modes. Auto-resumes incomplete downloads.",
94
- subcommands: {},
95
- options: {
96
- "--daemon": "Run as background daemon",
97
- "--stop": "Stop a running daemon",
98
- "--web": "Start web dashboard alongside seeder",
99
- "--web-port <port>": "Web dashboard port (default: 8585)"
100
- },
101
- examples: [
102
- "pe serve",
103
- "pe serve --daemon",
104
- "pe serve --stop",
105
- "pe serve --web",
106
- "pe serve --web --web-port 9090"
107
- ]
108
- },
109
- download: {
110
- summary: "Download a file from a magnet link",
111
- details: "Downloads via WebTorrent. For private shares, provide the encrypted share key for automatic decryption.",
112
- subcommands: {},
113
- options: {
114
- "--key <encryptedShareKey>": "Encrypted share key for private share decryption"
115
- },
116
- examples: [
117
- 'pe download "magnet:?xt=urn:btih:..."',
118
- 'pe download "magnet:?xt=..." --key abc123'
119
- ]
120
- },
121
- pal: {
122
- summary: "Manage your list of pals (friends)",
123
- details: "Add pals by @handle, invite link, or raw public key. Remove pals with automatic key rotation for affected shares.",
124
- subcommands: {
125
- add: "Add a pal by @handle, invite link (pal://...), or public key",
126
- list: "List all your pals",
127
- remove: "Remove a pal (rotates affected share keys)"
128
- },
129
- examples: [
130
- "pe pal add @alice",
131
- "pe pal add pal://... bob",
132
- "pe pal add abc123def456 carol",
133
- "pe pal list",
134
- "pe pal remove @alice"
135
- ]
136
- },
137
- invite: {
138
- summary: "Generate a magic invite link",
139
- details: "Creates a pal:// link containing your public key, handle, and name. Share it with anyone to let them add you.",
140
- subcommands: {},
141
- options: {
142
- "--qr": "Render the invite as a QR code in the terminal"
143
- },
144
- examples: [
145
- "pe invite",
146
- "pe invite --qr"
147
- ]
148
- },
149
- nearby: {
150
- summary: "Discover nearby pals on the LAN",
151
- details: "Uses mDNS (Bonjour) to find other Palexplorer users on the local network.",
152
- subcommands: {},
153
- options: {
154
- "--add": "Auto-add discovered pals",
155
- "--time <seconds>": "Scan duration (default: 10)"
156
- },
157
- examples: [
158
- "pe nearby",
159
- "pe nearby --add",
160
- "pe nearby --time 30"
161
- ]
162
- },
163
- group: {
164
- summary: "Manage sharing groups",
165
- details: "Create named groups of pals for easy bulk sharing with `pe share --with-group`.",
166
- subcommands: {
167
- create: "Create a new group",
168
- add: "Add a pal to a group",
169
- remove: "Remove a pal from a group",
170
- list: "List all groups and members",
171
- delete: "Delete a group"
172
- },
173
- examples: [
174
- "pe group create team",
175
- "pe group add team @alice",
176
- "pe group remove team @alice",
177
- "pe group list",
178
- "pe group delete team"
179
- ]
180
- },
181
- sync: {
182
- summary: "Sync a directory with a pal",
183
- details: "Builds a file manifest and sends it to a pal via the discovery server. Supports one-time and continuous (watch) modes.",
184
- subcommands: {},
185
- options: {
186
- "--watch": "Watch for changes and continuously sync",
187
- "--list": "List all sync pairs",
188
- "--remove <id>": "Remove a sync pair"
189
- },
190
- examples: [
191
- "pe sync ./project @alice",
192
- "pe sync --watch ./docs @bob",
193
- "pe sync --list",
194
- "pe sync --remove <id>"
195
- ]
196
- },
197
- transfers: {
198
- summary: "View and manage file transfers",
199
- details: "Shows active and completed transfers. Supports pause, resume, and cancel operations.",
200
- subcommands: {
201
- cancel: "Remove a transfer from tracking",
202
- pause: "Pause a transfer",
203
- resume: "Resume a paused transfer"
204
- },
205
- options: {
206
- "--history": "Show completed transfers"
207
- },
208
- examples: [
209
- "pe transfers",
210
- "pe transfers --history",
211
- "pe transfers cancel <magnet>",
212
- "pe transfers pause <magnet>",
213
- "pe transfers resume <magnet>"
214
- ]
215
- },
216
- config: {
217
- summary: "View and manage configuration",
218
- details: "Get, set, list, and reset configuration values like port, storage path, bandwidth cap, and discovery URL.",
219
- subcommands: {
220
- list: "Show all current settings and known keys",
221
- get: "Get a single config value",
222
- set: "Set a config value",
223
- reset: "Clear all custom settings"
224
- },
225
- examples: [
226
- "pe config list",
227
- "pe config get theme",
228
- "pe config set theme dark",
229
- "pe config reset"
230
- ]
231
- },
232
- device: {
233
- summary: "View and manage this device",
234
- details: "Rename your device, register it with the discovery server, or list all devices under a handle.",
235
- subcommands: {
236
- rename: "Set a unique name for this device",
237
- register: "Register device with the discovery server",
238
- list: "List all devices registered under a handle"
239
- },
240
- examples: [
241
- "pe device",
242
- "pe device list @alice",
243
- 'pe device rename "My Laptop"',
244
- "pe device register alice"
245
- ]
246
- },
247
- server: {
248
- summary: "Provision and manage server nodes",
249
- details: "Install pe serve as a system service, configure server parameters, register with discovery, and check status. Supports Windows (schtasks), Linux (systemd), and macOS (launchd).",
250
- subcommands: {
251
- install: "Install as a background service (cross-platform)",
252
- config: "Set server-specific operational parameters",
253
- register: "Register this server node with the discovery network",
254
- status: "Check server health and network connectivity"
255
- },
256
- examples: [
257
- "pe server install",
258
- "pe server status",
259
- "pe server config port 8080",
260
- "pe server register mynode"
261
- ]
262
- },
263
- explorer: {
264
- summary: "Manage file manager integration",
265
- details: "Adds or removes a 'Share with Pal' context menu entry in Windows Explorer, macOS Finder, or Linux Nautilus.",
266
- subcommands: {
267
- install: "Install context menu for your platform",
268
- uninstall: "Remove context menu entry"
269
- },
270
- examples: [
271
- "pe explorer install",
272
- "pe explorer uninstall"
273
- ]
274
- },
275
- status: {
276
- summary: "Show system health dashboard",
277
- details: "Displays identity, daemon status, active shares, transfers, and discovery server connectivity at a glance.",
278
- subcommands: {},
279
- examples: [
280
- "pe status"
281
- ]
282
- },
283
- log: {
284
- summary: "View application logs",
285
- details: "Shows recent log entries from ~/.pal/logs/pal.log. Supports filtering by level and real-time tailing.",
286
- subcommands: {},
287
- options: {
288
- "--tail": "Follow new log entries in real-time",
289
- "--level <level>": "Filter by level (debug/info/warn/error)",
290
- "-n, --lines <count>": "Number of recent lines to show (default: 20)"
291
- },
292
- examples: [
293
- "pe log",
294
- "pe log --tail",
295
- "pe log --level error",
296
- "pe log -n 50"
297
- ]
298
- },
299
- completion: {
300
- summary: "Generate shell completion script",
301
- details: "Outputs a completion script for bash or zsh. Source it in your shell profile for tab completion.",
302
- subcommands: {},
303
- options: {
304
- "--shell <shell>": "Shell type: bash or zsh (default: bash)"
305
- },
306
- examples: [
307
- "pe completion",
308
- "pe completion --shell zsh",
309
- "source <(pe completion)"
310
- ]
311
- },
312
- web: {
313
- summary: "Open the web dashboard",
314
- details: "Opens the web dashboard in your default browser. Requires `pe serve --web` to be running first.",
315
- subcommands: {},
316
- options: {
317
- "--port <port>": "Web dashboard port (default: 8585)",
318
- "--url-only": "Just print the URL without opening browser"
319
- },
320
- examples: [
321
- "pe web",
322
- "pe web --url-only",
323
- "pe web --port 9090"
324
- ]
325
- },
326
- vfs: {
327
- summary: "Manage the virtual filesystem drive",
328
- details: "Mounts your shared files as a virtual drive letter via WebDAV. Requires WinFSP on Windows or FUSE on Linux/macOS.",
329
- subcommands: {
330
- mount: "Mount virtual drive (default P:)",
331
- unmount: "Unmount virtual drive",
332
- status: "Show mount status and listed shares"
333
- },
334
- examples: [
335
- "pe vfs mount",
336
- "pe vfs mount S",
337
- "pe vfs unmount",
338
- "pe vfs status"
339
- ]
340
- }
341
- },
342
- gui: {
343
- transfers: "The Transfer Manager shows all active uploads (seeding) and downloads. You can pause or cancel transfers here.",
344
- inbox: "View and accept share invitations from your pals. Clicking 'Download' will add the resource to your Transfers.",
345
- pals: "Manage your social circle. Search for friends by their verified email handles."
346
- }
347
- };
348
-
349
- export const getHelp = (topic) => {
350
- const parts = topic.split('.');
351
- let current = HelpRegistry;
352
- for (const part of parts) {
353
- if (current[part]) current = current[part];
354
- else return null;
355
- }
356
- return current;
357
- };
1
+ export const HelpRegistry = {
2
+ general: {
3
+ title: "Palexplorer",
4
+ description: "Decentralized P2P file sharing from the command line. Share files, folders, and drives directly with your pals — no cloud required."
5
+ },
6
+ commands: {
7
+ init: {
8
+ summary: "Create a new identity",
9
+ details: "Generates an Ed25519 keypair and a 24-word recovery phrase. Required before any other command.",
10
+ subcommands: {},
11
+ examples: [
12
+ "pal init alice",
13
+ "pal init bob --force"
14
+ ]
15
+ },
16
+ whoami: {
17
+ summary: "Display your current identity",
18
+ details: "Shows your name, handle, public key, device ID, and creation date.",
19
+ subcommands: {},
20
+ examples: [
21
+ "pal whoami"
22
+ ]
23
+ },
24
+ register: {
25
+ summary: "Register a handle on the discovery network",
26
+ details: "Claims a unique @handle via direct signature or email OTP verification.",
27
+ subcommands: {},
28
+ examples: [
29
+ "pal register alice",
30
+ "pal register alice --email a@b.com"
31
+ ]
32
+ },
33
+ verify: {
34
+ summary: "Complete OTP email verification",
35
+ details: "Finishes the email-based handle registration started by `pal register --email`.",
36
+ subcommands: {},
37
+ examples: [
38
+ "pal verify 123456"
39
+ ]
40
+ },
41
+ recover: {
42
+ summary: "Recover identity from mnemonic phrase",
43
+ details: "Restores your Ed25519 keypair from the 24-word BIP-39 phrase shown during `pal init`.",
44
+ subcommands: {},
45
+ examples: [
46
+ "pal recover word1 word2 ... word24",
47
+ "pal recover word1 word2 ... word24 -n alice"
48
+ ]
49
+ },
50
+ share: {
51
+ summary: "Share a file, folder, or drive via P2P",
52
+ details: "Adds a resource to your share list. Use `pal serve` to start seeding. Supports public (global) and private (encrypted) shares.",
53
+ subcommands: {},
54
+ options: {
55
+ "-v, --visibility <type>": "Share visibility: global or private (default: global)",
56
+ "-w, --with <pals...>": "Specific pals to share with",
57
+ "--with-group <group>": "Share with all members of a group"
58
+ },
59
+ examples: [
60
+ "pal share ./photos",
61
+ "pal share ./docs -v private -w alice",
62
+ "pal share ./project --with-group team",
63
+ "pal share ./file.zip"
64
+ ]
65
+ },
66
+ list: {
67
+ summary: "List shared resources",
68
+ details: "Shows all active shares with their visibility, ID, path, and type.",
69
+ subcommands: {},
70
+ options: {
71
+ "--by-drive": "Group shares by drive letter"
72
+ },
73
+ examples: [
74
+ "pal list",
75
+ "pal list --by-drive"
76
+ ]
77
+ },
78
+ revoke: {
79
+ summary: "Revoke access to a shared resource",
80
+ details: "Removes a share entirely, or removes a specific recipient and rotates encryption keys.",
81
+ subcommands: {},
82
+ options: {
83
+ "--pal <palId>": "Remove a specific pal (triggers key rotation)"
84
+ },
85
+ examples: [
86
+ "pal revoke abc123",
87
+ "pal revoke ./photos",
88
+ "pal revoke abc123 --pal alice"
89
+ ]
90
+ },
91
+ serve: {
92
+ summary: "Start the sharing daemon",
93
+ details: "Seeds all active shares via WebTorrent. Supports foreground, daemon, and web dashboard modes. Auto-resumes incomplete downloads.",
94
+ subcommands: {},
95
+ options: {
96
+ "--daemon": "Run as background daemon",
97
+ "--stop": "Stop a running daemon",
98
+ "--web": "Start web dashboard alongside seeder",
99
+ "--web-port <port>": "Web dashboard port (default: 8585)"
100
+ },
101
+ examples: [
102
+ "pal serve",
103
+ "pal serve --daemon",
104
+ "pal serve --stop",
105
+ "pal serve --web",
106
+ "pal serve --web --web-port 9090"
107
+ ]
108
+ },
109
+ download: {
110
+ summary: "Download a file from a magnet link",
111
+ details: "Downloads via WebTorrent. For private shares, provide the encrypted share key for automatic decryption.",
112
+ subcommands: {},
113
+ options: {
114
+ "--key <encryptedShareKey>": "Encrypted share key for private share decryption"
115
+ },
116
+ examples: [
117
+ 'pal download "magnet:?xt=urn:btih:..."',
118
+ 'pal download "magnet:?xt=..." --key abc123'
119
+ ]
120
+ },
121
+ pal: {
122
+ summary: "Manage your list of pals (friends)",
123
+ details: "Add pals by @handle, invite link, or raw public key. Remove pals with automatic key rotation for affected shares.",
124
+ subcommands: {
125
+ add: "Add a pal by @handle, invite link (pal://...), or public key",
126
+ list: "List all your pals",
127
+ remove: "Remove a pal (rotates affected share keys)"
128
+ },
129
+ examples: [
130
+ "pal pal add @alice",
131
+ "pal pal add pal://... bob",
132
+ "pal pal add abc123def456 carol",
133
+ "pal pal list",
134
+ "pal pal remove @alice"
135
+ ]
136
+ },
137
+ invite: {
138
+ summary: "Generate a magic invite link",
139
+ details: "Creates a pal:// link containing your public key, handle, and name. Share it with anyone to let them add you.",
140
+ subcommands: {},
141
+ options: {
142
+ "--qr": "Render the invite as a QR code in the terminal"
143
+ },
144
+ examples: [
145
+ "pal invite",
146
+ "pal invite --qr"
147
+ ]
148
+ },
149
+ nearby: {
150
+ summary: "Discover nearby pals on the LAN",
151
+ details: "Uses mDNS (Bonjour) to find other Palexplorer users on the local network.",
152
+ subcommands: {},
153
+ options: {
154
+ "--add": "Auto-add discovered pals",
155
+ "--time <seconds>": "Scan duration (default: 10)"
156
+ },
157
+ examples: [
158
+ "pal nearby",
159
+ "pal nearby --add",
160
+ "pal nearby --time 30"
161
+ ]
162
+ },
163
+ group: {
164
+ summary: "Manage sharing groups",
165
+ details: "Create named groups of pals for easy bulk sharing with `pal share --with-group`.",
166
+ subcommands: {
167
+ create: "Create a new group",
168
+ add: "Add a pal to a group",
169
+ remove: "Remove a pal from a group",
170
+ list: "List all groups and members",
171
+ delete: "Delete a group"
172
+ },
173
+ examples: [
174
+ "pal group create team",
175
+ "pal group add team @alice",
176
+ "pal group remove team @alice",
177
+ "pal group list",
178
+ "pal group delete team"
179
+ ]
180
+ },
181
+ sync: {
182
+ summary: "Sync a directory with a pal",
183
+ details: "Builds a file manifest and sends it to a pal via the discovery server. Supports one-time and continuous (watch) modes.",
184
+ subcommands: {},
185
+ options: {
186
+ "--watch": "Watch for changes and continuously sync",
187
+ "--list": "List all sync pairs",
188
+ "--remove <id>": "Remove a sync pair"
189
+ },
190
+ examples: [
191
+ "pal sync ./project @alice",
192
+ "pal sync --watch ./docs @bob",
193
+ "pal sync --list",
194
+ "pal sync --remove <id>"
195
+ ]
196
+ },
197
+ transfers: {
198
+ summary: "View and manage file transfers",
199
+ details: "Shows active and completed transfers. Supports pause, resume, and cancel operations.",
200
+ subcommands: {
201
+ cancel: "Remove a transfer from tracking",
202
+ pause: "Pause a transfer",
203
+ resume: "Resume a paused transfer"
204
+ },
205
+ options: {
206
+ "--history": "Show completed transfers"
207
+ },
208
+ examples: [
209
+ "pal transfers",
210
+ "pal transfers --history",
211
+ "pal transfers cancel <magnet>",
212
+ "pal transfers pause <magnet>",
213
+ "pal transfers resume <magnet>"
214
+ ]
215
+ },
216
+ config: {
217
+ summary: "View and manage configuration",
218
+ details: "Get, set, list, and reset configuration values like port, storage path, bandwidth cap, and discovery URL.",
219
+ subcommands: {
220
+ list: "Show all current settings and known keys",
221
+ get: "Get a single config value",
222
+ set: "Set a config value",
223
+ reset: "Clear all custom settings"
224
+ },
225
+ examples: [
226
+ "pal config list",
227
+ "pal config get theme",
228
+ "pal config set theme dark",
229
+ "pal config reset"
230
+ ]
231
+ },
232
+ device: {
233
+ summary: "View and manage this device",
234
+ details: "Rename your device, register it with the discovery server, or list all devices under a handle.",
235
+ subcommands: {
236
+ rename: "Set a unique name for this device",
237
+ register: "Register device with the discovery server",
238
+ list: "List all devices registered under a handle"
239
+ },
240
+ examples: [
241
+ "pal device",
242
+ "pal device list @alice",
243
+ 'pal device rename "My Laptop"',
244
+ "pal device register alice"
245
+ ]
246
+ },
247
+ server: {
248
+ summary: "Provision and manage server nodes",
249
+ details: "Install pal serve as a system service, configure server parameters, register with discovery, and check status. Supports Windows (schtasks), Linux (systemd), and macOS (launchd).",
250
+ subcommands: {
251
+ install: "Install as a background service (cross-platform)",
252
+ config: "Set server-specific operational parameters",
253
+ register: "Register this server node with the discovery network",
254
+ status: "Check server health and network connectivity"
255
+ },
256
+ examples: [
257
+ "pal server install",
258
+ "pal server status",
259
+ "pal server config port 8080",
260
+ "pal server register mynode"
261
+ ]
262
+ },
263
+ explorer: {
264
+ summary: "Manage file manager integration",
265
+ details: "Adds or removes a 'Share with Pal' context menu entry in Windows Explorer, macOS Finder, or Linux Nautilus.",
266
+ subcommands: {
267
+ install: "Install context menu for your platform",
268
+ uninstall: "Remove context menu entry"
269
+ },
270
+ examples: [
271
+ "pal explorer install",
272
+ "pal explorer uninstall"
273
+ ]
274
+ },
275
+ status: {
276
+ summary: "Show system health dashboard",
277
+ details: "Displays identity, daemon status, active shares, transfers, and discovery server connectivity at a glance.",
278
+ subcommands: {},
279
+ examples: [
280
+ "pal status"
281
+ ]
282
+ },
283
+ log: {
284
+ summary: "View application logs",
285
+ details: "Shows recent log entries from ~/.pal/logs/pal.log. Supports filtering by level and real-time tailing.",
286
+ subcommands: {},
287
+ options: {
288
+ "--tail": "Follow new log entries in real-time",
289
+ "--level <level>": "Filter by level (debug/info/warn/error)",
290
+ "-n, --lines <count>": "Number of recent lines to show (default: 20)"
291
+ },
292
+ examples: [
293
+ "pal log",
294
+ "pal log --tail",
295
+ "pal log --level error",
296
+ "pal log -n 50"
297
+ ]
298
+ },
299
+ completion: {
300
+ summary: "Generate shell completion script",
301
+ details: "Outputs a completion script for bash or zsh. Source it in your shell profile for tab completion.",
302
+ subcommands: {},
303
+ options: {
304
+ "--shell <shell>": "Shell type: bash or zsh (default: bash)"
305
+ },
306
+ examples: [
307
+ "pal completion",
308
+ "pal completion --shell zsh",
309
+ "source <(pal completion)"
310
+ ]
311
+ },
312
+ web: {
313
+ summary: "Open the web dashboard",
314
+ details: "Opens the web dashboard in your default browser. Requires `pal serve --web` to be running first.",
315
+ subcommands: {},
316
+ options: {
317
+ "--port <port>": "Web dashboard port (default: 8585)",
318
+ "--url-only": "Just print the URL without opening browser"
319
+ },
320
+ examples: [
321
+ "pal web",
322
+ "pal web --url-only",
323
+ "pal web --port 9090"
324
+ ]
325
+ },
326
+ vfs: {
327
+ summary: "Manage the virtual filesystem drive",
328
+ details: "Mounts your shared files as a virtual drive letter via WebDAV. Requires WinFSP on Windows or FUSE on Linux/macOS.",
329
+ subcommands: {
330
+ mount: "Mount virtual drive (default P:)",
331
+ unmount: "Unmount virtual drive",
332
+ status: "Show mount status and listed shares"
333
+ },
334
+ examples: [
335
+ "pal vfs mount",
336
+ "pal vfs mount S",
337
+ "pal vfs unmount",
338
+ "pal vfs status"
339
+ ]
340
+ }
341
+ },
342
+ gui: {
343
+ transfers: "The Transfer Manager shows all active uploads (seeding) and downloads. You can pause or cancel transfers here.",
344
+ inbox: "View and accept share invitations from your pals. Clicking 'Download' will add the resource to your Transfers.",
345
+ pals: "Manage your social circle. Search for friends by their verified email handles."
346
+ }
347
+ };
348
+
349
+ export const getHelp = (topic) => {
350
+ const parts = topic.split('.');
351
+ let current = HelpRegistry;
352
+ for (const part of parts) {
353
+ if (current[part]) current = current[part];
354
+ else return null;
355
+ }
356
+ return current;
357
+ };