github-search-cli 9.4.1 → 9.4.3

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 (55) hide show
  1. package/CHANGELOG.md +65 -1
  2. package/README.md +268 -237
  3. package/bin/ghfind.js +98 -89
  4. package/completions/ghfind.bash +1 -1
  5. package/completions/ghfind.fish +3 -1
  6. package/completions/ghfind.zsh +6 -0
  7. package/dist/{chunk-IVUU2KGR.js → chunk-GYIL4S5X.js} +4 -1
  8. package/dist/cli.js +1179 -403
  9. package/dist/{config-GNZOQRTH.js → config-OCIPF2IF.js} +1 -1
  10. package/package.json +16 -5
  11. package/release-notes/9.3.0.md +32 -29
  12. package/scripts/build.ts +34 -19
  13. package/scripts/generate-svg-demo.js +218 -168
  14. package/scripts/postinstall.js +176 -176
  15. package/src/bookmarks.ts +69 -69
  16. package/src/cli.ts +650 -566
  17. package/src/compare.ts +69 -47
  18. package/src/config.ts +70 -65
  19. package/src/deepdive.ts +149 -118
  20. package/src/doctor.ts +287 -287
  21. package/src/error-report.ts +8 -12
  22. package/src/errors.ts +62 -59
  23. package/src/explore.ts +34 -29
  24. package/src/export.ts +73 -63
  25. package/src/help.ts +157 -157
  26. package/src/history.ts +69 -55
  27. package/src/init.ts +60 -55
  28. package/src/landing.ts +106 -104
  29. package/src/login.ts +186 -0
  30. package/src/markdown-render.ts +1 -6
  31. package/src/notifications.ts +75 -59
  32. package/src/open-url.ts +16 -16
  33. package/src/org.ts +299 -0
  34. package/src/output.ts +153 -137
  35. package/src/package-browser.ts +317 -305
  36. package/src/package.ts +149 -137
  37. package/src/pipe.ts +60 -54
  38. package/src/releases.ts +182 -144
  39. package/src/saved-searches.ts +72 -50
  40. package/src/search-state.ts +283 -229
  41. package/src/search.ts +678 -653
  42. package/src/session.ts +26 -24
  43. package/src/share.ts +61 -54
  44. package/src/status.ts +68 -61
  45. package/src/storage.ts +136 -106
  46. package/src/themes.ts +259 -116
  47. package/src/tips.ts +42 -42
  48. package/src/toast.ts +70 -69
  49. package/src/trending-parser.ts +104 -0
  50. package/src/trending.ts +481 -462
  51. package/src/tui.ts +3015 -2867
  52. package/src/types.ts +160 -158
  53. package/src/update-check.ts +231 -215
  54. package/src/version.ts +33 -0
  55. package/src/watch.ts +95 -74
package/CHANGELOG.md CHANGED
@@ -6,7 +6,71 @@ Format follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). Publish
6
6
 
7
7
  ---
8
8
 
9
- ## [Unreleased] — 9.4.1
9
+ ## [9.4.2] — 2026-09-12 (released)
10
+
11
+ ### Added
12
+
13
+ - **Standalone binaries** — the release workflow now compiles
14
+ self-contained `ghfind-<os>-<arch>` executables (Linux, macOS, Windows)
15
+ via `bun build --compile` and attaches them to GitHub Releases. No
16
+ Node.js or Bun needed — unblocks Homebrew / Scoop / winget / curl
17
+ install channels.
18
+ - **npm provenance** — `publish-npm` runs `npm publish --provenance` with
19
+ `id-token: write`, so published tarballs carry a verifiable provenance
20
+ badge on npmjs.com.
21
+ - `src/version.ts` — single source for version resolution. Primary
22
+ source is the `__GHFIND_VERSION__` constant injected at build time
23
+ (tsup `define`, bun `--define`); falls back to reading package.json
24
+ relative to the module in source/dist trees.
25
+ - **README trust & comparison** — npm version / weekly downloads / CI /
26
+ TypeScript / license badges; a "Why ghfind?" table vs `gh search` and
27
+ `hub`; standalone-binary install section.
28
+ - **`ghfind login`** — stores a GitHub token for 5,000 req/hr rate limits.
29
+ Detects a token managed by the GitHub CLI (`~/.config/gh/hosts.yml`) and
30
+ offers to import it, or accepts a pasted token; warns if it doesn't look
31
+ like a GitHub credential (`ghp_` / `gho_` / `github_pat_`). Writes the same
32
+ config file as `ghfind init`.
33
+ - **Better failure hints** — the `bin/ghfind.js` entry now points broken
34
+ installs at `ghfind --doctor` instead of failing silently (previously a
35
+ missing `src/` + `dist/` exited 0 without a word).
36
+ - **Hardened trending parser** — `parseTrendingHtml` moved to its own module
37
+ (`src/trending-parser.ts`, no TUI/@opentui dependency). Layout changes that
38
+ previously produced an **empty trending list with no explanation** now throw
39
+ a friendly `ParseError` ("GitHub may have changed the layout. [r]etry").
40
+ New golden-test harness: `tests/fixtures/trending.html` is a live capture
41
+ of the page, and 11 tests pin the parser to it (including the login
42
+ `/login?return_to=…` href and `/owner/name/stargazers`-link false positives).
43
+
44
+ ### Changed
45
+
46
+ - Package description and keywords rewritten around real search intent
47
+ (9 → 17 keywords, e.g. `github-search`, `trending-repositories`,
48
+ `commandline`, `npm-search`, `octokit`).
49
+
50
+ ### Fixed
51
+
52
+ - **In-app update loop was broken** — `performUpdate()` ran
53
+ `npm install -g ghfind`, but no `ghfind` package exists on npm; every
54
+ "Yes" on the update modal failed. Now installs `github-search-cli`,
55
+ and works under Node.js too (previous code used `Bun.spawn`
56
+ unconditionally).
57
+ - **`--version` crashed in compiled binaries** — version was read from
58
+ `package.json` via filesystem paths in `cli.ts`, `tui.ts`,
59
+ `update-check.ts`, and `error-report.ts`, which do not exist inside a
60
+ single-file executable. Version is now embedded at build time.
61
+ - **TUI crashed on boot with upgrade state (`bun start` → exit 1)** — the
62
+ update modal's `showOverlay("update")` called `updateSelect.focus()`, but
63
+ `updateSelect` was never declared (vestigial reference from the 9.4.0
64
+ refactor). Every launch where `update-state.json` recorded a version
65
+ upgrade threw `ReferenceError: updateSelect is not defined` before the
66
+ render loop started. The vestigial call is removed; the modal is driven by
67
+ `updateSelectedOption` + the global key handler, which now renders
68
+ correctly ("Updated ghfind X → Y" panel). Guarded by a source-grep test in
69
+ `tests/overlay-registry.test.ts`.
70
+
71
+ ---
72
+
73
+ ## [Unreleased]
10
74
 
11
75
  ### Changed
12
76
 
package/README.md CHANGED
@@ -1,237 +1,268 @@
1
- # ghfind
2
-
3
- > Search GitHub repos from your terminal. No browser needed.
4
-
5
- <p align="center">
6
- <a href="https://x.com/frankli23709971">
7
- <img src="https://img.shields.io/badge/made%20by-%40frankli23709971-000000?logo=x&labelColor=000000&color=000000&link=https://x.com/frankli23709971" alt="Made by @frankli23709971">
8
- </a>
9
- </p>
10
-
11
- <p align="center">
12
- <img src="https://raw.githubusercontent.com/codersdfs/search-cli/main/demo.svg" alt="ghfind demo" width="100%">
13
- </p>
14
-
15
- [![MIT License](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
16
-
17
- ---
18
-
19
- ## Install
20
-
21
- ```bash
22
- npm install -g github-search-cli
23
- ```
24
-
25
- > **No separate runtime needed!** Only requires Node.js 20+. The TUI needs Bun,
26
- > which is downloaded automatically at install time. Non-interactive modes work
27
- > with just Node.js.
28
- >
29
- > | Platform | TUI | CLI modes |
30
- > | --------------------- | ---------------- | --------- |
31
- > | Node 20+ | ⚠ Bun required | ✅ |
32
- > | Bun | ✅ | ✅ |
33
- > | Downloaded Bun | ✅ auto-installed| ✅ |
34
-
35
- ## Use
36
-
37
- ```bash
38
- # TUI
39
- ghfind
40
-
41
- # pipe
42
- ghfind "language:Rust stars:>1000" --json | jq '.[].fullName'
43
- ghfind "language:Zig" --count
44
- ghfind --trending --json --since weekly
45
- ```
46
-
47
- ### Non-interactive
48
-
49
- ```bash
50
- ghfind "query" --json # JSON
51
- ghfind "query" --csv # CSV
52
- ghfind "query" --markdown # Markdown
53
- ghfind "query" --count # count only
54
- ghfind "query" --format urls # one URL per line
55
- ghfind "query" --pipe open # open in browser
56
- ghfind "query" --pipe clone # clone commands
57
- ghfind --trending --json # trending as JSON
58
- ghfind --watch "query" # poll every 300s
59
- ```
60
-
61
- ### Completions
62
-
63
- ```bash
64
- source <(ghfind --completion bash)
65
- source <(ghfind --completion zsh)
66
- ghfind --completion fish | source
67
- ```
68
-
69
- ---
70
-
71
- ## Features
72
-
73
- <table>
74
- <tr><td><b>Search</b></td><td>Free-text + qualifiers (<code>language:</code>, <code>stars:</code>, <code>topic:</code>), sort by stars/updated/forks</td></tr>
75
- <tr><td><b>Trending</b></td><td>Today, week, month, year — filter by language</td></tr>
76
- <tr><td><b>Bookmarks</b></td><td>Space → Bookmark / Bookmarks panel — save repos, tag them</td></tr>
77
- <tr><td><b>Deep-dive</b></td><td>Space → Deep-dive — languages, contributors, README, activity chart</td></tr>
78
- <tr><td><b>Compare</b></td><td>Space → Compare select / Compare view — side-by-side, select 2+ repos</td></tr>
79
- <tr><td><b>Explore</b></td><td>Space → Topics — browse popular GitHub topics</td></tr>
80
- <tr><td><b>History</b></td><td>Space → History — recall past searches</td></tr>
81
- <tr><td><b>Saved</b></td><td>Space → Saved searches — load or save queries</td></tr>
82
- <tr><td><b>Export</b></td><td>Space → Export — JSON, CSV, Markdown to file</td></tr>
83
- <tr><td><b>Share</b></td><td>Space → Share repo — copy repo link to clipboard</td></tr>
84
- <tr><td><b>Notifications</b></td><td>Space → Notifications — view & dismiss alerts</td></tr>
85
- <tr><td><b>Graph</b></td><td>Space → Activity graph — commit chart, fullscreen toggle</td></tr>
86
- <tr><td><b>Help</b></td><td><code>?</code> / <code>Ctrl+H</code> — keybindings reference</td></tr>
87
- <tr><td><b>Watch</b></td><td><code>--watch</code> — poll for new results</td></tr>
88
- </table>
89
-
90
- <details>
91
- <summary>Keybindings</summary>
92
-
93
- **Global shortcuts** (main view, no overlay active)
94
-
95
- | Key | Action |
96
- | --------------------- | ---------------------------------------------- |
97
- | `/` | Focus search input |
98
- | `Enter` | Execute search / open selected repo in browser |
99
- | `↑` / `↓` — `j` / `k` | Navigate results & menus |
100
- | `Space` | Open leader menu (contextual actions) |
101
- | `Tab` | Auto-complete search qualifier |
102
- | `?` or `Ctrl+H` | Help overlay |
103
- | `1`–`5` | Switch trending tabs (Today → All) |
104
- | `←` / `→` — `h` / `l` | Switch trending tabs (left/right) |
105
- | `PageUp` | Jump to top of results |
106
- | `PageDown` | Load next page of results |
107
- | `Esc` | Close current overlay |
108
- | `q` | Quit ghfind |
109
-
110
- **Leader menu** — press `Space`, navigate with `↑`/`↓`, press `Enter` to dispatch
111
-
112
- Actions shown depend on current mode (search vs trending) and selection:
113
-
114
- | Menu item | Description |
115
- | --------------- | ------------------------------------------------------- |
116
- | Sort | Cycle sort strategy (best-match, stars, updated, forks) |
117
- | Limit | Cycle result limit (10, 25, 50, 100) |
118
- | Refresh | Re-run current search (or reload trending) |
119
- | Toggle trending | Switch between search and trending views |
120
- | Deep-dive | Show languages, contributors, README excerpt |
121
- | Readme | Full README viewer |
122
- | Activity graph | Toggle commit chart fullscreen |
123
- | Bookmark | Save / unsave selected repo |
124
- | Compare | Add/remove repo to comparison set |
125
- | Compare view | Show side-by-side comparison table |
126
- | Open in browser | Open selected repo URL |
127
- | History | Recall past searches |
128
- | Saved searches | Load a saved search |
129
- | Save search | Save current query |
130
- | Export | Export results to JSON / CSV / Markdown |
131
- | Share repo | Copy repo link to clipboard |
132
- | Notifications | View and dismiss alerts |
133
- | Topics | Browse popular GitHub topics |
134
- | Bookmarks panel | Browse saved bookmarks |
135
- | Help | Keybindings reference |
136
-
137
- **Overlay-specific shortcuts**
138
-
139
- | Key | Context | Action |
140
- | --------------- | ---------------------------------------------------- | ------------------------------------------- |
141
- | `Esc` / `q` | Any overlay | Close overlay |
142
- | `Enter` | Leader / History / Saved / Export / Topics / Share | Confirm selection |
143
- | `d` | History / Bookmarks / Saved searches / Notifications | Delete current entry |
144
- | `Ctrl+X` | History | Clear all history |
145
- | `Ctrl+C` | Notifications | Dismiss all notifications |
146
- | `Y` / `N` / `L` | Update modal | Yes (install) / No (skip) / Later (dismiss) |
147
-
148
- Trending tabs: `1`–`5` (Today → All) or `←`/`→` — `h`/`l`
149
-
150
- > Most actions are accessed via the **leader menu** (`Space`). This keeps the keymap minimal while providing a full command palette. The leader menu filters actions contextually — items that don't apply (e.g., Bookmark with no repo selected) are hidden.
151
-
152
- </details>
153
-
154
- ---
155
-
156
- ## Search syntax
157
-
158
- ```
159
- language:Rust stars:>1000 topic:cli
160
- "machine learning" language:Python stars:>5000
161
- topic:cli -language:JavaScript
162
- org:rust-lang language:Rust
163
- ```
164
-
165
- Prefix with `-` to exclude. Supported: `language`, `stars`, `fork`, `archived`, `topic`, `user`, `org`, `repo`, `updated`, `pushed`, `visibility`, `license`, `created`, `size`, `in`.
166
-
167
- ---
168
-
169
- ## Config
170
-
171
- `~/.config/ghfind/config.json` (auto-created, or run `ghfind init`):
172
-
173
- ```json
174
- {
175
- "defaultSort": "stars",
176
- "defaultLimit": 50,
177
- "theme": "tokyo-night",
178
- "githubToken": "ghp_..."
179
- }
180
- ```
181
-
182
- Env: `GITHUB_TOKEN`, `GHFIND_CONFIG`, `XDG_CONFIG_HOME`, `XDG_STATE_HOME`
183
-
184
- ---
185
-
186
- ## From source
187
-
188
- ```bash
189
- git clone https://github.com/codersdfs/search-cli.git
190
- cd ghfind
191
-
192
- # With Bun (recommended for TUI)
193
- bun install
194
- bun start # TUI
195
- bun test # 179 tests
196
- bun run build # build dist/
197
-
198
- # Or with npm
199
- npm install
200
- npm start # TUI (requires Node 20+)
201
- npm test # 179 tests
202
- npm run build # build dist/
203
- ```
204
-
205
- ---
206
-
207
- ## Changelog
208
-
209
- Recent releases (full history in [CHANGELOG.md](CHANGELOG.md)):
210
-
211
- ### v9.3.0
212
- - 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`, `?`)
213
- - README viewer renders full markdown (headings, code blocks, lists, tables, blockquotes, rules) instead of stripping formatting
214
- - Widened compare table columns (min 35 chars), added Description + URL rows, and raised the topic cap to 5 per repo
215
-
216
- ### v9.2.1
217
- - npm package search (beta) and a new landing screen
218
- - Removed the bundled Bun binary — downloaded at install time instead; package size 39.5 MB → 100 KB
219
- - Postinstall failures no longer break `npm install`; `bun` dropped from engines
220
- - Fixed TUI layout on small terminals, trending visibility from the landing screen, and independent trending-tab fetches
221
-
222
- ### v9.1.1
223
- - Bundle `vendor/` and `dist/` for offline install
224
- - Postinstall exits non-zero on Bun download failure; bundled Bun 1.3.12 → 1.3.14
225
-
226
- ### v9.1.0
227
- - Automatic update checking against the npm registry, with a Y/N/L modal
228
- - Leader menu (Space) consolidating all contextual actions
229
- - Topic explorer, notifications panel, saved searches, activity graph, README viewer
230
- - Tab qualifier auto-complete, PageUp/PageDown, `Ctrl+X` clear history, `Ctrl+C` clear notifications
231
- - TUI runs on Node.js 20+ via the downloaded Bun binary
232
-
233
- ---
234
-
235
- ## License
236
-
237
- MIT
1
+ # ghfind
2
+
3
+ > Search GitHub repos from your terminal. No browser needed.
4
+
5
+ <p align="center">
6
+ <a href="https://x.com/frankli23709971">
7
+ <img src="https://img.shields.io/badge/made%20by-%40frankli23709971-000000?logo=x&labelColor=000000&color=000000&link=https://x.com/frankli23709971" alt="Made by @frankli23709971">
8
+ </a>
9
+ </p>
10
+
11
+ <p align="center">
12
+ <a href="https://www.npmjs.com/package/github-search-cli"><img src="https://img.shields.io/npm/v/github-search-cli.svg" alt="npm version"></a>
13
+ <a href="https://www.npmjs.com/package/github-search-cli"><img src="https://img.shields.io/npm/dw/github-search-cli.svg" alt="npm weekly downloads"></a>
14
+ <a href="https://github.com/codersdfs/search-cli/actions/workflows/release.yml"><img src="https://github.com/codersdfs/search-cli/actions/workflows/release.yml/badge.svg" alt="CI"></a>
15
+ <img src="https://img.shields.io/badge/TypeScript-strict-blue.svg" alt="TypeScript strict">
16
+ <a href="https://github.com/codersdfs/search-cli/blob/main/LICENSE"><img src="https://img.shields.io/npm/l/github-search-cli.svg" alt="License"></a>
17
+ </p>
18
+
19
+ <p align="center">
20
+ <img src="https://raw.githubusercontent.com/codersdfs/search-cli/main/demo.svg" alt="ghfind demo" width="100%">
21
+ </p>
22
+
23
+ ## Install
24
+
25
+ ```bash
26
+ npm install -g github-search-cli
27
+ ```
28
+
29
+ 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
+
31
+ ## Why ghfind?
32
+
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
+ | Pipeable JSON / CSV / Markdown export | ✅ | JSON only | ❌ |
43
+ | No login required | ✅ | ❌ | ❌ |
44
+
45
+ > **No separate runtime needed!** Only requires Node.js 20+. The TUI needs Bun,
46
+ > which is downloaded automatically at install time. Non-interactive modes work
47
+ > with just Node.js.
48
+ >
49
+ > | Platform | TUI | CLI modes |
50
+ > | -------------- | ----------------- | --------- |
51
+ > | Node 20+ | ⚠ Bun required | ✅ |
52
+ > | Bun | ✅ | ✅ |
53
+ > | Downloaded Bun | ✅ auto-installed | ✅ |
54
+
55
+ ## Use
56
+
57
+ ```bash
58
+ # TUI
59
+ ghfind
60
+
61
+ # pipe
62
+ ghfind "language:Rust stars:>1000" --json | jq '.[].fullName'
63
+ ghfind "language:Zig" --count
64
+ ghfind --trending --json --since weekly
65
+ ghfind login # import the gh CLI token or paste one
66
+ ```
67
+
68
+ ### Non-interactive
69
+
70
+ ```bash
71
+ ghfind "query" --json # JSON
72
+ ghfind "query" --csv # CSV
73
+ ghfind "query" --markdown # Markdown
74
+ ghfind "query" --count # count only
75
+ ghfind "query" --format urls # one URL per line
76
+ ghfind "query" --pipe open # open in browser
77
+ ghfind "query" --pipe clone # clone commands
78
+ ghfind --trending --json # trending as JSON
79
+ ghfind --watch "query" # poll every 300s
80
+ ```
81
+
82
+ ### Completions
83
+
84
+ ```bash
85
+ source <(ghfind --completion bash)
86
+ source <(ghfind --completion zsh)
87
+ ghfind --completion fish | source
88
+ ```
89
+
90
+ ---
91
+
92
+ ## Features
93
+
94
+ <table>
95
+ <tr><td><b>Search</b></td><td>Free-text + qualifiers (<code>language:</code>, <code>stars:</code>, <code>topic:</code>), sort by stars/updated/forks</td></tr>
96
+ <tr><td><b>Trending</b></td><td>Today, week, month, year — filter by language</td></tr>
97
+ <tr><td><b>Bookmarks</b></td><td>Space → Bookmark / Bookmarks panel — save repos, tag them</td></tr>
98
+ <tr><td><b>Deep-dive</b></td><td>Space → Deep-dive — languages, contributors, README, activity chart</td></tr>
99
+ <tr><td><b>Compare</b></td><td>Space → Compare select / Compare view — side-by-side, select 2+ repos</td></tr>
100
+ <tr><td><b>Explore</b></td><td>Space → Topics — browse popular GitHub topics</td></tr>
101
+ <tr><td><b>History</b></td><td>Space → History — recall past searches</td></tr>
102
+ <tr><td><b>Saved</b></td><td>Space → Saved searches — load or save queries</td></tr>
103
+ <tr><td><b>Export</b></td><td>Space → Export — JSON, CSV, Markdown to file</td></tr>
104
+ <tr><td><b>Share</b></td><td>Space → Share repo — copy repo link to clipboard</td></tr>
105
+ <tr><td><b>Org profile</b></td><td>Space → Org profile — org summary: repos, stars, top languages (<code>ghfind org <name></code> in CLI)</td></tr>
106
+ <tr><td><b>Notifications</b></td><td>Space → Notifications — view & dismiss alerts</td></tr>
107
+ <tr><td><b>Graph</b></td><td>Space → Activity graph — commit chart, fullscreen toggle</td></tr>
108
+ <tr><td><b>Help</b></td><td><code>?</code> / <code>Ctrl+H</code> — keybindings reference</td></tr>
109
+ <tr><td><b>Watch</b></td><td><code>--watch</code> — poll for new results</td></tr>
110
+ </table>
111
+
112
+ <details>
113
+ <summary>Keybindings</summary>
114
+
115
+ **Global shortcuts** (main view, no overlay active)
116
+
117
+ | Key | Action |
118
+ | --------------------- | ---------------------------------------------- |
119
+ | `/` | Focus search input |
120
+ | `Enter` | Execute search / open selected repo in browser |
121
+ | `↑` / `↓` — `j` / `k` | Navigate results & menus |
122
+ | `Space` | Open leader menu (contextual actions) |
123
+ | `Tab` | Auto-complete search qualifier |
124
+ | `?` or `Ctrl+H` | Help overlay |
125
+ | `1`–`5` | Switch trending tabs (Today → All) |
126
+ | `←` / `→` — `h` / `l` | Switch trending tabs (left/right) |
127
+ | `PageUp` | Jump to top of results |
128
+ | `PageDown` | Load next page of results |
129
+ | `Esc` | Close current overlay |
130
+ | `q` | Quit ghfind |
131
+
132
+ **Leader menu** — press `Space`, navigate with `↑`/`↓`, press `Enter` to dispatch
133
+
134
+ Actions shown depend on current mode (search vs trending) and selection:
135
+
136
+ | Menu item | Description |
137
+ | --------------- | ------------------------------------------------------- |
138
+ | Sort | Cycle sort strategy (best-match, stars, updated, forks) |
139
+ | Limit | Cycle result limit (10, 25, 50, 100) |
140
+ | Refresh | Re-run current search (or reload trending) |
141
+ | Toggle trending | Switch between search and trending views |
142
+ | Deep-dive | Show languages, contributors, README excerpt |
143
+ | Readme | Full README viewer |
144
+ | Activity graph | Toggle commit chart fullscreen |
145
+ | Bookmark | Save / unsave selected repo |
146
+ | Compare | Add/remove repo to comparison set |
147
+ | Compare view | Show side-by-side comparison table |
148
+ | Open in browser | Open selected repo URL |
149
+ | History | Recall past searches |
150
+ | Saved searches | Load a saved search |
151
+ | Save search | Save current query |
152
+ | Export | Export results to JSON / CSV / Markdown |
153
+ | Share repo | Copy repo link to clipboard |
154
+ | Org profile | Org summary — repos, total stars, top languages |
155
+ | Notifications | View and dismiss alerts |
156
+ | Topics | Browse popular GitHub topics |
157
+ | Bookmarks panel | Browse saved bookmarks |
158
+ | Help | Keybindings reference |
159
+
160
+ **Overlay-specific shortcuts**
161
+
162
+ | Key | Context | Action |
163
+ | --------------- | ---------------------------------------------------- | ------------------------------------------- |
164
+ | `Esc` / `q` | Any overlay | Close overlay |
165
+ | `Enter` | Leader / History / Saved / Export / Topics / Share | Confirm selection |
166
+ | `d` | History / Bookmarks / Saved searches / Notifications | Delete current entry |
167
+ | `Ctrl+X` | History | Clear all history |
168
+ | `Ctrl+C` | Notifications | Dismiss all notifications |
169
+ | `Y` / `N` / `L` | Update modal | Yes (install) / No (skip) / Later (dismiss) |
170
+
171
+ Trending tabs: `1`–`5` (Today → All) or `←`/`→` — `h`/`l`
172
+
173
+ > Most actions are accessed via the **leader menu** (`Space`). This keeps the keymap minimal while providing a full command palette. The leader menu filters actions contextually — items that don't apply (e.g., Bookmark with no repo selected) are hidden.
174
+
175
+ </details>
176
+
177
+ ---
178
+
179
+ ## Search syntax
180
+
181
+ ```
182
+ language:Rust stars:>1000 topic:cli
183
+ "machine learning" language:Python stars:>5000
184
+ topic:cli -language:JavaScript
185
+ org:rust-lang language:Rust
186
+ ```
187
+
188
+ Prefix with `-` to exclude. Supported: `language`, `stars`, `fork`, `archived`, `topic`, `user`, `org`, `repo`, `updated`, `pushed`, `visibility`, `license`, `created`, `size`, `in`.
189
+
190
+ ---
191
+
192
+ ## Config
193
+
194
+ `~/.config/ghfind/config.json` (auto-created, or run `ghfind init`; `ghfind login` will set your GitHub token):
195
+
196
+ ```json
197
+ {
198
+ "defaultSort": "stars",
199
+ "defaultLimit": 50,
200
+ "theme": "tokyo-night",
201
+ "githubToken": "ghp_..."
202
+ }
203
+ ```
204
+
205
+ Env: `GITHUB_TOKEN`, `GHFIND_CONFIG`, `XDG_CONFIG_HOME`, `XDG_STATE_HOME`
206
+
207
+ ---
208
+
209
+ ## From source
210
+
211
+ ```bash
212
+ git clone https://github.com/codersdfs/search-cli.git
213
+ cd ghfind
214
+
215
+ # With Bun (recommended for TUI)
216
+ bun install
217
+ bun start # TUI
218
+ bun test # 215 tests
219
+ bun run check # format check + tests — the green gate
220
+ bun run build # build dist/
221
+
222
+ # Or with npm
223
+ npm install
224
+ npm start # TUI (requires Node 20+)
225
+ npm test # 215 tests
226
+ npm run build # build dist/
227
+
228
+ > Want to contribute? See [CONTRIBUTING.md](CONTRIBUTING.md) for commands,
229
+ > conventions, and the two tracked quality gates (`typecheck`, `lint`).
230
+ ```
231
+
232
+ ---
233
+
234
+ ## Changelog
235
+
236
+ Recent releases (full history in [CHANGELOG.md](CHANGELOG.md)):
237
+
238
+ ### v9.3.0
239
+
240
+ - 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`, `?`)
241
+ - README viewer renders full markdown (headings, code blocks, lists, tables, blockquotes, rules) instead of stripping formatting
242
+ - Widened compare table columns (min 35 chars), added Description + URL rows, and raised the topic cap to 5 per repo
243
+
244
+ ### v9.2.1
245
+
246
+ - npm package search (beta) and a new landing screen
247
+ - Removed the bundled Bun binary — downloaded at install time instead; package size 39.5 MB → 100 KB
248
+ - Postinstall failures no longer break `npm install`; `bun` dropped from engines
249
+ - Fixed TUI layout on small terminals, trending visibility from the landing screen, and independent trending-tab fetches
250
+
251
+ ### v9.1.1
252
+
253
+ - Bundle `vendor/` and `dist/` for offline install
254
+ - Postinstall exits non-zero on Bun download failure; bundled Bun 1.3.12 → 1.3.14
255
+
256
+ ### v9.1.0
257
+
258
+ - Automatic update checking against the npm registry, with a Y/N/L modal
259
+ - Leader menu (Space) consolidating all contextual actions
260
+ - Topic explorer, notifications panel, saved searches, activity graph, README viewer
261
+ - Tab qualifier auto-complete, PageUp/PageDown, `Ctrl+X` clear history, `Ctrl+C` clear notifications
262
+ - TUI runs on Node.js 20+ via the downloaded Bun binary
263
+
264
+ ---
265
+
266
+ ## License
267
+
268
+ MIT