github-search-cli 9.5.1 → 9.7.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 CHANGED
@@ -6,6 +6,101 @@ Format follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). Publish
6
6
 
7
7
  ---
8
8
 
9
+ ## [9.7.0] — 2026-09-19 (released)
10
+
11
+ ### Added
12
+
13
+ - **CLI parity with the MCP tools** — the three MCP-only capabilities are now
14
+ first-class CLI commands:
15
+ - `ghfind deep-dive <owner/repo> [--json]` — language breakdown, top
16
+ contributors, and a README excerpt (previously MCP-only; the agent skill
17
+ doc told agents to `curl` instead).
18
+ - `ghfind --compare` accepts `--json|--csv|--markdown` (previously
19
+ text-only) and reports repos that failed to resolve; it exits non-zero
20
+ when fewer than 2 repos resolve.
21
+ - Trending language filter on the CLI: `ghfind trending <lang>` (the form
22
+ the README already advertised), `ghfind --trending <lang>`, and
23
+ `ghfind --trending --language <lang>` — validated against the same
24
+ accepted-language list as the MCP tool.
25
+ - `ghfind deep-dive --json` exposes a structured payload (language percents,
26
+ contributor counts, raw README) suitable for agents and scripting.
27
+
28
+ ### Changed
29
+
30
+ - The MCP server now shares its repo-ref parsing, trending-language
31
+ validation, and deep-dive data pipeline with the CLI via new seams in
32
+ `deepdive.ts` and `search.ts` (no protocol behavior change).
33
+
34
+ ### Fixed
35
+
36
+ - **`ghfind mcp` failed to typecheck** — `processServerLine` declared `msg`
37
+ as a `let` binding, so TypeScript's aliased-conditional narrowing did not
38
+ apply and every `respond`/`respondError` call site errored on
39
+ `JsonRpcId | undefined`. HEAD did not compile. The id is now extracted
40
+ into a `const` before the notification check; runtime behavior is
41
+ unchanged (all 31 MCP tests pass against the previous behavior).
42
+ - **Deep-dive ran on a zeroed repo stub** — `ghfind deep-dive a/b --json`
43
+ reported `stars: 0`, `description: null`, and no timestamps because the
44
+ repo ref was never resolved. Both the CLI and the `ghfind_deep_dive` MCP
45
+ tool now fetch real repo metadata first (a 404 exits with
46
+ `Repo not found: owner/name`; network failures still degrade gracefully
47
+ to the stub).
48
+
49
+ ---
50
+
51
+ ## [9.6.0] — 2026-09-18 (released)
52
+
53
+ ### Added
54
+
55
+ - **MCP server (beta)** (`ghfind mcp`) — ghfind now speaks the
56
+ [Model Context Protocol](https://modelcontextprotocol.io): any MCP client
57
+ (Claude Code, Cursor, Codex, …) can call GitHub search as tools over stdio.
58
+ Zero new dependencies — the server is a small JSON-RPC 2.0 layer over the
59
+ existing modules. Nine tools: `ghfind_search_repos`, `ghfind_trending`,
60
+ `ghfind_npm_packages`, `ghfind_org_profile`, `ghfind_user_profile`,
61
+ `ghfind_compare_repos`, `ghfind_deep_dive`, `ghfind_bookmarked_releases`,
62
+ and `ghfind_skill`. Implements the 2025-06-18 lifecycle (initialize →
63
+ initialized notification → operation), speaks 2025-06-18 / 2025-03-26 /
64
+ 2024-11-05, reports tool failures as `isError` results per spec, and logs
65
+ agent searches into the TUI history. `ghfind mcp --token <t>` pins a token;
66
+ otherwise config/`GITHUB_TOKEN` applies.
67
+ - **Agent skill (beta)** (`ghfind skill [name]`) — a token-efficient CLI usage guide
68
+ for coding agents (search syntax, flags, rate limits, token-efficiency
69
+ tips) so they stop parsing `--help`. Bare `ghfind skill` lists the catalog;
70
+ the registry (`src/agent-skill.ts`) is generic, so third parties can
71
+ register their own skills alongside the built-in `ghfind-cli` one.
72
+ - **Trending language filter** — `SearchOptions.trendingLanguage` and the
73
+ `ghfind_trending` MCP tool accept a github.com/trending language slug
74
+ (`rust`, `python`, …); `buildTrendingUrl` validates against the known
75
+ language list and drops unknown slugs instead of scraping an error page.
76
+ - **`NO_COLOR` support** — `ghfind --doctor` no longer emits ANSI color
77
+ codes when `NO_COLOR` is set (any value, per
78
+ [no-color.org](https://no-color.org/)) or when stdout is not a TTY.
79
+ - **curl installer** (`scripts/install.sh`) — downloads the standalone
80
+ binary for the detected platform from GitHub Releases, verifies it
81
+ against the release's `SHA256SUMS.txt`, installs to `~/.local/bin` or
82
+ `/usr/local/bin` (overridable with `GHFIND_INSTALL_DIR`, never needs
83
+ sudo), and prints a PATH hint when needed.
84
+ - **`SHA256SUMS.txt` on every release** — new `checksums` job in the
85
+ release workflow merges all platform binaries' checksums into one
86
+ file attached to the GitHub Release; the curl installer and package
87
+ maintainers verify against it.
88
+ - **Community health files** — `SECURITY.md` (private vulnerability
89
+ reporting), `CODE_OF_CONDUCT.md` (Contributor Covenant 2.1), and
90
+ `SUPPORT.md` (routes users to `--doctor`, issues, and discussions).
91
+
92
+ ### Fixed
93
+
94
+ - **`scripts/brew.rb` formula was stale and broken** — pointed at the
95
+ wrong repo (`frank/search-cli`), version 0.1.0, and `search-cli-*`
96
+ asset names that never matched the release artifacts. Now targets
97
+ `codersdfs/search-cli` releases with the correct `ghfind-*` asset
98
+ names (plus linux-arm64), a livecheck block, and a version-pinning
99
+ test. Still a template: SHA256 placeholders are filled from
100
+ `SHA256SUMS.txt` when the tap lands.
101
+
102
+ ---
103
+
9
104
  ## [9.5.1] — 2026-09-15
10
105
 
11
106
  ### Fixed
package/README.md CHANGED
@@ -26,23 +26,31 @@
26
26
  npm install -g github-search-cli
27
27
  ```
28
28
 
29
+ Or via the **curl installer** (Linux/macOS — downloads the standalone
30
+ binary, verifies its SHA256 against the release checksums, no Node
31
+ needed):
32
+
33
+ ```bash
34
+ curl -fsSL https://raw.githubusercontent.com/codersdfs/search-cli/main/scripts/install.sh | sh
35
+ ```
36
+
29
37
  Or grab a **standalone binary** (no Node.js needed) from [GitHub Releases](https://github.com/codersdfs/search-cli/releases) — `ghfind-<os>-<arch>` executables for Linux, macOS, and Windows.
30
38
 
31
39
  ## Why ghfind?
32
40
 
33
- | | `ghfind` | `gh search` (GitHub CLI) | `hub` |
34
- | ------------------------------------------ | -------- | ------------------------ | ----- |
35
- | Repo search + qualifiers | ✅ | ✅ | ❌ |
36
- | Trending repos (day/week/month/year) | ✅ | ❌ | ❌ |
37
- | Full-screen TUI, keyboard-driven | ✅ | ❌ | ❌ |
38
- | Bookmarks, tags & release tracking | ✅ | ❌ | ❌ |
39
- | Side-by-side repo compare | ✅ | ❌ | ❌ |
40
- | Deep-dive (README, contributors, activity) | ✅ | ❌ | ❌ |
41
- | npm package search | ✅ | ❌ | ❌ |
42
- | Org profile | ✅ | ✅ | ❌ |
43
- | User profile | ✅ | ❌ | ❌ |
44
- | Pipeable JSON / CSV / Markdown export | ✅ | JSON only | ❌ |
45
- | No login required | ✅ | ❌ | ❌ |
41
+ | | `ghfind` | `gh search` (GitHub CLI) | `hub` |
42
+ | ------------------------------------------- | -------- | ------------------------ | ----- |
43
+ | Repo search + qualifiers | ✅ | ✅ | ❌ |
44
+ | Trending repos (day/week/month/year) | ✅ | ❌ | ❌ |
45
+ | Full-screen TUI, keyboard-driven | ✅ | ❌ | ❌ |
46
+ | Bookmarks, tags & release tracking | ✅ | ❌ | ❌ |
47
+ | Side-by-side repo compare (JSON/CSV/MD) | ✅ | ❌ | ❌ |
48
+ | Deep-dive (languages, contributors, README) | ✅ | ❌ | ❌ |
49
+ | npm package search | ✅ | ❌ | ❌ |
50
+ | Org profile | ✅ | ✅ | ❌ |
51
+ | User profile | ✅ | ❌ | ❌ |
52
+ | Pipeable JSON / CSV / Markdown export | ✅ | JSON only | ❌ |
53
+ | No login required | ✅ | ❌ | ❌ |
46
54
 
47
55
  > **No separate runtime needed!** Only requires Node.js 20+. The TUI needs Bun,
48
56
  > which is downloaded automatically at install time. Non-interactive modes work
@@ -80,12 +88,49 @@ ghfind "query" --format urls # one URL per line
80
88
  ghfind "query" --pipe open # open in browser
81
89
  ghfind "query" --pipe clone # clone commands
82
90
  ghfind --trending --json # trending as JSON
91
+ ghfind trending rust --json # trending, filtered by language
83
92
  ghfind --watch "query" # poll every 300s
84
93
  ghfind --releases # new releases for bookmarked repos
85
94
  ghfind --compare a/b c/d # side-by-side comparison
95
+ ghfind --compare a/b c/d --json # comparison as JSON|CSV|Markdown
96
+ ghfind deep-dive a/b --json # deep-dive: languages, contributors, README
86
97
  ghfind pkg "query" --json # npm package search as JSON
87
98
  ```
88
99
 
100
+ ## Use with AI agents
101
+
102
+ ghfind speaks the [Model Context Protocol](https://modelcontextprotocol.io) —
103
+ any MCP client (Claude Code, Cursor, Codex, …) can call its GitHub search
104
+ as tools:
105
+
106
+ ```bash
107
+ claude mcp add ghfind -- ghfind mcp
108
+ ```
109
+
110
+ or in your MCP client config:
111
+
112
+ ```json
113
+ {
114
+ "mcpServers": {
115
+ "ghfind": { "command": "ghfind", "args": ["mcp"] }
116
+ }
117
+ }
118
+ ```
119
+
120
+ Exposed tools: `ghfind_search_repos`, `ghfind_trending`,
121
+ `ghfind_npm_packages`, `ghfind_org_profile`, `ghfind_user_profile`,
122
+ `ghfind_compare_repos`, `ghfind_deep_dive`, `ghfind_bookmarked_releases`,
123
+ and `ghfind_skill` (a token-efficient CLI usage guide for agents).
124
+ Unauthenticated requests are rate-limited to 60/hr — set `GITHUB_TOKEN`
125
+ in the environment for 5,000/hr.
126
+
127
+ CLI-first agents can skip MCP entirely:
128
+
129
+ ```bash
130
+ ghfind skill # list agent skills
131
+ ghfind skill ghfind-cli # print the token-efficient CLI guide
132
+ ```
133
+
89
134
  ### Completions
90
135
 
91
136
  ```bash
@@ -117,6 +162,8 @@ ghfind --completion fish | source
117
162
  <tr><td><b>Graph</b></td><td>Space → Activity graph — commit chart, fullscreen toggle</td></tr>
118
163
  <tr><td><b>Help</b></td><td><code>?</code> / <code>Ctrl+H</code> — keybindings reference</td></tr>
119
164
  <tr><td><b>Watch</b></td><td><code>--watch</code> — poll for new results</td></tr>
165
+ <tr><td><b>MCP server</b></td><td><code>ghfind mcp</code> — GitHub search as tools for AI agents (Claude Code, Cursor, …)</td></tr>
166
+ <tr><td><b>Agent skill</b></td><td><code>ghfind skill</code> — token-efficient CLI usage guide for coding agents</td></tr>
120
167
  </table>
121
168
 
122
169
  <details>
@@ -224,7 +271,7 @@ Prefix with `-` to exclude. Supported: `language`, `stars`, `fork`, `archived`,
224
271
  }
225
272
  ```
226
273
 
227
- Env: `GITHUB_TOKEN`, `GHFIND_CONFIG`, `XDG_CONFIG_HOME`, `XDG_STATE_HOME`
274
+ Env: `GITHUB_TOKEN`, `GHFIND_CONFIG`, `XDG_CONFIG_HOME`, `XDG_STATE_HOME`, `NO_COLOR` (disables colored `--doctor` output, per [no-color.org](https://no-color.org/))
228
275
 
229
276
  ---
230
277
 
@@ -237,14 +284,14 @@ cd ghfind
237
284
  # With Bun (recommended for TUI)
238
285
  bun install
239
286
  bun start # TUI
240
- bun test # 295 tests
287
+ bun test # 355 tests
241
288
  bun run check # format check + tests — the green gate
242
289
  bun run build # build dist/
243
290
 
244
291
  # Or with npm
245
292
  npm install
246
293
  npm start # TUI (requires Node 20+)
247
- npm test # 295 tests
294
+ npm test # 355 tests
248
295
  npm run build # build dist/
249
296
 
250
297
  > Want to contribute? See [CONTRIBUTING.md](CONTRIBUTING.md) for commands,
@@ -257,22 +304,25 @@ npm run build # build dist/
257
304
 
258
305
  Recent releases (full history in [CHANGELOG.md](CHANGELOG.md)):
259
306
 
260
- ### v9.5.1
307
+ ### v9.7.0
261
308
 
262
- - Fixed landing-screen keys leaking into the main view — `/`, `Space`, `t`, `c`, `?`, `q` all double-fired; `b` on the landing screen now opens Bookmarks
263
- - Fixed the update panel clipping the changelog — release notes are now scrollable (`↑↓`/`j`/`k`, `PgUp`/`PgDn`, `Home`/`End`) in a taller panel
309
+ - **CLI parity with the MCP tools** — `ghfind deep-dive <owner/repo>` (languages, contributors, README excerpt, `--json`), `ghfind --compare` with `--json|--csv|--markdown`, and a trending language filter (`ghfind trending rust`, `--trending <lang>`)
310
+ - **Deep-dive metadata fix** — real stars, description, and topics are fetched first instead of a zeroed stub; a 404 exits with `Repo not found`
311
+ - Fixed `ghfind mcp` failing to typecheck (JSON-RPC id narrowing; runtime behavior unchanged)
312
+ - The MCP server and CLI now share repo-ref parsing, language validation, and the deep-dive pipeline
264
313
 
265
- ### v9.5.0
314
+ ### v9.6.0
266
315
 
267
- - New `ghfind user <name>` command — user profiles like `ghfind org`: repos, total stars/forks, followers, top languages, top repos
268
- - Supports `--json`, `--csv`, `--markdown`, `--count`, `--limit`, `--token`; `@` prefix accepted
269
- - Fixed `ghfind org` mangling multi-word names with dashes
316
+ - **MCP server (beta)** — `ghfind mcp` turns ghfind into a tool server: Claude Code, Cursor, Codex, and any MCP client can call GitHub search over stdio (nine tools, no new dependencies)
317
+ - **Agent skill (beta)** — `ghfind skill` gives coding agents a token-efficient usage guide; `ghfind trending` accepts a language filter (`ghfind trending rust`)
318
+ - **curl installer** — `curl -fsSL https://raw.githubusercontent.com/codersdfs/search-cli/main/scripts/install.sh | sh` downloads the standalone binary and verifies it against the release's `SHA256SUMS.txt`
319
+ - **`NO_COLOR` support** — `ghfind --doctor` drops ANSI colors when `NO_COLOR` is set or stdout isn't a TTY
320
+ - Fixed the stale `scripts/brew.rb` formula (wrong repo, version, and asset names)
270
321
 
271
- ### v9.3.0
322
+ ### v9.5.1
272
323
 
273
- - Fixed `c` keybinding in TUI not adding repos to comparison — a missing closing brace in the space-key handler broke every later key handler (`c`, `t`, `?`)
274
- - README viewer renders full markdown (headings, code blocks, lists, tables, blockquotes, rules) instead of stripping formatting
275
- - Widened compare table columns (min 35 chars), added Description + URL rows, and raised the topic cap to 5 per repo
324
+ - Fixed landing-screen keys leaking into the main view — `/`, `Space`, `t`, `c`, `?`, `q` all double-fired; `b` on the landing screen now opens Bookmarks
325
+ - Fixed the update panel clipping the changelog — release notes are now scrollable (`↑↓`/`j`/`k`, `PgUp`/`PgDn`, `Home`/`End`) in a taller panel
276
326
 
277
327
  ---
278
328
 
@@ -7,7 +7,7 @@ _ghfind() {
7
7
  cur="${COMP_WORDS[COMP_CWORD]}"
8
8
  prev="${COMP_WORDS[COMP_CWORD-1]}"
9
9
 
10
- opts="--json --csv --markdown --count --limit --sort --token --trending --since --pipe --format --registry --watch --interval --version --help --completion pkg login init doctor org"
10
+ opts="--json --csv --markdown --count --limit --sort --token --trending --language --since --pipe --format --registry --watch --interval --version --help --completion pkg login init doctor org mcp skill trending deep-dive"
11
11
 
12
12
  case "${prev}" in
13
13
  --sort)
@@ -34,6 +34,10 @@ _ghfind() {
34
34
  COMPREPLY=( $(compgen -W "npm" -- "${cur}") )
35
35
  return 0
36
36
  ;;
37
+ --language)
38
+ COMPREPLY=( $(compgen -W "rust python typescript javascript go c c++ c# java ruby php swift kotlin zig" -- "${cur}") )
39
+ return 0
40
+ ;;
37
41
  --limit|--interval)
38
42
  return 0
39
43
  ;;
@@ -9,6 +9,7 @@ complete -c ghfind -l limit -d "Max results" -r
9
9
  complete -c ghfind -l sort -d "Sort strategy" -r -f -a "best-match stars updated forks"
10
10
  complete -c ghfind -l token -d "GitHub token" -r
11
11
  complete -c ghfind -l trending -d "Trending mode"
12
+ complete -c ghfind -l language -d "Trending language filter" -r -f -a "rust python typescript javascript go c c++ c# java ruby php swift kotlin zig"
12
13
  complete -c ghfind -l since -d "Trending period" -r -f -a "daily weekly monthly"
13
14
  complete -c ghfind -l pipe -d "Pipe target" -r -f -a "clone open"
14
15
  complete -c ghfind -l format -d "Output format" -r -f -a "urls names ssh-urls clone-commands ids"
@@ -20,4 +21,4 @@ complete -c ghfind -l version -d "Print version"
20
21
  complete -c ghfind -l help -d "Print help"
21
22
  complete -c ghfind -l completion -d "Shell" -r -f -a "bash zsh fish"
22
23
 
23
- complete -c ghfind -f -a "login init doctor org pkg"
24
+ complete -c ghfind -f -a "login init doctor org pkg mcp skill trending deep-dive"
@@ -12,6 +12,7 @@ _ghfind() {
12
12
  '--sort[Sort strategy]:(best-match stars updated forks)'
13
13
  '--token[GitHub token]:token:'
14
14
  '--trending[Trending mode]'
15
+ '--language[Trending language filter]:language:'
15
16
  '--since[Trending period]:(daily weekly monthly)'
16
17
  '--pipe[Pipe target]:(clone open)'
17
18
  '--format[Output format]:(urls names ssh-urls clone-commands ids)'
@@ -28,6 +29,10 @@ _ghfind() {
28
29
  'doctor[Environment diagnostics]'
29
30
  'org[Org profile]:org name:'
30
31
  'pkg[Search packages]:query:'
32
+ 'trending[Trending repos, optionally by language]'
33
+ 'deep-dive[Repo deep-dive: languages, contributors, README]:owner/repo:'
34
+ 'mcp[Run the MCP server for AI agents (stdio)]'
35
+ 'skill[Print an agent skill guide]:skill name:'
31
36
  )
32
37
  _arguments "${opts[@]}" '*:query:'
33
38
  }