@swarmvaultai/cli 0.1.1 → 0.1.3
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.
- package/README.md +43 -15
- package/dist/index.js +32 -2
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# @swarmvaultai/cli
|
|
2
2
|
|
|
3
|
-
`@swarmvaultai/cli` is the
|
|
3
|
+
`@swarmvaultai/cli` is the global command-line entry point for SwarmVault.
|
|
4
4
|
|
|
5
|
-
It gives you the `swarmvault` command for
|
|
5
|
+
It gives you the `swarmvault` command for building a local-first knowledge vault from files, URLs, browser clips, and saved query outputs.
|
|
6
6
|
|
|
7
7
|
## Install
|
|
8
8
|
|
|
@@ -25,7 +25,7 @@ cd my-vault
|
|
|
25
25
|
swarmvault init
|
|
26
26
|
swarmvault ingest ./notes.md
|
|
27
27
|
swarmvault compile
|
|
28
|
-
swarmvault query "What
|
|
28
|
+
swarmvault query "What keeps recurring?" --save
|
|
29
29
|
swarmvault graph serve
|
|
30
30
|
```
|
|
31
31
|
|
|
@@ -33,8 +33,9 @@ swarmvault graph serve
|
|
|
33
33
|
|
|
34
34
|
### `swarmvault init`
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
Create a workspace with:
|
|
37
37
|
|
|
38
|
+
- `inbox/`
|
|
38
39
|
- `raw/`
|
|
39
40
|
- `wiki/`
|
|
40
41
|
- `state/`
|
|
@@ -43,11 +44,15 @@ Creates a new SwarmVault workspace in the current directory, including:
|
|
|
43
44
|
|
|
44
45
|
### `swarmvault ingest <path-or-url>`
|
|
45
46
|
|
|
46
|
-
|
|
47
|
+
Ingest a local file path or URL into immutable source storage and write a manifest to `state/manifests/`.
|
|
48
|
+
|
|
49
|
+
### `swarmvault inbox import [dir]`
|
|
50
|
+
|
|
51
|
+
Import supported files from the configured inbox directory. This is meant for browser-clipper style markdown bundles and other capture workflows. Local image and asset references are preserved and copied into canonical storage under `raw/assets/`.
|
|
47
52
|
|
|
48
53
|
### `swarmvault compile`
|
|
49
54
|
|
|
50
|
-
|
|
55
|
+
Compile the current manifests into:
|
|
51
56
|
|
|
52
57
|
- generated markdown in `wiki/`
|
|
53
58
|
- structured graph data in `state/graph.json`
|
|
@@ -55,25 +60,42 @@ Compiles the current manifests into:
|
|
|
55
60
|
|
|
56
61
|
### `swarmvault query "<question>" [--save]`
|
|
57
62
|
|
|
58
|
-
|
|
63
|
+
Query the compiled vault. With `--save`, the answer is written into `wiki/outputs/` so the result becomes part of the vault.
|
|
59
64
|
|
|
60
65
|
### `swarmvault lint`
|
|
61
66
|
|
|
62
|
-
|
|
67
|
+
Run anti-drift and vault health checks such as stale pages, missing graph artifacts, and other structural issues.
|
|
68
|
+
|
|
69
|
+
### `swarmvault watch [--lint] [--debounce <ms>]`
|
|
70
|
+
|
|
71
|
+
Watch the inbox directory and trigger import and compile cycles when files change. With `--lint`, each cycle also runs linting. Run metadata is appended to `state/jobs.ndjson`.
|
|
72
|
+
|
|
73
|
+
### `swarmvault mcp`
|
|
74
|
+
|
|
75
|
+
Run SwarmVault as a local MCP server over stdio. This exposes the vault to compatible clients and agents through tools and resources such as:
|
|
76
|
+
|
|
77
|
+
- `workspace_info`
|
|
78
|
+
- `search_pages`
|
|
79
|
+
- `read_page`
|
|
80
|
+
- `list_sources`
|
|
81
|
+
- `query_vault`
|
|
82
|
+
- `ingest_input`
|
|
83
|
+
- `compile_vault`
|
|
84
|
+
- `lint_vault`
|
|
63
85
|
|
|
64
86
|
### `swarmvault graph serve`
|
|
65
87
|
|
|
66
|
-
|
|
88
|
+
Start the local graph UI backed by `state/graph.json`.
|
|
67
89
|
|
|
68
90
|
### `swarmvault install --agent <codex|claude|cursor>`
|
|
69
91
|
|
|
70
|
-
|
|
92
|
+
Install agent-specific rules into the current project so an agent understands the SwarmVault workspace contract and workflow.
|
|
71
93
|
|
|
72
94
|
## Provider Configuration
|
|
73
95
|
|
|
74
|
-
SwarmVault defaults to a local heuristic provider so the CLI
|
|
96
|
+
SwarmVault defaults to a local `heuristic` provider so the CLI works without API keys, but real vaults will usually point at an actual model provider.
|
|
75
97
|
|
|
76
|
-
|
|
98
|
+
Example:
|
|
77
99
|
|
|
78
100
|
```json
|
|
79
101
|
{
|
|
@@ -94,10 +116,16 @@ Inside an existing `swarmvault.config.json`, your `providers` and `tasks` sectio
|
|
|
94
116
|
}
|
|
95
117
|
```
|
|
96
118
|
|
|
97
|
-
Generic OpenAI-compatible APIs are
|
|
119
|
+
Generic OpenAI-compatible APIs are supported through config when the provider follows the OpenAI request shape closely enough.
|
|
98
120
|
|
|
99
121
|
## Troubleshooting
|
|
100
122
|
|
|
101
|
-
- If `graph serve` says the viewer build is missing, run `pnpm build` in the repository first
|
|
123
|
+
- If you are running from a source checkout and `graph serve` says the viewer build is missing, run `pnpm build` in the repository first
|
|
102
124
|
- If a provider claims OpenAI compatibility but fails structured generation, declare only the capabilities it actually supports
|
|
103
|
-
- Node 24 may emit an experimental warning for `node:sqlite`;
|
|
125
|
+
- Node 24 may emit an experimental warning for `node:sqlite`; that is expected in the current release
|
|
126
|
+
|
|
127
|
+
## Links
|
|
128
|
+
|
|
129
|
+
- Website: https://www.swarmvault.ai
|
|
130
|
+
- Docs: https://www.swarmvault.ai/docs
|
|
131
|
+
- GitHub: https://github.com/swarmclawai/swarmvault
|
package/dist/index.js
CHANGED
|
@@ -5,15 +5,18 @@ import { Command } from "commander";
|
|
|
5
5
|
import process from "process";
|
|
6
6
|
import {
|
|
7
7
|
compileVault,
|
|
8
|
+
importInbox,
|
|
8
9
|
ingestInput,
|
|
9
10
|
initVault,
|
|
10
11
|
installAgent,
|
|
11
12
|
lintVault,
|
|
12
13
|
queryVault,
|
|
13
|
-
startGraphServer
|
|
14
|
+
startGraphServer,
|
|
15
|
+
startMcpServer,
|
|
16
|
+
watchVault
|
|
14
17
|
} from "@swarmvaultai/engine";
|
|
15
18
|
var program = new Command();
|
|
16
|
-
program.name("swarmvault").description("SwarmVault is a local-first LLM wiki compiler with graph outputs and pluggable providers.").version("0.1.
|
|
19
|
+
program.name("swarmvault").description("SwarmVault is a local-first LLM wiki compiler with graph outputs and pluggable providers.").version("0.1.3");
|
|
17
20
|
program.command("init").description("Initialize a SwarmVault workspace in the current directory.").action(async () => {
|
|
18
21
|
await initVault(process.cwd());
|
|
19
22
|
process.stdout.write("Initialized SwarmVault workspace.\n");
|
|
@@ -23,6 +26,14 @@ program.command("ingest").description("Ingest a local file path or URL into the
|
|
|
23
26
|
process.stdout.write(`${manifest.sourceId}
|
|
24
27
|
`);
|
|
25
28
|
});
|
|
29
|
+
var inbox = program.command("inbox").description("Inbox and capture workflows.");
|
|
30
|
+
inbox.command("import").description("Import supported files from the configured inbox directory.").argument("[dir]", "Optional inbox directory override").action(async (dir) => {
|
|
31
|
+
const result = await importInbox(process.cwd(), dir);
|
|
32
|
+
process.stdout.write(
|
|
33
|
+
`Imported ${result.imported.length} source(s) from ${result.inputDir}. Scanned: ${result.scannedCount}. Attachments: ${result.attachmentCount}. Skipped: ${result.skipped.length}.
|
|
34
|
+
`
|
|
35
|
+
);
|
|
36
|
+
});
|
|
26
37
|
program.command("compile").description("Compile manifests into wiki pages, graph JSON, and search index.").action(async () => {
|
|
27
38
|
const result = await compileVault(process.cwd());
|
|
28
39
|
process.stdout.write(
|
|
@@ -63,6 +74,25 @@ graph.command("serve").description("Serve the local graph viewer.").option("--po
|
|
|
63
74
|
process.exit(0);
|
|
64
75
|
});
|
|
65
76
|
});
|
|
77
|
+
program.command("watch").description("Watch the inbox directory and run import/compile cycles on changes.").option("--lint", "Run lint after each compile cycle", false).option("--debounce <ms>", "Debounce window in milliseconds", "900").action(async (options) => {
|
|
78
|
+
const debounceMs = Number.parseInt(options.debounce ?? "900", 10);
|
|
79
|
+
const controller = await watchVault(process.cwd(), {
|
|
80
|
+
lint: options.lint ?? false,
|
|
81
|
+
debounceMs: Number.isFinite(debounceMs) ? debounceMs : 900
|
|
82
|
+
});
|
|
83
|
+
process.stdout.write("Watching inbox for changes. Press Ctrl+C to stop.\n");
|
|
84
|
+
process.on("SIGINT", async () => {
|
|
85
|
+
await controller.close();
|
|
86
|
+
process.exit(0);
|
|
87
|
+
});
|
|
88
|
+
});
|
|
89
|
+
program.command("mcp").description("Run SwarmVault as a local MCP server over stdio.").action(async () => {
|
|
90
|
+
const controller = await startMcpServer(process.cwd());
|
|
91
|
+
process.on("SIGINT", async () => {
|
|
92
|
+
await controller.close();
|
|
93
|
+
process.exit(0);
|
|
94
|
+
});
|
|
95
|
+
});
|
|
66
96
|
program.command("install").description("Install SwarmVault instructions for an agent in the current project.").requiredOption("--agent <agent>", "codex, claude, or cursor").action(async (options) => {
|
|
67
97
|
const target = await installAgent(process.cwd(), options.agent);
|
|
68
98
|
process.stdout.write(`Installed rules into ${target}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@swarmvaultai/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "Global CLI for SwarmVault.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"type": "git",
|
|
13
13
|
"url": "git+https://github.com/swarmclawai/swarmvault.git"
|
|
14
14
|
},
|
|
15
|
-
"homepage": "https://swarmvault.ai",
|
|
15
|
+
"homepage": "https://www.swarmvault.ai",
|
|
16
16
|
"bugs": {
|
|
17
17
|
"url": "https://github.com/swarmclawai/swarmvault/issues"
|
|
18
18
|
},
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"commander": "^14.0.1",
|
|
42
|
-
"@swarmvaultai/engine": "0.1.
|
|
42
|
+
"@swarmvaultai/engine": "0.1.3"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@types/node": "^24.6.0",
|