github-search-cli 9.8.3 → 9.9.0
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/CHANGELOG.md +72 -0
- package/README.md +32 -10
- package/dist/cli.js +543 -67
- package/docs/HOW-TO.md +254 -0
- package/package.json +2 -1
- package/release-notes/9.9.0.md +193 -0
- package/src/cli.ts +13 -11
- package/src/errors.ts +35 -11
- package/src/mcp-server.ts +18 -2
- package/src/search-state.ts +8 -10
- package/src/search.ts +683 -11
- package/src/trending.ts +2 -6
- package/src/tui.ts +55 -17
- package/src/types.ts +11 -1
- package/src/update-check.ts +72 -6
- package/src/watch.ts +16 -11
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,78 @@ Format follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). Publish
|
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
9
|
+
## [9.9.0] — 2026-10-01 (released)
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
|
|
13
|
+
- **Queries are understood instead of passed through.** Every surface —
|
|
14
|
+
TUI, CLI, MCP, `--watch` — now parses and checks a query before spending an
|
|
15
|
+
API call, so a typo or a malformed value fails with a specific, actionable
|
|
16
|
+
message instead of an opaque 422 or a misleading "network error".
|
|
17
|
+
- Misspelled qualifiers are corrected: `langauge:Rust` → `language:Rust`,
|
|
18
|
+
`star:1000` → `stars:1000`, `push:>2024-01-01` → `pushed:>2024-01-01`.
|
|
19
|
+
Correction is scoped to the qualifiers ghfind knows, so a qualifier it has
|
|
20
|
+
never heard of (`is:`, `has:`, `props.*`) is passed through untouched
|
|
21
|
+
rather than mangled into something else.
|
|
22
|
+
- Counts accept `k`/`m` sugar: `stars:10k` → `stars:>=10000`,
|
|
23
|
+
`size:1m` → `size:>=1000000`, `stars:1k..10k` → `stars:1000..10000`.
|
|
24
|
+
A bare count keeps GitHub's exact-match meaning — `stars:100` still means
|
|
25
|
+
exactly 100.
|
|
26
|
+
- Values are validated per qualifier: numeric counts, `fork:true|false|only`,
|
|
27
|
+
`archived:true|false`, ISO8601 dates for `created`/`pushed`/`updated`,
|
|
28
|
+
the `visibility:` enum, and the `in:` searchable fields. An invalid value
|
|
29
|
+
reports the bad token and the fix, e.g. `⚠ Invalid query: "stars:abc" is
|
|
30
|
+
not a number — use stars:100, stars:>=100, or stars:1k..10k`.
|
|
31
|
+
- `validateQuery` is now called by the CLI, the MCP server and `--watch`, not
|
|
32
|
+
just the TUI. Previously only the TUI enforced the one existing rule.
|
|
33
|
+
- **Zero-result searches now suggest how to loosen the query.** Qualifiers are
|
|
34
|
+
ranked by how sharply they narrow results — a star or size threshold empties
|
|
35
|
+
a result set outright, so those are loosened first — and each suggestion
|
|
36
|
+
rewrites one qualifier rather than dropping it: `No results for "rust
|
|
37
|
+
stars:>=5000000"` now offers `Try: rust stars:>=500000`.
|
|
38
|
+
- **`GHFIND_LOG=<path>` writes TUI diagnostics to a file.** The TUI owns the
|
|
39
|
+
screen and cannot print diagnostics into it, and its logger was previously a
|
|
40
|
+
silent no-op — which made API failures undiagnosable. Token values are
|
|
41
|
+
redacted from logged URLs. Unset by default, so there is no cost in normal
|
|
42
|
+
use.
|
|
43
|
+
- **`docs/HOW-TO.md`** — a task-oriented guide: setting up a token, writing
|
|
44
|
+
queries, reading results, and what to do when a search returns nothing or an
|
|
45
|
+
error appears.
|
|
46
|
+
|
|
47
|
+
### Fixed
|
|
48
|
+
|
|
49
|
+
- **A forbidden response no longer claims SSO is the cause.** Three unrelated
|
|
50
|
+
conditions return 403 with rate-limit budget remaining — SSO not authorizing
|
|
51
|
+
the token, a secondary/abuse rate limit, and org resource restrictions —
|
|
52
|
+
and the message asserted the SSO case unconditionally, sending people to fix
|
|
53
|
+
a credential problem that did not exist. The message now reports GitHub's
|
|
54
|
+
own reason and names both plausible causes; the response headers and body
|
|
55
|
+
(which identify the real one) are written to `GHFIND_LOG`.
|
|
56
|
+
- **`forks` is recognised as a qualifier.** Only `fork` was listed, so
|
|
57
|
+
`forks:100` was fuzzy-matched into `fork:100` and lost its numeric
|
|
58
|
+
validation. `forks`, `topics` and `followers` are now known too, and
|
|
59
|
+
`fork` (boolean) stays distinct from `forks` (count).
|
|
60
|
+
- **Custom-property qualifiers are no longer misread as keywords.**
|
|
61
|
+
`props.environment:production` contains a dot, which the parser rejected, so
|
|
62
|
+
it silently became a literal search term instead of a qualifier.
|
|
63
|
+
- **`--watch` fails fast on a malformed query** instead of retrying the same
|
|
64
|
+
non-transient error five times.
|
|
65
|
+
- **The post-upgrade panel no longer reappears on every launch.** It is
|
|
66
|
+
triggered by `lastInstalledVersion !== currentVersion`, and nothing ever
|
|
67
|
+
cleared `lastInstalledVersion` — so after one upgrade the "Updated ghfind
|
|
68
|
+
X → Y" panel showed again on every single launch, including after dismissing
|
|
69
|
+
it with **later** or **never** (neither touched that field). The panel now
|
|
70
|
+
acknowledges itself when shown. A recorded version _newer_ than the running
|
|
71
|
+
one is deliberately left alone, so a rollback or a mid-session update is
|
|
72
|
+
still reported.
|
|
73
|
+
- **A prerelease is no longer offered as an upgrade.** The Node/compiled
|
|
74
|
+
fallback in the version comparison treated `9.9.0-beta.1` as newer than
|
|
75
|
+
`9.9.0` — advertising a downgrade. Comparison now follows npm ordering: a
|
|
76
|
+
prerelease counts only when its numeric core is genuinely ahead, and build
|
|
77
|
+
metadata (`+build.5`) is ignored rather than corrupting the parse.
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
9
81
|
## [9.8.3] — 2026-10-01 (released)
|
|
10
82
|
|
|
11
83
|
### Fixed
|
package/README.md
CHANGED
|
@@ -292,7 +292,22 @@ topic:cli -language:JavaScript
|
|
|
292
292
|
org:rust-lang language:Rust
|
|
293
293
|
```
|
|
294
294
|
|
|
295
|
-
Prefix with `-` to exclude. Supported: `language`, `stars`, `fork`, `archived`, `topic`, `user`, `org`, `repo`, `updated`, `pushed`, `visibility`, `license`, `created`, `
|
|
295
|
+
Prefix with `-` to exclude. Supported: `language`, `stars`, `forks`, `topics`, `followers`, `size`, `fork`, `archived`, `topic`, `user`, `org`, `repo`, `updated`, `pushed`, `visibility`, `license`, `created`, `in`.
|
|
296
|
+
|
|
297
|
+
Queries are parsed and checked before the request is sent:
|
|
298
|
+
|
|
299
|
+
- **Qualifier typos are corrected** — `langauge:Rust` → `language:Rust`,
|
|
300
|
+
`star:1000` → `stars:1000`. Correction is limited to the qualifiers listed
|
|
301
|
+
above, so `is:`, `has:` and `props.*` pass through untouched.
|
|
302
|
+
- **Counts accept `k`/`m`** — `stars:10k` means 10,000 or more. A bare count
|
|
303
|
+
keeps GitHub's exact-match meaning, so use `stars:>=100` or `stars:10k`
|
|
304
|
+
rather than `stars:100`.
|
|
305
|
+
- **An invalid value is rejected with the fix**, not sent to GitHub:
|
|
306
|
+
`⚠ Invalid query: "stars:abc" is not a number — use stars:100, stars:>=100, or stars:1k..10k`
|
|
307
|
+
- **An empty result suggests how to loosen the query** — qualifiers are ranked
|
|
308
|
+
by how sharply they narrow results, and the message offers a concrete retry.
|
|
309
|
+
|
|
310
|
+
See [docs/HOW-TO.md](docs/HOW-TO.md) for a task-oriented walkthrough.
|
|
296
311
|
|
|
297
312
|
---
|
|
298
313
|
|
|
@@ -309,7 +324,7 @@ Prefix with `-` to exclude. Supported: `language`, `stars`, `fork`, `archived`,
|
|
|
309
324
|
}
|
|
310
325
|
```
|
|
311
326
|
|
|
312
|
-
Env: `GITHUB_TOKEN`, `GHFIND_CONFIG`, `GHFIND_SKILL_ROOTS` (path-separator separated skill directories for `ghfind skill search`), `XDG_CONFIG_HOME`, `XDG_STATE_HOME`, `NO_COLOR` (disables colored `--doctor` output, per [no-color.org](https://no-color.org/))
|
|
327
|
+
Env: `GITHUB_TOKEN`, `GHFIND_CONFIG`, `GHFIND_LOG` (path — write TUI diagnostics there; unset by default), `GHFIND_SKILL_ROOTS` (path-separator separated skill directories for `ghfind skill search`), `XDG_CONFIG_HOME`, `XDG_STATE_HOME`, `NO_COLOR` (disables colored `--doctor` output, per [no-color.org](https://no-color.org/))
|
|
313
328
|
|
|
314
329
|
---
|
|
315
330
|
|
|
@@ -322,14 +337,14 @@ cd ghfind
|
|
|
322
337
|
# With Bun (recommended for TUI)
|
|
323
338
|
bun install
|
|
324
339
|
bun start # TUI
|
|
325
|
-
bun test #
|
|
340
|
+
bun test # 624 tests
|
|
326
341
|
bun run check # format check + tests — the green gate
|
|
327
342
|
bun run build # build dist/
|
|
328
343
|
|
|
329
344
|
# Or with npm
|
|
330
345
|
npm install
|
|
331
346
|
npm start # TUI (requires Node 20+)
|
|
332
|
-
npm test #
|
|
347
|
+
npm test # 624 tests
|
|
333
348
|
npm run build # build dist/
|
|
334
349
|
|
|
335
350
|
> Want to contribute? See [CONTRIBUTING.md](CONTRIBUTING.md) for commands,
|
|
@@ -363,6 +378,19 @@ for the architecture, measurements, and remaining work.
|
|
|
363
378
|
|
|
364
379
|
Recent releases (full history in [CHANGELOG.md](CHANGELOG.md)):
|
|
365
380
|
|
|
381
|
+
### v9.9.0
|
|
382
|
+
|
|
383
|
+
- **Queries are understood before they are sent** — every surface (TUI, CLI, MCP, `--watch`) parses and checks a query first, so a typo or bad value fails with a specific message and a fix instead of an opaque GitHub 422 or a misleading "network error"; previously only the TUI ran validation at all
|
|
384
|
+
- **Qualifier typos are corrected** — `langauge:Rust` → `language:Rust`, `star:1000` → `stars:1000`, `push:>` → `pushed:>`; correction is limited to the qualifiers ghfind knows, so `is:`, `has:` and `props.*` are never mangled
|
|
385
|
+
- **Counts accept `k`/`m`** — `stars:10k` → `stars:>=10000`, `size:1m`, `stars:1k..10k`; a bare count keeps GitHub's exact-match meaning, so `stars:100` is still exactly 100
|
|
386
|
+
- **Values are validated per qualifier** — numeric counts, `fork:true|false|only`, `archived:true|false`, calendar-checked ISO8601 dates for `created`/`pushed`/`updated`, the `visibility:` enum, and `in:` fields; documented comma-lists like `in:name,description` still work
|
|
387
|
+
- **Zero results suggest how to loosen the query** — `No results for "rust stars:>=5000000"` now offers `Try: rust stars:>=500000`, ranked by how sharply each qualifier narrows results
|
|
388
|
+
- **`GHFIND_LOG=<path>` writes TUI diagnostics to a file** — the TUI's logger was a silent no-op, making API failures undiagnosable; token values are redacted from logged URLs
|
|
389
|
+
- **A 403 no longer claims SSO is the cause** — SSO enforcement, secondary rate limits and org restrictions all produce it, and the message asserted the first one unconditionally; it now reports GitHub's own reason
|
|
390
|
+
- **The post-upgrade panel no longer reappears on every launch** — it was triggered by a version inequality nothing ever cleared, so it showed after every single launch _including_ after "later" or "never"; it now acknowledges itself once shown
|
|
391
|
+
- **A prerelease is no longer offered as an upgrade** — the version comparison used by Node and the compiled binaries reported `9.9.0-beta.1` as newer than `9.9.0`, i.e. a downgrade; it now follows npm ordering and ignores build metadata
|
|
392
|
+
- **A new [how-to guide](docs/HOW-TO.md)** — token setup, writing queries, reading results, recovering from errors, and copy-paste recipes
|
|
393
|
+
|
|
366
394
|
### v9.8.3
|
|
367
395
|
|
|
368
396
|
- **401/403 say what actually happened** — a rejected token and an authenticated-but-forbidden request (e.g. SAML/SSO enforcement) both used to report "Network error", naming a connectivity problem you didn't have; only genuine connectivity and server failures keep that message now
|
|
@@ -397,12 +425,6 @@ Recent releases (full history in [CHANGELOG.md](CHANGELOG.md)):
|
|
|
397
425
|
[Known limitations](#known-limitations); the v9.8.0 notes wrongly described it
|
|
398
426
|
as working
|
|
399
427
|
|
|
400
|
-
### v9.8.0
|
|
401
|
-
|
|
402
|
-
- **README viewer renders real markdown** — headings, emphasis, links, lists, blockquotes, boxed tables, and fenced code now come from OpenTUI's markdown renderable with a theme-derived syntax style instead of a box-drawing text approximation
|
|
403
|
-
- **Images render inline — see [Known limitations](#known-limitations)** — relative and `/`-rooted paths resolve against the README's branch, `github.com/.../blob/...` links are rewritten to raw content, downloads are cached and size-capped, SVG and badge-service images are skipped, and anything unloadable falls back to an `🖼 alt` caption; press `i` in the viewer to toggle images
|
|
404
|
-
- **No new dependencies** — the PNG decoder, image-to-cells rasteriser, and fetch cache are plain TypeScript, and images draw with truecolor half blocks, so they work on any truecolor terminal without image-protocol support
|
|
405
|
-
|
|
406
428
|
## License
|
|
407
429
|
|
|
408
430
|
MIT
|