sverklo 0.29.0 → 0.29.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.
package/README.md CHANGED
@@ -15,12 +15,13 @@ Sverklo gives coding agents repo memory: symbols, callers, diffs, blast radius,
15
15
  Use grep when you know the exact string. Use Sverklo when the agent needs relationships: who calls this, what depends on it, what changed, and which project decisions still apply. The public bench covers 180 hand-verified tasks across 6 OSS codebases; the methodology and ground truth live in [sverklo/sverklo-bench](https://github.com/sverklo/sverklo-bench). [Bench](https://sverklo.com/bench/) · [paper](https://doi.org/10.5281/zenodo.19802051) · [90-second demo](https://www.youtube.com/watch?v=OX7aEgdlqhQ)
16
16
 
17
17
  ```bash
18
- npm install -g sverklo
19
- cd your-project && sverklo init
20
- sverklo prove
18
+ cd your-project
19
+ npm exec --yes --package=sverklo@latest -- sverklo prove --no-write --guided
20
+ sverklo init --dry-run
21
+ npm install -g sverklo && sverklo init
21
22
  ```
22
23
 
23
- `sverklo init` writes the MCP config for your agent, appends local instructions to `AGENTS.md` or `CLAUDE.md`, and runs `sverklo doctor` to verify the handshake. `sverklo prove` then shows central files, a real symbol with callers, and the exact prompt to paste into your agent. Your code stays on your machine.
24
+ `sverklo prove --no-write --guided` shows central files, a real symbol with callers, why that proof was selected, and the exact prompt to paste into your agent before any MCP config or instruction files are written. It may cache the local model/index under `~/.sverklo`, but it does not mutate your project. `sverklo init --dry-run` then previews the files `init` would touch; `sverklo init` writes the MCP config for your agent, appends local instructions to `AGENTS.md` or `CLAUDE.md`, and runs `sverklo doctor` to verify the handshake. Your code stays on your machine.
24
25
 
25
26
  Need something shareable? Run `sverklo prove --markdown` to print a GitHub/Discord-ready proof receipt from your repo, then [post it in the proof thread](https://github.com/sverklo/sverklo/discussions/79).
26
27
 
@@ -77,12 +78,13 @@ Sverklo drills into your repo before the agent does — symbol graph, blast radi
77
78
  </table>
78
79
 
79
80
  ```bash
80
- npm install -g sverklo
81
- cd your-project && sverklo init
82
- sverklo prove
81
+ cd your-project
82
+ npm exec --yes --package=sverklo@latest -- sverklo prove --no-write --guided
83
+ sverklo init --dry-run
84
+ npm install -g sverklo && sverklo init
83
85
  ```
84
86
 
85
- That's it. `sverklo init` auto-detects your installed AI coding agent (Claude Code, Cursor, Windsurf, Zed), writes the right MCP config, appends instructions to `AGENTS.md` if present (otherwise `CLAUDE.md`), and runs `sverklo doctor` to verify the setup. `sverklo prove` shows the first useful repo-memory proof from your own codebase; `sverklo prove --markdown` makes that proof shareable in [the public proof thread](https://github.com/sverklo/sverklo/discussions/79). Works on macOS, Linux, and Windows. **No API keys. No cloud. Telemetry off by default.**
87
+ That's it. `sverklo prove --no-write --guided` gives you the first useful repo-memory proof from your own codebase before project config changes; `sverklo init --dry-run` previews every setup target; `sverklo init` auto-detects your installed AI coding agent (Claude Code, Cursor, Windsurf, Zed), writes the right MCP config, appends instructions to `AGENTS.md` if present (otherwise `CLAUDE.md`), and runs `sverklo doctor` to verify the setup. `sverklo prove --markdown` makes that proof shareable in [the public proof thread](https://github.com/sverklo/sverklo/discussions/79). Works on macOS, Linux, and Windows. **No API keys. No cloud. Telemetry off by default.**
86
88
 
87
89
  > The embedding model (`all-MiniLM-L6-v2` ONNX, ~86 MB) is downloaded from HuggingFace on first use into `~/.sverklo/models/` and cached forever — every subsequent run is fully offline.
88
90
 
@@ -451,12 +453,13 @@ Click the badge for your editor. Cursor / VS Code prompt to confirm, then sverkl
451
453
  <br/>
452
454
 
453
455
  ```bash
454
- npm install -g sverklo
455
- cd your-project && sverklo init
456
- sverklo prove
456
+ cd your-project
457
+ npm exec --yes --package=sverklo@latest -- sverklo prove --no-write --guided
458
+ sverklo init --dry-run
459
+ npm install -g sverklo && sverklo init
457
460
  ```
458
461
 
459
- `sverklo init` auto-detects which AI coding agents you have (Claude Code, Cursor, Windsurf, Zed, Antigravity) and writes the right MCP config files. `sverklo prove` prints central files, a real caller graph, and a prompt to paste into your agent. Add `--markdown` or `--receipt` for a shareable proof artifact, then post it in [the proof thread](https://github.com/sverklo/sverklo/discussions/79). Idempotent — safe to re-run. If sverklo doesn't appear in your agent after restart, run `sverklo doctor`.
462
+ Start with proof, then wire the agent. `sverklo prove --no-write --guided` prints central files, a real caller graph, why that symbol was selected, and a prompt to paste into your agent without writing MCP config or instruction files. `sverklo init --dry-run` previews setup targets. `sverklo init` auto-detects which AI coding agents you have (Claude Code, Cursor, Windsurf, Zed, Antigravity) and writes the right MCP config files. Add `--markdown` or `--receipt` for a shareable proof artifact, then post it in [the proof thread](https://github.com/sverklo/sverklo/discussions/79). Idempotent — safe to re-run. If sverklo doesn't appear in your agent after restart, run `sverklo doctor --agent claude` or the matching agent name.
460
463
 
461
464
  **Per-agent config locations** (`sverklo init` writes these for you):
462
465
  - Claude Code: `.mcp.json` at project root + appends to `CLAUDE.md` (or `AGENTS.md` if present)
@@ -39,6 +39,8 @@ async function resolveProjectPath(flags) {
39
39
  }
40
40
  function parseProveArgs(rawArgs) {
41
41
  let format = "text";
42
+ let guided = false;
43
+ let noWrite = false;
42
44
  const pathArgs = [];
43
45
  for (let i = 0; i < rawArgs.length; i++) {
44
46
  const arg = rawArgs[i];
@@ -65,9 +67,17 @@ function parseProveArgs(rawArgs) {
65
67
  format = value === "markdown" ? "markdown" : "text";
66
68
  continue;
67
69
  }
70
+ if (arg === "--guided") {
71
+ guided = true;
72
+ continue;
73
+ }
74
+ if (arg === "--no-write" || arg === "--no-config-write") {
75
+ noWrite = true;
76
+ continue;
77
+ }
68
78
  pathArgs.push(arg);
69
79
  }
70
- return { format, pathArgs };
80
+ return { format, guided, noWrite, pathArgs };
71
81
  }
72
82
  // Global --help / -h interceptor.
73
83
  //
@@ -217,6 +227,10 @@ if (command === "marketing") {
217
227
  if (!trends && !profile && !recentPosts && !evidence && !existing) {
218
228
  throw new Error("no local marketing inputs found; provide --trends, --profile, --recent-posts, or --evidence");
219
229
  }
230
+ const cycleNow = trends?.captured_at ??
231
+ profile?.captured_at ??
232
+ recentPosts?.captured_at ??
233
+ existing?.updated_at;
220
234
  const cycle = runCampaignCycle({
221
235
  workspace,
222
236
  existingCycle: existing,
@@ -225,6 +239,7 @@ if (command === "marketing") {
225
239
  recentPosts,
226
240
  evidence,
227
241
  cycleId: flagVal("--cycle"),
242
+ now: cycleNow,
228
243
  });
229
244
  saveMarketingWorkspace(workspacePath, workspace);
230
245
  saveCampaignCycle(workspacePath, cycle);
@@ -283,7 +298,18 @@ if (command === "init") {
283
298
  const autoCapture = flags.includes("--auto-capture");
284
299
  const mineChats = flags.includes("--mine-chats");
285
300
  const isGlobal = flags.includes("--global");
301
+ const dryRun = flags.includes("--dry-run");
286
302
  const projectPath = resolve(positional[1] || process.cwd());
303
+ if (dryRun) {
304
+ if (isGlobal) {
305
+ console.error("✗ sverklo init --dry-run does not support --global yet");
306
+ console.error(" Run `sverklo init --global` only after reviewing global instruction targets manually.");
307
+ process.exit(2);
308
+ }
309
+ const { renderInitDryRun } = await import("../src/init.js");
310
+ process.stdout.write(renderInitDryRun(projectPath, { autoCapture, mineChats }));
311
+ process.exit(0);
312
+ }
287
313
  if (isGlobal) {
288
314
  // Issue #72 — one-time-per-machine setup. Writes SVERKLO_SNIPPET to
289
315
  // global agent-instruction locations (~/.claude/CLAUDE.md, ~/.codex/AGENTS.md),
@@ -322,10 +348,10 @@ if (command === "register") {
322
348
  process.exit(0);
323
349
  }
324
350
  if (command === "prove") {
325
- const { format, pathArgs } = parseProveArgs(args.slice(1));
351
+ const { format, guided, noWrite, pathArgs } = parseProveArgs(args.slice(1));
326
352
  const projectPath = await resolveProjectPath(pathArgs);
327
353
  const { runProve } = await import("../src/prove.js");
328
- const report = await runProve(projectPath, { format });
354
+ const report = await runProve(projectPath, { format, guided, noWrite });
329
355
  process.stdout.write(report);
330
356
  process.exit(0);
331
357
  }
@@ -650,9 +676,24 @@ if (command === "audit-prompt" || command === "review-prompt") {
650
676
  process.exit(0);
651
677
  }
652
678
  if (command === "doctor" || command === "diagnose" || command === "check") {
653
- const projectPath = resolve(args[1] || process.cwd());
679
+ let agent;
680
+ const pathArgs = [];
681
+ for (let i = 1; i < args.length; i++) {
682
+ const arg = args[i];
683
+ if (arg === "--agent") {
684
+ agent = args[i + 1];
685
+ i++;
686
+ continue;
687
+ }
688
+ if (arg.startsWith("--agent=")) {
689
+ agent = arg.slice("--agent=".length);
690
+ continue;
691
+ }
692
+ pathArgs.push(arg);
693
+ }
694
+ const projectPath = resolve(pathArgs[0] || process.cwd());
654
695
  const { runDoctor } = await import("../src/doctor.js");
655
- runDoctor(projectPath);
696
+ runDoctor(projectPath, { agent });
656
697
  process.exit(0);
657
698
  }
658
699
  if (command === "workspace") {
@@ -2739,16 +2780,21 @@ if (command === "--help" || command === "-h") {
2739
2780
  sverklo — code intelligence for AI agents
2740
2781
 
2741
2782
  Just installed? Run these two:
2742
- sverklo init Set up sverklo in your project (.mcp.json + CLAUDE.md)
2743
- sverklo prove Show a real repo-memory proof from your codebase
2783
+ sverklo prove --no-write --guided
2784
+ Show proof before writing project or agent config files
2785
+ sverklo init --dry-run Preview the config files init would touch
2744
2786
 
2745
2787
  Then restart your AI agent (Claude Code, Cursor, Windsurf, etc.) — sverklo tools become available automatically.
2746
2788
 
2747
2789
  Usage:
2748
2790
  sverklo init Set up sverklo in your project (.mcp.json + CLAUDE.md)
2791
+ sverklo init --dry-run Preview planned writes without changing files
2749
2792
  sverklo doctor Diagnose MCP setup issues
2793
+ sverklo doctor --agent codex
2794
+ Show agent-specific setup/check prompt guidance
2750
2795
  sverklo prove [path] Show central files, a real caller graph, and an agent prompt
2751
- Use --markdown or --receipt for a shareable artifact.
2796
+ Use --guided for selection notes, --no-write for trial mode,
2797
+ and --markdown or --receipt for a shareable artifact.
2752
2798
  sverklo reindex [path] Incremental rebuild of the index (changed files only)
2753
2799
  Use --force to clear and rebuild from scratch.
2754
2800
  Use --timing to see per-phase elapsed ms.
@@ -2790,9 +2836,10 @@ Setup / runtime:
2790
2836
  sverklo --help Show this help
2791
2837
 
2792
2838
  Quick start (single project):
2793
- npm install -g sverklo
2794
- cd your-project && sverklo init
2795
- sverklo prove
2839
+ cd your-project
2840
+ npm exec --yes --package=sverklo@latest -- sverklo prove --no-write --guided
2841
+ sverklo init --dry-run
2842
+ npm install -g sverklo && sverklo init
2796
2843
  sverklo prove --markdown # shareable proof for GitHub, Discord, Reddit, etc.
2797
2844
  claude # start coding — sverklo tools are preferred automatically
2798
2845