@gkoreli/ghx 2.1.13 → 2.1.19
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 +15 -16
- package/package.json +11 -7
package/README.md
CHANGED
|
@@ -41,10 +41,10 @@ brew install gkoreli/tap/ghx
|
|
|
41
41
|
npm install -g @gkoreli/ghx
|
|
42
42
|
|
|
43
43
|
# Go
|
|
44
|
-
go install github.com/gkoreli/ghx/v2@latest
|
|
44
|
+
go install github.com/gkoreli/ghx/v2/cmd/ghx@latest
|
|
45
45
|
|
|
46
46
|
# Build from source
|
|
47
|
-
|
|
47
|
+
go build -o ghx ./cmd/ghx
|
|
48
48
|
```
|
|
49
49
|
|
|
50
50
|
Requires: [gh CLI](https://cli.github.com/) authenticated (`gh auth login`).
|
|
@@ -72,7 +72,10 @@ ghx explore <owner/repo> <path> # Subdirectory listing
|
|
|
72
72
|
ghx read <owner/repo> <f1> [f2] [f3] # Read 1-10 files (GraphQL batching)
|
|
73
73
|
ghx read <owner/repo> <dir> # Directory path → returns file listing
|
|
74
74
|
ghx read <owner/repo> "src/**/*.ts" --map # Glob patterns with structural map
|
|
75
|
-
ghx read <owner/repo> --map <f1> [f2] #
|
|
75
|
+
ghx read <owner/repo> --map <f1> [f2] # Parser-backed structural map (~92% token reduction)
|
|
76
|
+
ghx read <owner/repo> --map --kind func <f> # Map only functions/methods
|
|
77
|
+
ghx read <owner/repo> --map --kind type <f> # Map only types/structs/interfaces
|
|
78
|
+
ghx read <owner/repo> --map --level minimal <f> # Symbol names only (e.g. UserService.GetUser)
|
|
76
79
|
ghx read <owner/repo> --grep "pat" <f> # Matching lines only (ERE regex, 2 lines context)
|
|
77
80
|
ghx read <owner/repo> --lines 42-80 <f> # Specific line range
|
|
78
81
|
ghx search "<query>" # Code search with matching lines
|
|
@@ -135,28 +138,24 @@ Designed for eager context injection via spawn hooks — the agent always has th
|
|
|
135
138
|
|
|
136
139
|
Wraps `gh` CLI with GraphQL batching. `repos` and `explore` batch search + metadata + README into 1 call. `read` uses GraphQL aliases to fetch up to 10 files in 1 call — and if a path is a directory, returns its file listing instead of "not found" (via `... on Tree` inline fragments in the same query, zero extra API calls). Glob patterns (`src/**/*.ts`) auto-expand via tree fetch + [doublestar](https://github.com/bmatcuk/doublestar) matching in 2 API calls. `--grep` uses ERE regex with BRE normalization (agents trained on `grep` write `\|` for alternation — both styles work). `search` hits REST `/search/code` with `text_matches` for matching context and 200-char token protection.
|
|
137
140
|
|
|
141
|
+
`--map` runs a dedicated parser engine on the fetched content — no extra API calls. Engine selection is automatic: **Go** uses `go/ast` (top-level declarations only, full multi-line signatures, generics preserved), **TypeScript, JavaScript, Python, Rust** use [gotreesitter](https://github.com/odvcencio/gotreesitter) (captures class/impl methods that regex cannot reach), everything else falls back to regex. Methods carry a parent reference (`UserService.GetUser`) visible at `--level minimal`. `--map-engine regex` forces the fallback for any file.
|
|
142
|
+
|
|
138
143
|
Codemode runs JS in a [goja](https://github.com/nicholasgasior/goja) sandbox with esbuild TypeScript transpilation. Tools are injected as synchronous functions on a `codemode` global object. Max 20 tool calls per execution, 64KB code size limit.
|
|
139
144
|
|
|
140
145
|
## Architecture
|
|
141
146
|
|
|
142
147
|
```
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
148
|
+
cmd/ghx/ — binary entrypoint
|
|
149
|
+
internal/cli/ — CLI frontend (cobra) + MCP server commands
|
|
150
|
+
internal/ghx/ — core library (Explore, Read, Search, Repos, Tree, Glob)
|
|
151
|
+
internal/codemode/ — JS executor (goja sandbox, TS transpilation, type generation)
|
|
152
|
+
internal/mapengine/ — parser-backed map engine (GoAST, TreeSitter, Regex, engine routing)
|
|
153
|
+
internal/sidecar/ — sidecar runtime, sessions, reports, and ACP integration
|
|
154
|
+
internal/skilldoc/ — embedded CLI and MCP agent skill markdown
|
|
147
155
|
```
|
|
148
156
|
|
|
149
157
|
See [docs/adr/](docs/adr/) for architectural decisions.
|
|
150
158
|
|
|
151
|
-
## v1 (bash)
|
|
152
|
-
|
|
153
|
-
The original bash implementation is in [`v1/`](v1/). Zero dependencies beyond `gh` and `jq` — useful if you just want a shell script you can drop anywhere without compiling Go.
|
|
154
|
-
|
|
155
|
-
```bash
|
|
156
|
-
npm install -g @gkoreli/ghx # npm
|
|
157
|
-
cp v1/ghx /usr/local/bin/ghx # manual
|
|
158
|
-
```
|
|
159
|
-
|
|
160
159
|
## License
|
|
161
160
|
|
|
162
161
|
MIT
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gkoreli/ghx",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.19",
|
|
4
4
|
"description": "Agent-first GitHub code exploration. GraphQL batching, code maps, codemode TypeScript sandbox, MCP server.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"ghx": "npm/bin/ghx"
|
|
@@ -18,6 +18,10 @@
|
|
|
18
18
|
"type": "git",
|
|
19
19
|
"url": "git+https://github.com/gkoreli/ghx.git"
|
|
20
20
|
},
|
|
21
|
+
"packageManager": "pnpm@10.22.0",
|
|
22
|
+
"workspaces": [
|
|
23
|
+
"packages/*"
|
|
24
|
+
],
|
|
21
25
|
"files": [
|
|
22
26
|
"npm/bin/ghx",
|
|
23
27
|
"README.md",
|
|
@@ -27,11 +31,11 @@
|
|
|
27
31
|
"node": ">=16"
|
|
28
32
|
},
|
|
29
33
|
"optionalDependencies": {
|
|
30
|
-
"@gkoreli/ghx-darwin-arm64": "2.1.
|
|
31
|
-
"@gkoreli/ghx-darwin-x64": "2.1.
|
|
32
|
-
"@gkoreli/ghx-linux-arm64": "2.1.
|
|
33
|
-
"@gkoreli/ghx-linux-x64": "2.1.
|
|
34
|
-
"@gkoreli/ghx-win32-arm64": "2.1.
|
|
35
|
-
"@gkoreli/ghx-win32-x64": "2.1.
|
|
34
|
+
"@gkoreli/ghx-darwin-arm64": "2.1.19",
|
|
35
|
+
"@gkoreli/ghx-darwin-x64": "2.1.19",
|
|
36
|
+
"@gkoreli/ghx-linux-arm64": "2.1.19",
|
|
37
|
+
"@gkoreli/ghx-linux-x64": "2.1.19",
|
|
38
|
+
"@gkoreli/ghx-win32-arm64": "2.1.19",
|
|
39
|
+
"@gkoreli/ghx-win32-x64": "2.1.19"
|
|
36
40
|
}
|
|
37
41
|
}
|