github-search-cli 9.4.0 → 9.4.2
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 +280 -192
- package/README.md +263 -237
- package/dist/cli.js +448 -91
- package/package.json +84 -74
- package/src/cli.ts +634 -566
- package/src/error-report.ts +8 -12
- package/src/org.ts +271 -0
- package/src/tui/overlays/help.ts +19 -0
- package/src/tui/overlays/registry.ts +52 -0
- package/src/tui.ts +3019 -2867
- package/src/update-check.ts +231 -215
- package/src/version.ts +33 -0
package/README.md
CHANGED
|
@@ -1,237 +1,263 @@
|
|
|
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
|
-
<
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
<
|
|
85
|
-
<
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
|
117
|
-
|
|
|
118
|
-
|
|
|
119
|
-
|
|
|
120
|
-
|
|
|
121
|
-
|
|
|
122
|
-
|
|
|
123
|
-
|
|
|
124
|
-
|
|
|
125
|
-
|
|
|
126
|
-
|
|
|
127
|
-
|
|
|
128
|
-
|
|
|
129
|
-
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
|
140
|
-
|
|
|
141
|
-
|
|
|
142
|
-
|
|
|
143
|
-
|
|
|
144
|
-
|
|
|
145
|
-
|
|
|
146
|
-
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
```
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
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
|
+
```
|
|
66
|
+
|
|
67
|
+
### Non-interactive
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
ghfind "query" --json # JSON
|
|
71
|
+
ghfind "query" --csv # CSV
|
|
72
|
+
ghfind "query" --markdown # Markdown
|
|
73
|
+
ghfind "query" --count # count only
|
|
74
|
+
ghfind "query" --format urls # one URL per line
|
|
75
|
+
ghfind "query" --pipe open # open in browser
|
|
76
|
+
ghfind "query" --pipe clone # clone commands
|
|
77
|
+
ghfind --trending --json # trending as JSON
|
|
78
|
+
ghfind --watch "query" # poll every 300s
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Completions
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
source <(ghfind --completion bash)
|
|
85
|
+
source <(ghfind --completion zsh)
|
|
86
|
+
ghfind --completion fish | source
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
## Features
|
|
92
|
+
|
|
93
|
+
<table>
|
|
94
|
+
<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>
|
|
95
|
+
<tr><td><b>Trending</b></td><td>Today, week, month, year — filter by language</td></tr>
|
|
96
|
+
<tr><td><b>Bookmarks</b></td><td>Space → Bookmark / Bookmarks panel — save repos, tag them</td></tr>
|
|
97
|
+
<tr><td><b>Deep-dive</b></td><td>Space → Deep-dive — languages, contributors, README, activity chart</td></tr>
|
|
98
|
+
<tr><td><b>Compare</b></td><td>Space → Compare select / Compare view — side-by-side, select 2+ repos</td></tr>
|
|
99
|
+
<tr><td><b>Explore</b></td><td>Space → Topics — browse popular GitHub topics</td></tr>
|
|
100
|
+
<tr><td><b>History</b></td><td>Space → History — recall past searches</td></tr>
|
|
101
|
+
<tr><td><b>Saved</b></td><td>Space → Saved searches — load or save queries</td></tr>
|
|
102
|
+
<tr><td><b>Export</b></td><td>Space → Export — JSON, CSV, Markdown to file</td></tr>
|
|
103
|
+
<tr><td><b>Share</b></td><td>Space → Share repo — copy repo link to clipboard</td></tr>
|
|
104
|
+
<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>
|
|
105
|
+
<tr><td><b>Notifications</b></td><td>Space → Notifications — view & dismiss alerts</td></tr>
|
|
106
|
+
<tr><td><b>Graph</b></td><td>Space → Activity graph — commit chart, fullscreen toggle</td></tr>
|
|
107
|
+
<tr><td><b>Help</b></td><td><code>?</code> / <code>Ctrl+H</code> — keybindings reference</td></tr>
|
|
108
|
+
<tr><td><b>Watch</b></td><td><code>--watch</code> — poll for new results</td></tr>
|
|
109
|
+
</table>
|
|
110
|
+
|
|
111
|
+
<details>
|
|
112
|
+
<summary>Keybindings</summary>
|
|
113
|
+
|
|
114
|
+
**Global shortcuts** (main view, no overlay active)
|
|
115
|
+
|
|
116
|
+
| Key | Action |
|
|
117
|
+
| --------------------- | ---------------------------------------------- |
|
|
118
|
+
| `/` | Focus search input |
|
|
119
|
+
| `Enter` | Execute search / open selected repo in browser |
|
|
120
|
+
| `↑` / `↓` — `j` / `k` | Navigate results & menus |
|
|
121
|
+
| `Space` | Open leader menu (contextual actions) |
|
|
122
|
+
| `Tab` | Auto-complete search qualifier |
|
|
123
|
+
| `?` or `Ctrl+H` | Help overlay |
|
|
124
|
+
| `1`–`5` | Switch trending tabs (Today → All) |
|
|
125
|
+
| `←` / `→` — `h` / `l` | Switch trending tabs (left/right) |
|
|
126
|
+
| `PageUp` | Jump to top of results |
|
|
127
|
+
| `PageDown` | Load next page of results |
|
|
128
|
+
| `Esc` | Close current overlay |
|
|
129
|
+
| `q` | Quit ghfind |
|
|
130
|
+
|
|
131
|
+
**Leader menu** — press `Space`, navigate with `↑`/`↓`, press `Enter` to dispatch
|
|
132
|
+
|
|
133
|
+
Actions shown depend on current mode (search vs trending) and selection:
|
|
134
|
+
|
|
135
|
+
| Menu item | Description |
|
|
136
|
+
| --------------- | ------------------------------------------------------- |
|
|
137
|
+
| Sort | Cycle sort strategy (best-match, stars, updated, forks) |
|
|
138
|
+
| Limit | Cycle result limit (10, 25, 50, 100) |
|
|
139
|
+
| Refresh | Re-run current search (or reload trending) |
|
|
140
|
+
| Toggle trending | Switch between search and trending views |
|
|
141
|
+
| Deep-dive | Show languages, contributors, README excerpt |
|
|
142
|
+
| Readme | Full README viewer |
|
|
143
|
+
| Activity graph | Toggle commit chart fullscreen |
|
|
144
|
+
| Bookmark | Save / unsave selected repo |
|
|
145
|
+
| Compare | Add/remove repo to comparison set |
|
|
146
|
+
| Compare view | Show side-by-side comparison table |
|
|
147
|
+
| Open in browser | Open selected repo URL |
|
|
148
|
+
| History | Recall past searches |
|
|
149
|
+
| Saved searches | Load a saved search |
|
|
150
|
+
| Save search | Save current query |
|
|
151
|
+
| Export | Export results to JSON / CSV / Markdown |
|
|
152
|
+
| Share repo | Copy repo link to clipboard |
|
|
153
|
+
| Org profile | Org summary — repos, total stars, top languages |
|
|
154
|
+
| Notifications | View and dismiss alerts |
|
|
155
|
+
| Topics | Browse popular GitHub topics |
|
|
156
|
+
| Bookmarks panel | Browse saved bookmarks |
|
|
157
|
+
| Help | Keybindings reference |
|
|
158
|
+
|
|
159
|
+
**Overlay-specific shortcuts**
|
|
160
|
+
|
|
161
|
+
| Key | Context | Action |
|
|
162
|
+
| --------------- | ---------------------------------------------------- | ------------------------------------------- |
|
|
163
|
+
| `Esc` / `q` | Any overlay | Close overlay |
|
|
164
|
+
| `Enter` | Leader / History / Saved / Export / Topics / Share | Confirm selection |
|
|
165
|
+
| `d` | History / Bookmarks / Saved searches / Notifications | Delete current entry |
|
|
166
|
+
| `Ctrl+X` | History | Clear all history |
|
|
167
|
+
| `Ctrl+C` | Notifications | Dismiss all notifications |
|
|
168
|
+
| `Y` / `N` / `L` | Update modal | Yes (install) / No (skip) / Later (dismiss) |
|
|
169
|
+
|
|
170
|
+
Trending tabs: `1`–`5` (Today → All) or `←`/`→` — `h`/`l`
|
|
171
|
+
|
|
172
|
+
> 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.
|
|
173
|
+
|
|
174
|
+
</details>
|
|
175
|
+
|
|
176
|
+
---
|
|
177
|
+
|
|
178
|
+
## Search syntax
|
|
179
|
+
|
|
180
|
+
```
|
|
181
|
+
language:Rust stars:>1000 topic:cli
|
|
182
|
+
"machine learning" language:Python stars:>5000
|
|
183
|
+
topic:cli -language:JavaScript
|
|
184
|
+
org:rust-lang language:Rust
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
Prefix with `-` to exclude. Supported: `language`, `stars`, `fork`, `archived`, `topic`, `user`, `org`, `repo`, `updated`, `pushed`, `visibility`, `license`, `created`, `size`, `in`.
|
|
188
|
+
|
|
189
|
+
---
|
|
190
|
+
|
|
191
|
+
## Config
|
|
192
|
+
|
|
193
|
+
`~/.config/ghfind/config.json` (auto-created, or run `ghfind init`):
|
|
194
|
+
|
|
195
|
+
```json
|
|
196
|
+
{
|
|
197
|
+
"defaultSort": "stars",
|
|
198
|
+
"defaultLimit": 50,
|
|
199
|
+
"theme": "tokyo-night",
|
|
200
|
+
"githubToken": "ghp_..."
|
|
201
|
+
}
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
Env: `GITHUB_TOKEN`, `GHFIND_CONFIG`, `XDG_CONFIG_HOME`, `XDG_STATE_HOME`
|
|
205
|
+
|
|
206
|
+
---
|
|
207
|
+
|
|
208
|
+
## From source
|
|
209
|
+
|
|
210
|
+
```bash
|
|
211
|
+
git clone https://github.com/codersdfs/search-cli.git
|
|
212
|
+
cd ghfind
|
|
213
|
+
|
|
214
|
+
# With Bun (recommended for TUI)
|
|
215
|
+
bun install
|
|
216
|
+
bun start # TUI
|
|
217
|
+
bun test # 179 tests
|
|
218
|
+
bun run build # build dist/
|
|
219
|
+
|
|
220
|
+
# Or with npm
|
|
221
|
+
npm install
|
|
222
|
+
npm start # TUI (requires Node 20+)
|
|
223
|
+
npm test # 179 tests
|
|
224
|
+
npm run build # build dist/
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
---
|
|
228
|
+
|
|
229
|
+
## Changelog
|
|
230
|
+
|
|
231
|
+
Recent releases (full history in [CHANGELOG.md](CHANGELOG.md)):
|
|
232
|
+
|
|
233
|
+
### v9.3.0
|
|
234
|
+
|
|
235
|
+
- 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`, `?`)
|
|
236
|
+
- README viewer renders full markdown (headings, code blocks, lists, tables, blockquotes, rules) instead of stripping formatting
|
|
237
|
+
- Widened compare table columns (min 35 chars), added Description + URL rows, and raised the topic cap to 5 per repo
|
|
238
|
+
|
|
239
|
+
### v9.2.1
|
|
240
|
+
|
|
241
|
+
- npm package search (beta) and a new landing screen
|
|
242
|
+
- Removed the bundled Bun binary — downloaded at install time instead; package size 39.5 MB → 100 KB
|
|
243
|
+
- Postinstall failures no longer break `npm install`; `bun` dropped from engines
|
|
244
|
+
- Fixed TUI layout on small terminals, trending visibility from the landing screen, and independent trending-tab fetches
|
|
245
|
+
|
|
246
|
+
### v9.1.1
|
|
247
|
+
|
|
248
|
+
- Bundle `vendor/` and `dist/` for offline install
|
|
249
|
+
- Postinstall exits non-zero on Bun download failure; bundled Bun 1.3.12 → 1.3.14
|
|
250
|
+
|
|
251
|
+
### v9.1.0
|
|
252
|
+
|
|
253
|
+
- Automatic update checking against the npm registry, with a Y/N/L modal
|
|
254
|
+
- Leader menu (Space) consolidating all contextual actions
|
|
255
|
+
- Topic explorer, notifications panel, saved searches, activity graph, README viewer
|
|
256
|
+
- Tab qualifier auto-complete, PageUp/PageDown, `Ctrl+X` clear history, `Ctrl+C` clear notifications
|
|
257
|
+
- TUI runs on Node.js 20+ via the downloaded Bun binary
|
|
258
|
+
|
|
259
|
+
---
|
|
260
|
+
|
|
261
|
+
## License
|
|
262
|
+
|
|
263
|
+
MIT
|