@kitelev/exocortex-cli 15.40.0 → 15.41.0

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 (3) hide show
  1. package/README.md +153 -1
  2. package/dist/index.js +2 -2
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -317,10 +317,39 @@ exocortex command start "tasks/feature.md" --vault ~/vault
317
317
  # 4. Complete when done
318
318
  exocortex command complete "tasks/feature.md" --vault ~/vault
319
319
 
320
- # 5. Archive for cleanup
320
+ # 5. Mark as archived
321
321
  exocortex command archive "tasks/feature.md" --vault ~/vault
322
322
  ```
323
323
 
324
+ ### Archive Lifecycle
325
+
326
+ ```bash
327
+ # 1. Mark completed tasks as archived (sets archived: true)
328
+ exocortex command archive "tasks/old-task.md" --vault ~/vault
329
+
330
+ # 2. Bulk move archived tasks to archive vault
331
+ npx @kitelev/exocortex-cli archive \
332
+ --vault ~/vault \
333
+ --archive-vault ~/vault-archive \
334
+ --class ems__Task --year 2025
335
+
336
+ # 3. Resolve dependency chains
337
+ npx @kitelev/exocortex-cli archive --cascade \
338
+ --vault ~/vault \
339
+ --archive-vault ~/vault-archive
340
+
341
+ # 4. Verify integrity
342
+ npx @kitelev/exocortex-cli archive --verify \
343
+ --vault ~/vault \
344
+ --archive-vault ~/vault-archive
345
+
346
+ # 5. Restore if needed
347
+ npx @kitelev/exocortex-cli unarchive \
348
+ --uuid <asset-uuid> \
349
+ --vault ~/vault \
350
+ --archive-vault ~/vault-archive
351
+ ```
352
+
324
353
  ### Batch Operations
325
354
 
326
355
  Execute multiple operations in a single CLI invocation for better performance:
@@ -428,6 +457,123 @@ exocortex batch --file operations.json --vault ~/vault --format json
428
457
  }
429
458
  ```
430
459
 
460
+ ### Archive Management
461
+
462
+ Manage the lifecycle of assets between active and archive vaults. The archive system ensures zero broken links by checking references before moving files.
463
+
464
+ #### Archive Assets
465
+
466
+ Move completed/archived assets from active vault to a separate archive vault:
467
+
468
+ ```bash
469
+ # Archive all ems__Task from 2025
470
+ npx @kitelev/exocortex-cli archive \
471
+ --vault ~/vault \
472
+ --archive-vault ~/vault-archive \
473
+ --class ems__Task \
474
+ --year 2025
475
+
476
+ # Archive multiple classes
477
+ npx @kitelev/exocortex-cli archive \
478
+ --vault ~/vault \
479
+ --archive-vault ~/vault-archive \
480
+ --class ems__Task,ems__Meeting \
481
+ --year 2025
482
+
483
+ # Dry run — preview without moving files
484
+ npx @kitelev/exocortex-cli archive --dry-run \
485
+ --vault ~/vault \
486
+ --archive-vault ~/vault-archive \
487
+ --class ems__Task \
488
+ --year 2025
489
+ ```
490
+
491
+ **Archive Options:**
492
+
493
+ - `--vault <path>` - Path to the active vault **[required]**
494
+ - `--archive-vault <path>` - Path to the archive vault **[required]**
495
+ - `--class <names>` - Comma-separated class short names or UUIDs (e.g. `ems__Task,ems__Meeting`) **[required for archive mode]**
496
+ - `--year <year>` - Filter by resolution/end timestamp year (e.g. `2025`) **[required for archive mode]**
497
+ - `--dry-run` - Preview without writing files
498
+ - `--no-referenced` - Skip assets referenced by non-archived (default: true)
499
+ - `--json` - Output in JSON format (default: true)
500
+
501
+ **What archive does:**
502
+
503
+ 1. Scans active vault for assets matching class + year with `archived: true` in frontmatter
504
+ 2. Checks cross-references — blocks assets still referenced by active (non-archived) files
505
+ 3. Creates archive ontology files (e.g. `!ems_archive.md`) if needed
506
+ 4. Updates `exo__Asset_isDefinedBy` to point to archive ontology
507
+ 5. Moves files to archive vault, deletes from active vault
508
+
509
+ #### Verify Archive Integrity
510
+
511
+ Check for broken cross-vault links and missing ontologies (read-only):
512
+
513
+ ```bash
514
+ npx @kitelev/exocortex-cli archive --verify \
515
+ --vault ~/vault \
516
+ --archive-vault ~/vault-archive
517
+ ```
518
+
519
+ Returns exit code 0 if healthy, 1 if issues found. JSON output includes `broken_links`, `missing_ontologies`, and vault `stats`.
520
+
521
+ #### Cascade Archive
522
+
523
+ Iteratively resolve archived-to-archived dependency chains. Useful after bulk archival when some assets were blocked because they referenced other archived assets:
524
+
525
+ ```bash
526
+ # Cascade resolve (moves all unblocked archived assets)
527
+ npx @kitelev/exocortex-cli archive --cascade \
528
+ --vault ~/vault \
529
+ --archive-vault ~/vault-archive
530
+
531
+ # Preview cascade
532
+ npx @kitelev/exocortex-cli archive --cascade --dry-run \
533
+ --vault ~/vault \
534
+ --archive-vault ~/vault-archive
535
+ ```
536
+
537
+ No `--class` or `--year` needed — cascade processes all eligible archived assets.
538
+
539
+ #### Unarchive (Restore) Assets
540
+
541
+ Restore a single asset from archive vault back to active vault:
542
+
543
+ ```bash
544
+ # Restore asset by UUID
545
+ npx @kitelev/exocortex-cli unarchive \
546
+ --uuid ca0d0001-1111-2222-3333-444455556666 \
547
+ --vault ~/vault \
548
+ --archive-vault ~/vault-archive
549
+
550
+ # Dry run — preview without restoring
551
+ npx @kitelev/exocortex-cli unarchive --dry-run \
552
+ --uuid ca0d0001-1111-2222-3333-444455556666 \
553
+ --vault ~/vault \
554
+ --archive-vault ~/vault-archive
555
+ ```
556
+
557
+ **Unarchive Options:**
558
+
559
+ - `--uuid <uuid>` - UUID of the asset to restore **[required]**
560
+ - `--vault <path>` - Path to the active vault **[required]**
561
+ - `--archive-vault <path>` - Path to the archive vault **[required]**
562
+ - `--dry-run` - Preview without writing files
563
+
564
+ **What unarchive does:**
565
+
566
+ 1. Finds asset by UUID in archive vault (direct filename match, then frontmatter scan)
567
+ 2. Updates `exo__Asset_isDefinedBy` from archive ontology back to active ontology
568
+ 3. Moves file to `<active-vault>/03 Knowledge/inbox/`
569
+ 4. Preserves `archived: true` in frontmatter (user decides whether to remove it)
570
+
571
+ **Output (JSON to stdout):**
572
+
573
+ ```json
574
+ {"success":true,"uuid":"ca0d0001-...","movedTo":"03 Knowledge/inbox/ca0d0001-....md","isDefinedBy":"[[!ems|EMS Ontology]]"}
575
+ ```
576
+
431
577
  ## Architecture
432
578
 
433
579
  The CLI uses `exocortex` for business logic and implements a Node.js file system adapter:
@@ -460,6 +606,7 @@ exocortex-cli/
460
606
  - **Status Management** - Update task status through workflow
461
607
  - **Planning** - Assign tasks to specific days
462
608
  - **Frontmatter Support** - Full YAML frontmatter parsing and manipulation
609
+ - **Archive Management** - Bulk archive/unarchive assets between vaults with integrity verification
463
610
  - **Progress Indicators** - Spinners and colored output for better UX
464
611
 
465
612
  ## Development
@@ -554,6 +701,11 @@ ems__Effort_status: "[[ems__EffortStatusDraft]]"
554
701
 
555
702
  - `exocortex batch` - Execute multiple operations in single invocation
556
703
 
704
+ **Archive Management:**
705
+
706
+ - `exocortex archive` - Bulk archive assets by class and year (with `--dry-run`, `--verify`, `--cascade`)
707
+ - `exocortex unarchive` - Restore single asset from archive vault by UUID (with `--dry-run`)
708
+
557
709
  ### Planned Commands
558
710
 
559
711
  - `exocortex command rollback-status` - Rollback to previous status
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- // @kitelev/exocortex-cli v15.40.0
2
+ // @kitelev/exocortex-cli v15.41.0
3
3
  // CLI tool for Exocortex knowledge management system - SPARQL queries, task management, and more
4
4
  // License: MIT
5
5
 
@@ -624,7 +624,7 @@ ${Br.dump(i,{lineWidth:-1})}---
624
624
  `),c.isDefinedBy&&process.stderr.write(`isDefinedBy: ${c.isDefinedBy}
625
625
  `),process.stderr.write(`--- END PREVIEW ---
626
626
  `)),process.stdout.write(JSON.stringify(c)+`
627
- `),process.exit(0)}catch(e){q.handle(e)}})}o(nI,"unarchiveCommand");var Gr=new He;Gr.name("exocortex").description("CLI tool for Exocortex knowledge management system").version("15.40.0");var bv=Gr.command("sparql").description("SPARQL query execution and cache management");bv.addCommand(dA());bv.addCommand(yA());bv.addCommand(vA());Gr.addCommand(AC());Gr.addCommand(PC());Gr.addCommand(OC());Gr.addCommand(FC());Gr.addCommand(DC());Gr.addCommand(jC());Gr.addCommand(BC());Gr.addCommand(WC());Gr.addCommand(QC());Gr.addCommand(ZC());Gr.addCommand(rI());Gr.addCommand(nI());Gr.parse();
627
+ `),process.exit(0)}catch(e){q.handle(e)}})}o(nI,"unarchiveCommand");var Gr=new He;Gr.name("exocortex").description("CLI tool for Exocortex knowledge management system").version("15.41.0");var bv=Gr.command("sparql").description("SPARQL query execution and cache management");bv.addCommand(dA());bv.addCommand(yA());bv.addCommand(vA());Gr.addCommand(AC());Gr.addCommand(PC());Gr.addCommand(OC());Gr.addCommand(FC());Gr.addCommand(DC());Gr.addCommand(jC());Gr.addCommand(BC());Gr.addCommand(WC());Gr.addCommand(QC());Gr.addCommand(ZC());Gr.addCommand(rI());Gr.addCommand(nI());Gr.parse();
628
628
  /*! Bundled license information:
629
629
 
630
630
  reflect-metadata/Reflect.js:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kitelev/exocortex-cli",
3
- "version": "15.40.0",
3
+ "version": "15.41.0",
4
4
  "description": "CLI tool for Exocortex knowledge management system - SPARQL queries, task management, and more",
5
5
  "main": "dist/index.js",
6
6
  "bin": {