@swarmvaultai/cli 0.1.29 → 0.1.30

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 +24 -0
  2. package/dist/index.js +40 -2
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -41,6 +41,7 @@ swarmvault hook install
41
41
  swarmvault graph serve
42
42
  swarmvault graph export --html ./exports/graph.html
43
43
  swarmvault graph export --cypher ./exports/graph.cypher
44
+ swarmvault graph push neo4j --dry-run
44
45
  ```
45
46
 
46
47
  ## Commands
@@ -256,6 +257,29 @@ Export the current graph as one of four formats:
256
257
  - `--graphml` for graph-tool interoperability
257
258
  - `--cypher` for Neo4j-style import scripts
258
259
 
260
+ ### `swarmvault graph push neo4j`
261
+
262
+ Push the compiled graph directly into Neo4j over Bolt/Aura instead of writing an intermediate file.
263
+
264
+ Useful flags:
265
+
266
+ - `--uri <bolt-uri>`
267
+ - `--username <user>`
268
+ - `--password-env <env-var>`
269
+ - `--database <name>`
270
+ - `--vault-id <id>`
271
+ - `--include-third-party`
272
+ - `--include-resources`
273
+ - `--include-generated`
274
+ - `--dry-run`
275
+
276
+ Defaults:
277
+
278
+ - reads `graphSinks.neo4j` from `swarmvault.config.json` when present
279
+ - includes only `first_party` graph material unless you opt into more source classes
280
+ - namespaces every remote record by `vaultId` so multiple vaults can safely share one Neo4j database
281
+ - upserts current graph records and does not prune stale remote data yet
282
+
259
283
  ### `swarmvault install --agent <codex|claude|cursor|goose|pi|gemini|opencode|aider|copilot>`
260
284
 
261
285
  Install agent-specific rules into the current project so an agent understands the SwarmVault workspace contract and workflow.
package/dist/index.js CHANGED
@@ -29,6 +29,7 @@ import {
29
29
  loadVaultConfig,
30
30
  pathGraphVault,
31
31
  promoteCandidate,
32
+ pushGraphNeo4j,
32
33
  queryGraphVault,
33
34
  queryVault,
34
35
  readApproval,
@@ -216,9 +217,9 @@ program.name("swarmvault").description("SwarmVault is a local-first LLM wiki com
216
217
  function readCliVersion() {
217
218
  try {
218
219
  const packageJson = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8"));
219
- return typeof packageJson.version === "string" && packageJson.version.trim() ? packageJson.version : "0.1.29";
220
+ return typeof packageJson.version === "string" && packageJson.version.trim() ? packageJson.version : "0.1.30";
220
221
  } catch {
221
- return "0.1.29";
222
+ return "0.1.30";
222
223
  }
223
224
  }
224
225
  function parsePositiveInt(value, fallback) {
@@ -414,6 +415,43 @@ program.command("lint").description("Run anti-drift and wiki-health checks.").op
414
415
  }
415
416
  });
416
417
  var graph = program.command("graph").description("Graph-related commands.");
418
+ var graphPush = graph.command("push").description("Push the compiled graph into external sinks.");
419
+ graphPush.command("neo4j").description("Push the compiled graph directly into Neo4j over Bolt/Aura.").option("--uri <bolt-uri>", "Neo4j Bolt or Aura URI").option("--username <user>", "Neo4j username").option("--password-env <env-var>", "Environment variable containing the Neo4j password").option("--database <name>", "Neo4j database name").option("--vault-id <id>", "Stable vault identifier used for shared-database namespacing").option("--batch-size <n>", "Maximum rows to write per Neo4j transaction batch").option("--include-third-party", "Also push third-party repo material", false).option("--include-resources", "Also push resource-like content", false).option("--include-generated", "Also push generated output", false).option("--dry-run", "Show what would be pushed without writing to Neo4j", false).action(
420
+ async (options) => {
421
+ const batchSize = typeof options.batchSize === "string" && options.batchSize.trim() ? parsePositiveInt(options.batchSize, 0) || void 0 : void 0;
422
+ const includeClasses = [
423
+ "first_party",
424
+ ...options.includeThirdParty ? ["third_party"] : [],
425
+ ...options.includeResources ? ["resource"] : [],
426
+ ...options.includeGenerated ? ["generated"] : []
427
+ ];
428
+ const result = await pushGraphNeo4j(process2.cwd(), {
429
+ uri: options.uri,
430
+ username: options.username,
431
+ passwordEnv: options.passwordEnv,
432
+ database: options.database,
433
+ vaultId: options.vaultId,
434
+ batchSize,
435
+ includeClasses,
436
+ dryRun: options.dryRun ?? false
437
+ });
438
+ if (isJson()) {
439
+ emitJson(result);
440
+ } else {
441
+ log(
442
+ `${result.dryRun ? "Planned" : "Pushed"} ${result.counts.nodes} nodes, ${result.counts.relationships} relationships, ${result.counts.hyperedges} hyperedges, and ${result.counts.groupMembers} group-member links to ${result.uri}/${result.database} as ${result.vaultId}.`
443
+ );
444
+ if (result.skipped.nodes || result.skipped.relationships || result.skipped.hyperedges) {
445
+ log(
446
+ `Skipped ${result.skipped.nodes} node(s), ${result.skipped.relationships} relationship(s), and ${result.skipped.hyperedges} hyperedge(s) outside the selected source classes.`
447
+ );
448
+ }
449
+ for (const warning of result.warnings) {
450
+ log(`Warning: ${warning}`);
451
+ }
452
+ }
453
+ }
454
+ );
417
455
  graph.command("serve").description("Serve the local graph viewer.").option("--port <port>", "Port override").action(async (options) => {
418
456
  const port = options.port ? parsePositiveInt(options.port, 0) || void 0 : void 0;
419
457
  const server = await startGraphServer(process2.cwd(), port);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swarmvaultai/cli",
3
- "version": "0.1.29",
3
+ "version": "0.1.30",
4
4
  "description": "Global CLI for SwarmVault.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -43,7 +43,7 @@
43
43
  "typecheck": "tsc --noEmit"
44
44
  },
45
45
  "dependencies": {
46
- "@swarmvaultai/engine": "0.1.29",
46
+ "@swarmvaultai/engine": "0.1.30",
47
47
  "commander": "^14.0.1"
48
48
  },
49
49
  "devDependencies": {