@doubling/compound-sync 1.3.0 → 1.3.1

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 (2) hide show
  1. package/package.json +1 -1
  2. package/sync.js +27 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@doubling/compound-sync",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "description": "Bidirectional sync between Compound and local markdown files",
5
5
  "type": "module",
6
6
  "bin": {
package/sync.js CHANGED
@@ -11,7 +11,9 @@
11
11
  * Shared by Me/ ← symlinks to files you've shared
12
12
  * Shared with Me/ ← files shared with you (read-only)
13
13
  *
14
- * Usage: node sync.js [--config <file>] [--setup]
14
+ * Usage: node sync.js [--config <file>] [--setup] [--env <name>]
15
+ * node sync.js --version
16
+ * node sync.js --help
15
17
  */
16
18
 
17
19
  import { initializeApp } from 'firebase/app';
@@ -420,6 +422,30 @@ async function initAppCheck(app, auth, tokenEndpoint) {
420
422
  // --- Config ---
421
423
 
422
424
  const args = process.argv.slice(2);
425
+
426
+ // Handle --version and --help early so they short-circuit before any
427
+ // Firebase init or browser-auth side effects.
428
+ if (args.includes('--version') || args.includes('-v')) {
429
+ const pkg = JSON.parse(fs.readFileSync(path.join(__dirname, 'package.json'), 'utf-8'));
430
+ console.log(pkg.version);
431
+ process.exit(0);
432
+ }
433
+
434
+ if (args.includes('--help') || args.includes('-h')) {
435
+ console.log(`compound-sync - Doubling Compound sync daemon
436
+
437
+ Usage:
438
+ compound-sync Start the daemon (interactive setup on first run)
439
+ compound-sync --config <file> Use a specific config file
440
+ compound-sync --setup Force the setup wizard
441
+ compound-sync --env <name> Override env (sandbox|dev|prod)
442
+ compound-sync --version, -v Print version and exit
443
+ compound-sync --help, -h Print this help and exit
444
+
445
+ More: https://github.com/Doubling-Inc/doubling-compound`);
446
+ process.exit(0);
447
+ }
448
+
423
449
  let configFile = 'config.json';
424
450
  let forceSetup = false;
425
451
  let envOverride = null;