@vera-ai/cli 0.4.0 → 0.4.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 (3) hide show
  1. package/README.md +24 -4
  2. package/bin/vera.js +57 -1
  3. package/package.json +4 -1
package/README.md CHANGED
@@ -4,34 +4,54 @@ Code search for AI agents. Vera indexes your codebase using tree-sitter parsing
4
4
 
5
5
  This package downloads and wraps the native Vera binary for your platform.
6
6
 
7
+ Current benchmark snapshot: on Vera's local 21-task, 4-repo release benchmark, `v0.7.0` reaches `0.78` Recall@5, `0.83` Recall@10, `0.91` MRR@10, and `0.84` nDCG@10 with the local Jina CUDA ONNX stack. Full details live in the main repo docs.
8
+
7
9
  ## Install
8
10
 
9
11
  ```bash
10
12
  npm install -g @vera-ai/cli
11
13
  ```
12
14
 
15
+ `vera setup` with no flags runs an interactive wizard (backend + agent skills + optional indexing). For focused changes: `vera backend` manages the ONNX runtime, `vera agent install` manages skill files and can update `AGENTS.md` / `CLAUDE.md` style project instructions, and `vera agent sync` refreshes stale skills after upgrades.
16
+
13
17
  ## Usage
14
18
 
15
19
  ```bash
20
+ # Optional: install skill files for your agents
21
+ vera agent install
22
+
16
23
  # Index a project
17
24
  vera index .
18
25
 
19
26
  # Search
20
27
  vera search "authentication middleware"
21
28
 
22
- # Local ONNX inference (no API keys needed downloads models automatically)
29
+ # Local ONNX inference (no API keys needed. downloads models automatically)
23
30
  vera index . --onnx-jina-cpu
24
31
  vera search "error handling" --onnx-jina-cpu
25
32
 
26
- # GPU acceleration (NVIDIA/AMD/DirectML)
33
+ # Optional local CodeRankEmbed preset
34
+ vera setup --code-rank-embed --onnx-jina-cuda
35
+
36
+ # GPU acceleration (NVIDIA/AMD/DirectML/CoreML/OpenVINO)
27
37
  vera index . --onnx-jina-cuda
38
+
39
+ # Diagnose or repair local setup issues
40
+ vera doctor
41
+ vera doctor --probe
42
+ vera repair
43
+ vera upgrade
28
44
  ```
29
45
 
46
+ `vera doctor --probe` runs a deeper read-only ONNX session check. `vera upgrade` shows the binary update plan and can apply it when the install method is known.
47
+
48
+ On GPU backends, Vera uses a free-VRAM-aware batch ceiling and sequence-aware local micro-batching, and it reuses learned device-specific batch windows across runs.
49
+
30
50
  ## What you get
31
51
 
32
52
  - **60+ languages** via tree-sitter AST parsing
33
53
  - **Hybrid search**: BM25 keyword + vector similarity, fused with Reciprocal Rank Fusion
34
54
  - **Cross-encoder reranking** for precision
35
- - **JSON output** with file paths, line ranges, code content, and relevance scores
55
+ - **Markdown codeblock output** by default with file paths, line ranges, and optional symbol info (use `--json` for compact JSON, `--raw` for verbose output, `--timing` for step durations)
36
56
 
37
- For full documentation, see the [GitHub repo](https://github.com/lemon07r/Vera).
57
+ For full documentation, including custom local ONNX embedding models and manual install steps, see the [GitHub repo](https://github.com/lemon07r/Vera).
package/bin/vera.js CHANGED
@@ -62,6 +62,42 @@ function defaultVeraHome() {
62
62
  return process.env.VERA_HOME || path.join(os.homedir(), ".vera");
63
63
  }
64
64
 
65
+ function installMetadataPath() {
66
+ return path.join(defaultVeraHome(), "install.json");
67
+ }
68
+
69
+ function currentInstallMethod() {
70
+ if (process.versions.bun) return "bun";
71
+ const ua = process.env.npm_config_user_agent || "";
72
+ if (ua.startsWith("bun/")) return "bun";
73
+ const execpath = process.env.npm_execpath || "";
74
+ if (execpath.includes("bun")) return "bun";
75
+ return "npm";
76
+ }
77
+
78
+ async function readInstallMetadata() {
79
+ try {
80
+ const raw = await fsp.readFile(installMetadataPath(), "utf8");
81
+ return JSON.parse(raw);
82
+ } catch {
83
+ return {};
84
+ }
85
+ }
86
+
87
+ async function writeInstallMetadata({ installMethod, version, binaryPath }) {
88
+ const metadataPath = installMetadataPath();
89
+ await fsp.mkdir(path.dirname(metadataPath), { recursive: true });
90
+ const current = await readInstallMetadata();
91
+ const next = {
92
+ install_method: installMethod ?? current.install_method ?? null,
93
+ version: version ?? current.version ?? null,
94
+ binary_path: binaryPath ?? current.binary_path ?? null,
95
+ };
96
+ const tmpPath = `${metadataPath}.tmp.${process.pid}`;
97
+ await fsp.writeFile(tmpPath, `${JSON.stringify(next, null, 2)}\n`, "utf8");
98
+ await fsp.rename(tmpPath, metadataPath);
99
+ }
100
+
65
101
  function preferredBinDirs() {
66
102
  const home = os.homedir();
67
103
  if (process.env.VERA_USER_BIN_DIR) {
@@ -198,7 +234,7 @@ async function extractArchive(archivePath, destination) {
198
234
  runChecked("powershell", [
199
235
  "-NoProfile",
200
236
  "-Command",
201
- "Expand-Archive",
237
+ "Import-Module Microsoft.PowerShell.Archive; Expand-Archive",
202
238
  "-LiteralPath",
203
239
  archivePath,
204
240
  "-DestinationPath",
@@ -260,6 +296,11 @@ async function ensureBinaryInstalled() {
260
296
  const binaryPath = path.join(installDir, binaryName());
261
297
  if (fs.existsSync(binaryPath)) {
262
298
  await createShim(binaryPath);
299
+ await writeInstallMetadata({
300
+ installMethod: currentInstallMethod(),
301
+ version,
302
+ binaryPath,
303
+ });
263
304
  return { binaryPath, version };
264
305
  }
265
306
 
@@ -289,6 +330,11 @@ async function ensureBinaryInstalled() {
289
330
  console.error(`Added Vera to ${path.dirname(shimPath)}. Add that directory to PATH to run \`vera\` directly.`);
290
331
  }
291
332
 
333
+ await writeInstallMetadata({
334
+ installMethod: currentInstallMethod(),
335
+ version,
336
+ binaryPath,
337
+ });
292
338
  return { binaryPath, version };
293
339
  } finally {
294
340
  await fsp.rm(tempRoot, { recursive: true, force: true });
@@ -305,6 +351,16 @@ function runBinary(binaryPath, args) {
305
351
 
306
352
  async function main() {
307
353
  const { command, rest } = parseArgs(process.argv.slice(2));
354
+
355
+ if (command === "_record-install-method") {
356
+ await writeInstallMetadata({
357
+ installMethod: "npm",
358
+ version: packageVersion,
359
+ binaryPath: null,
360
+ });
361
+ return;
362
+ }
363
+
308
364
  const { binaryPath, version } = await ensureBinaryInstalled();
309
365
 
310
366
  if (command === "install") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vera-ai/cli",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "Bootstrap installer and wrapper for the Vera CLI",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/lemon07r/Vera#readme",
@@ -13,6 +13,9 @@
13
13
  "url": "https://github.com/lemon07r/Vera/issues"
14
14
  },
15
15
  "bin": "./bin/vera.js",
16
+ "scripts": {
17
+ "postinstall": "node ./bin/vera.js _record-install-method"
18
+ },
16
19
  "files": [
17
20
  "bin/vera.js",
18
21
  "README.md"