grepmax 0.7.36 → 0.7.38

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
@@ -29,44 +29,51 @@ Natural-language search that works like `grep`. Fast, local, and built for codin
29
29
 
30
30
  ## Quick Start
31
31
 
32
- 1. **Install**
33
- ```bash
34
- npm install -g grepmax
35
- ```
36
-
37
- 2. **Setup (Recommended)**
32
+ ```bash
33
+ npm install -g grepmax # 1. Install
34
+ cd my-repo && gmax index # 2. Index (models download automatically)
35
+ gmax "where do we handle auth?" # 3. Search
36
+ ```
38
37
 
39
- ```bash
40
- gmax setup
41
- ```
38
+ That's it. No setup required — gmax auto-detects your platform (GPU on Apple Silicon, CPU elsewhere) and downloads models on first use.
42
39
 
43
- Downloads embedding models (~150MB) upfront and lets you choose between CPU (ONNX) and GPU (MLX) embedding modes. If you skip this, models download automatically on first use.
40
+ ### Optional: Interactive Setup
44
41
 
45
- 3. **Index**
42
+ ```bash
43
+ gmax setup # Choose model tier + embedding mode interactively
44
+ ```
46
45
 
47
- ```bash
48
- cd my-repo
49
- gmax index
50
- ```
46
+ Run this if you want to:
47
+ - Switch between **CPU** (ONNX, works everywhere) and **GPU** (MLX, Apple Silicon only, ~3x faster)
48
+ - Choose between **small** model (384d, 47M params, fast) and **standard** model (768d, 149M params, better quality)
51
49
 
52
- Indexes into a centralized store at `~/.gmax/lancedb/`. You can index any directory — a single repo, a monorepo, or an entire workspace.
50
+ ### Quick Config (Non-Interactive)
53
51
 
54
- 4. **Search**
52
+ ```bash
53
+ gmax config # View current settings
54
+ gmax config --embed-mode cpu # Switch to CPU
55
+ gmax config --embed-mode gpu # Switch to GPU (Apple Silicon only)
56
+ gmax config --model-tier standard # Switch to larger model
57
+ ```
55
58
 
56
- ```bash
57
- gmax "where do we handle authentication?"
58
- ```
59
+ ### Verify Installation
59
60
 
60
- 5. **Trace** (Call Graph)
61
+ ```bash
62
+ gmax doctor # Check models, index, servers
63
+ ```
61
64
 
62
- ```bash
63
- gmax trace "function_name"
64
- ```
65
- See who calls a function (upstream dependencies) and what it calls (downstream dependencies).
65
+ ### Core Commands
66
66
 
67
- ```bash
68
- gmax symbols # List all indexed symbols
69
- ```
67
+ ```bash
68
+ gmax "where do we handle auth?" # Semantic search
69
+ gmax "VectorDB" --symbol --agent # Search + call graph (compact output)
70
+ gmax trace handleAuth -d 2 # Call graph (2-hop)
71
+ gmax skeleton src/lib/search/ # File structure (directory)
72
+ gmax project # Project overview
73
+ gmax related src/lib/syncer.ts # Dependencies + dependents
74
+ gmax recent # Recently modified files
75
+ gmax symbols auth # List indexed symbols
76
+ ```
70
77
 
71
78
  In our public benchmarks, `grepmax` can save about 20% of your LLM tokens and deliver a 30% speedup.
72
79
 
@@ -82,6 +89,8 @@ In our public benchmarks, `grepmax` can save about 20% of your LLM tokens and de
82
89
  2. Open Claude Code — the plugin auto-starts the MLX GPU server and a background file watcher.
83
90
  3. Claude uses `gmax` for semantic searches automatically via MCP tools.
84
91
 
92
+ Plugin files (skill instructions, hooks) auto-update when you run `npm update -g grepmax` — no need to re-run `install-claude-code`.
93
+
85
94
  ### Opencode
86
95
  1. Run `gmax install-opencode`
87
96
  2. OC uses `gmax` for semantic searches via MCP.
@@ -119,23 +119,22 @@ exports.setup = new commander_1.Command("setup")
119
119
  }
120
120
  const selectedTier = config_1.MODEL_TIERS[modelTier];
121
121
  // Step 5: Embed mode selection
122
+ const isAppleSilicon = process.arch === "arm64" && process.platform === "darwin";
122
123
  const embedMode = yield p.select({
123
- message: "Embedding mode",
124
+ message: "Are you on Apple Silicon (M1/M2/M3/M4)?",
124
125
  options: [
125
126
  {
126
- value: "cpu",
127
- label: "CPU only",
128
- hint: "ONNX works everywhere",
127
+ value: "gpu",
128
+ label: "Yes — use GPU acceleration",
129
+ hint: "~3x faster indexing and search via MLX",
129
130
  },
130
131
  {
131
- value: "gpu",
132
- label: "GPU (MLX)",
133
- hint: "Apple Silicon only, faster indexing + search",
132
+ value: "cpu",
133
+ label: "No — use CPU",
134
+ hint: "Works on all platforms (Intel, Linux, Windows)",
134
135
  },
135
136
  ],
136
- initialValue: (_c = existingConfig === null || existingConfig === void 0 ? void 0 : existingConfig.embedMode) !== null && _c !== void 0 ? _c : (process.arch === "arm64" && process.platform === "darwin"
137
- ? "gpu"
138
- : "cpu"),
137
+ initialValue: (_c = existingConfig === null || existingConfig === void 0 ? void 0 : existingConfig.embedMode) !== null && _c !== void 0 ? _c : (isAppleSilicon ? "gpu" : "cpu"),
139
138
  });
140
139
  if (p.isCancel(embedMode)) {
141
140
  p.cancel("Setup cancelled");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "grepmax",
3
- "version": "0.7.36",
3
+ "version": "0.7.38",
4
4
  "author": "Robert Owens <robowens@me.com>",
5
5
  "homepage": "https://github.com/reowens/grepmax",
6
6
  "bugs": {
@@ -23,6 +23,7 @@
23
23
  "files": [
24
24
  "dist",
25
25
  "plugins",
26
+ "scripts/postinstall.js",
26
27
  "mlx-embed-server",
27
28
  "README.md",
28
29
  "LICENSE",
@@ -62,6 +63,7 @@
62
63
  "vitest": "^1.6.1"
63
64
  },
64
65
  "scripts": {
66
+ "postinstall": "node scripts/postinstall.js",
65
67
  "prebuild": "mkdir -p dist",
66
68
  "build": "tsc",
67
69
  "postbuild": "chmod +x dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "grepmax",
3
- "version": "0.7.36",
3
+ "version": "0.7.38",
4
4
  "description": "Semantic code search for Claude Code. Automatically indexes your project and provides intelligent search capabilities.",
5
5
  "author": {
6
6
  "name": "Robert Owens",
@@ -4,12 +4,13 @@ description: Semantic code search. Use alongside grep - grep for exact strings,
4
4
  allowed-tools: "mcp__grepmax__semantic_search, mcp__grepmax__code_skeleton, mcp__grepmax__trace_calls, mcp__grepmax__list_symbols, mcp__grepmax__index_status, mcp__grepmax__summarize_directory, mcp__grepmax__summarize_project, mcp__grepmax__related_files, mcp__grepmax__recent_changes, Bash(gmax:*), Read"
5
5
  ---
6
6
 
7
- ## What gmax does
7
+ ## When to use what
8
8
 
9
- Semantic code search finds code by meaning, not just strings.
10
-
11
- - grep/ripgrep: exact string match
12
- - gmax: concept match ("where do we handle auth?", "how does booking flow work?")
9
+ - **Know the exact string/symbol?** `Grep` tool (fastest, zero overhead)
10
+ - **Know the file already?** → `Read` tool directly
11
+ - **Searching by concept/behavior?** `Bash(gmax "query" --agent)` (semantic search)
12
+ - **Need file structure?** → `Bash(gmax skeleton <path>)`
13
+ - **Need call flow?** → `Bash(gmax trace <symbol>)`
13
14
 
14
15
  ## IMPORTANT: Use CLI, not MCP tools
15
16
 
@@ -0,0 +1,66 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Postinstall: sync plugin files (SKILL.md, hooks, plugin.json) to
4
+ * the Claude Code plugin cache if it exists. This ensures `npm update -g grepmax`
5
+ * automatically updates the skill instructions without needing `gmax install-claude-code`.
6
+ */
7
+ const fs = require("node:fs");
8
+ const path = require("node:path");
9
+ const os = require("node:os");
10
+
11
+ const pluginCacheBase = path.join(os.homedir(), ".claude", "plugins", "cache", "grepmax", "grepmax");
12
+ const sourcePlugin = path.join(__dirname, "..", "plugins", "grepmax");
13
+
14
+ if (!fs.existsSync(pluginCacheBase) || !fs.existsSync(sourcePlugin)) {
15
+ // Plugin not installed via Claude Code — skip silently
16
+ process.exit(0);
17
+ }
18
+
19
+ // Find installed version directories
20
+ let entries;
21
+ try {
22
+ entries = fs.readdirSync(pluginCacheBase, { withFileTypes: true });
23
+ } catch {
24
+ process.exit(0);
25
+ }
26
+
27
+ const versionDirs = entries.filter((e) => e.isDirectory()).map((e) => e.name);
28
+ if (versionDirs.length === 0) process.exit(0);
29
+
30
+ // Sync files to each installed version
31
+ function copyRecursive(src, dest) {
32
+ if (!fs.existsSync(src)) return;
33
+ const stat = fs.statSync(src);
34
+ if (stat.isDirectory()) {
35
+ fs.mkdirSync(dest, { recursive: true });
36
+ for (const entry of fs.readdirSync(src)) {
37
+ copyRecursive(path.join(src, entry), path.join(dest, entry));
38
+ }
39
+ } else {
40
+ fs.mkdirSync(path.dirname(dest), { recursive: true });
41
+ fs.copyFileSync(src, dest);
42
+ }
43
+ }
44
+
45
+ for (const ver of versionDirs) {
46
+ const destDir = path.join(pluginCacheBase, ver);
47
+ try {
48
+ // Sync skills
49
+ copyRecursive(
50
+ path.join(sourcePlugin, "skills"),
51
+ path.join(destDir, "skills"),
52
+ );
53
+ // Sync hooks
54
+ copyRecursive(
55
+ path.join(sourcePlugin, "hooks"),
56
+ path.join(destDir, "hooks"),
57
+ );
58
+ // Sync hooks.json
59
+ const hooksJson = path.join(sourcePlugin, "hooks.json");
60
+ if (fs.existsSync(hooksJson)) {
61
+ fs.copyFileSync(hooksJson, path.join(destDir, "hooks.json"));
62
+ }
63
+ } catch {
64
+ // Best-effort — don't fail the install
65
+ }
66
+ }