@nothumanwork/wit 0.1.16 → 0.1.18

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 CHANGED
@@ -64,13 +64,13 @@ cargo install --path .
64
64
 
65
65
  ```bash
66
66
  wit search -p 'ratatui' -l 'Rust' # Find repos
67
- wit tree ratatui/ratatui # See structure
68
- wit ls -l ratatui/ratatui src # Browse with sizes
69
- wit rg -l 'impl Widget' ratatui/ratatui # Find files
70
- wit cat -n ratatui/ratatui src/lib.rs # Read a file
71
- wit head -n 30 ratatui/ratatui Cargo.toml # Preview a file
72
- wit sed -n '100,150p' ratatui/ratatui src/lib.rs # Extract range
73
- wit rg 'TODO' ratatui/ratatui --ignore '.git' --ignore '*.png' # Exclude paths
67
+ wit tree -r ratatui/ratatui # See structure
68
+ wit ls -l -r ratatui/ratatui src # Browse with sizes
69
+ wit rg -l 'impl Widget' -r ratatui/ratatui # Find files
70
+ wit cat -n -r ratatui/ratatui src/lib.rs # Read a file
71
+ wit head -n 30 -r ratatui/ratatui Cargo.toml # Preview a file
72
+ wit sed -n -r ratatui/ratatui '100,150p' src/lib.rs # Extract range
73
+ wit rg 'TODO' -r ratatui/ratatui --ignore '.git' --ignore '*.png' # Exclude paths
74
74
  ```
75
75
 
76
76
  ## Global Options
@@ -82,75 +82,76 @@ wit rg 'TODO' ratatui/ratatui --ignore '.git' --ignore '*.png' # Exclude paths
82
82
  Ignore examples:
83
83
 
84
84
  ```bash
85
- wit tree ratatui/ratatui --ignore '.github' --ignore 'assets/**'
86
- wit ls ratatui/ratatui src --ignore 'generated'
87
- wit rg 'fn main' ratatui/ratatui --ignore '.git' --ignore '*.lock'
88
- wit cat ratatui/ratatui src/main.rs --ignore 'src/main.rs' # blocked (explicitly ignored)
85
+ wit tree -r ratatui/ratatui --ignore '.github' --ignore 'assets/**'
86
+ wit ls -r ratatui/ratatui src --ignore 'generated'
87
+ wit rg 'fn main' -r ratatui/ratatui --ignore '.git' --ignore '*.lock'
88
+ wit cat -r ratatui/ratatui src/main.rs --ignore 'src/main.rs' # blocked (explicitly ignored)
89
89
  ```
90
90
 
91
- `search` accepts `--ignore`, but applies it only when `--with-snippets` is enabled.
91
+ `search` ignores `--ignore`, because repository discovery is done through GitHub's repository search API rather than cached file traversal.
92
92
 
93
93
  ## Commands
94
94
 
95
95
  ### search (alias: s)
96
96
 
97
- Find GitHub repositories by name and search their code via grep.app.
97
+ Discover repositories using **GitHub’s repository search API** only. Results are ordered by **stars** and the table shows **stars**. Use `-p/--pattern` for a repository-name filter, `-l/--lang` for a GitHub `language:` qualifier, and `-q/--query` to pass raw GitHub repository-search terms and qualifiers through unchanged.
98
+
99
+ Set **`GITHUB_TOKEN`** for higher GitHub rate limits. GitHub’s `language:` filter must match [GitHub language names](https://github.com/search?q=language%3ARust&type=repositories). `wit search` fetches only enough GitHub pages to satisfy `--limit` (default: `10`, max: `1000`). GitHub may return at most 1000 repositories per query; if GitHub sets `incomplete_results`, a warning is printed.
98
100
 
99
101
  ```bash
100
- wit search -p 'ratatui' -l 'Rust' # Find Rust repos named 'ratatui'
101
- wit search -p 'auth' -q 'JWT' -l 'Go' -w # Find Go auth repos using JWT, show code
102
- wit search -p 'ratatui' -q 'impl Widget' -w -c # Matching lines only, no context
102
+ wit search -p 'ratatui' -l 'Rust' --limit 20 # Rust repos named ratatui (by stars)
103
+ wit search -q 'stars:>1000 topic:tui archived:false' # Raw GitHub qualifiers
104
+ wit search -p 'auth' -q 'user:ory language:Go pushed:>2025-01-01'
103
105
  ```
104
106
 
105
107
  | Flag | Long | Description |
106
108
  |------|------|-------------|
107
- | `-p` | `--pattern` | Regex pattern to match repository names (required) |
108
- | `-l` | `--lang` | Filter results by language |
109
- | `-q` | `--query` | Code pattern to search within repos (default: `.*`) |
110
- | `-r` | `--regex` | Enable regex search (default: true) |
111
- | `-w` | `--with-snippets` | Show code snippets with context |
112
- | `-c` | `--compact` | Show only matching lines (requires `-w`) |
109
+ | `-p` | `--pattern` | Optional repository-name filter (`in:name`) |
110
+ | `-l` | `--lang` | Optional GitHub `language:` qualifier |
111
+ | `-q` | `--query` | Raw GitHub search terms and qualifiers, passed through as-is |
112
+ | `-n` | `--limit` | Maximum repositories to print (default `10`, max `1000`) |
113
113
 
114
114
  ### cache (alias: c)
115
115
 
116
- Clone a repository into the local cache (or refresh an existing one). Repos are auto-cached on first use by other commands.
116
+ Clone a repository into the local cache (or refresh an existing one). Pass the repository with `-r` / `--repo` (`owner/repo`). Repos are auto-cached on first use by other commands.
117
117
 
118
118
  ```bash
119
- wit cache ratatui/ratatui # Force re-clone of ratatui
119
+ wit cache -r ratatui/ratatui # Force re-clone of ratatui
120
120
  ```
121
121
 
122
122
  ### tree (alias: t)
123
123
 
124
- Show the file tree of a repository (or subtree). Use `-l` for line counts and token estimates.
124
+ Show the file tree of a repository (or subtree). Pass the repository with `-r` / `--repo` (`owner/repo`). Use `-l` for line counts and token estimates.
125
125
 
126
126
  ```bash
127
- wit tree ratatui/ratatui # Full repo tree
128
- wit tree ratatui/ratatui src/widgets # Only the widgets subtree
129
- wit tree -l ratatui/ratatui src # With line counts and token estimates
127
+ wit tree -r ratatui/ratatui # Full repo tree
128
+ wit tree -r ratatui/ratatui src/widgets # Only the widgets subtree
129
+ wit tree -l -r ratatui/ratatui src # With line counts and token estimates
130
130
  ```
131
131
 
132
132
  ### ls
133
133
 
134
- List directory contents (non-recursive). Unlike `tree`, shows only immediate children. Use `-l` for file sizes.
134
+ List directory contents (non-recursive). Unlike `tree`, shows only immediate children. Pass the repository with `-r` / `--repo` (`owner/repo`). Use `-l` for file sizes.
135
135
 
136
136
  ```bash
137
- wit ls ratatui/ratatui # List repo root
138
- wit ls ratatui/ratatui src/widgets # List a subdirectory
139
- wit ls -l ratatui/ratatui src # With line counts and token estimates
137
+ wit ls -r ratatui/ratatui # List repo root
138
+ wit ls -r ratatui/ratatui src/widgets # List a subdirectory
139
+ wit ls -l -r ratatui/ratatui src # With line counts and token estimates
140
140
  ```
141
141
 
142
142
  ### cat
143
143
 
144
- Print a file's contents. For large files, prefer `head`/`tail`/`sed` to read specific ranges, or `rg` to search.
144
+ Print a file's contents. Pass the repository with `-r` / `--repo` (`owner/repo`). For large files, prefer `head`/`tail`/`sed` to read specific ranges, or `rg` to search.
145
145
 
146
146
  ```bash
147
- wit cat ratatui/ratatui Cargo.toml # Print file
148
- wit cat -n ratatui/ratatui src/lib.rs # With line numbers
149
- wit cat -b ratatui/ratatui README.md # Number non-blank lines only
147
+ wit cat -r ratatui/ratatui Cargo.toml # Print file
148
+ wit cat -n -r ratatui/ratatui src/lib.rs # With line numbers
149
+ wit cat -b -r ratatui/ratatui README.md # Number non-blank lines only
150
150
  ```
151
151
 
152
152
  | Flag | Long | Description |
153
153
  |------|------|-------------|
154
+ | `-r` | `--repo` | GitHub repository (`owner/repo`) |
154
155
  | `-n` | `--number` | Number all output lines |
155
156
  | `-b` | `--number-nonblank` | Number non-blank lines only (overrides -n) |
156
157
  | `-s` | `--squeeze-blank` | Suppress repeated empty lines |
@@ -160,18 +161,19 @@ wit cat -b ratatui/ratatui README.md # Number non-blank lines only
160
161
 
161
162
  ### rg
162
163
 
163
- Search file contents (ripgrep-style). Use `-l` to find files, `-g` to filter by type.
164
+ Search file contents (ripgrep-style). Pass the repository with `-r` / `--repo` (`owner/repo`). Use `-l` to find files, `-g` to filter by type.
164
165
 
165
166
  ```bash
166
- wit rg 'impl Widget' ratatui/ratatui # Find implementations
167
- wit rg -l 'struct.*Frame' ratatui/ratatui # List files containing pattern
168
- wit rg -g '*.rs' -i 'todo' ratatui/ratatui # Case-insensitive in .rs files
169
- wit rg -C 3 'fn render' ratatui/ratatui # 3 lines of context
170
- wit rg -l --long 'Widget' ratatui/ratatui # File list with line counts
167
+ wit rg 'impl Widget' -r ratatui/ratatui # Find implementations
168
+ wit rg -l 'struct.*Frame' -r ratatui/ratatui # List files containing pattern
169
+ wit rg -g '*.rs' -i 'todo' -r ratatui/ratatui # Case-insensitive in .rs files
170
+ wit rg -C 3 'fn render' -r ratatui/ratatui # 3 lines of context
171
+ wit rg -l --long 'Widget' -r ratatui/ratatui # File list with line counts
171
172
  ```
172
173
 
173
174
  | Flag | Long | Description |
174
175
  |------|------|-------------|
176
+ | `-r` | `--repo` | GitHub repository (`owner/repo`) |
175
177
  | `-i` | `--ignore-case` | Case insensitive search |
176
178
  | `-S` | `--smart-case` | Case-insensitive if pattern is all lowercase |
177
179
  | `-w` | `--word-regexp` | Match whole words only |
@@ -187,38 +189,39 @@ wit rg -l --long 'Widget' ratatui/ratatui # File list with line counts
187
189
 
188
190
  ### sed
189
191
 
190
- Extract or transform file content using sed scripts (POSIX-style, Rust regex).
192
+ Extract or transform file content using sed scripts (POSIX-style, Rust regex). Pass the repository with `-r` / `--repo` (`owner/repo`).
191
193
 
192
194
  ```bash
193
- wit sed -n '320,460p' modal-labs/modal-client modal/image.py # Print line range
194
- wit sed -n '/TODO/p' ratatui/ratatui src/lib.rs # Lines matching pattern
195
- wit sed 's/Widget/Component/g' ratatui/ratatui src/lib.rs # Substitute text
196
- wit sed -n '/^pub fn/p' ratatui/ratatui src/lib.rs # Extract function signatures
195
+ wit sed -n -r modal-labs/modal-client '320,460p' modal/image.py # Print line range
196
+ wit sed -n -r ratatui/ratatui '/TODO/p' src/lib.rs # Lines matching pattern
197
+ wit sed -r ratatui/ratatui 's/Widget/Component/g' src/lib.rs # Substitute text
198
+ wit sed -n -r ratatui/ratatui '/^pub fn/p' src/lib.rs # Extract function signatures
197
199
  ```
198
200
 
199
201
  **Notes:**
202
+ - Pass the repository with `-r` / `--repo` (`owner/repo`). Positional arguments are the sed script and the file path, or only the path when the script comes from `-e` / `-f`.
200
203
  - Regex uses Rust syntax (not POSIX BRE).
201
204
  - `sed` operates on a single repo file (no stdin or in-place edits).
202
205
  - Supports addresses, substitution, hold space, branching, and most POSIX commands.
203
206
 
204
207
  ### head
205
208
 
206
- Print the first N lines of a file (default: 10). Use to preview a file before deciding whether to read it fully.
209
+ Print the first N lines of a file (default: 10). Pass the repository with `-r` / `--repo` (`owner/repo`). Use to preview a file before deciding whether to read it fully.
207
210
 
208
211
  ```bash
209
- wit head ratatui/ratatui src/lib.rs # First 10 lines
210
- wit head -n 50 ratatui/ratatui Cargo.toml # First 50 lines
211
- wit head -N ratatui/ratatui README.md # With line numbers
212
+ wit head -r ratatui/ratatui src/lib.rs # First 10 lines
213
+ wit head -n 50 -r ratatui/ratatui Cargo.toml # First 50 lines
214
+ wit head -N -r ratatui/ratatui README.md # With line numbers
212
215
  ```
213
216
 
214
217
  ### tail
215
218
 
216
- Print the last N lines of a file, or from line N onward. Use `-p` to read from a specific line to end-of-file.
219
+ Print the last N lines of a file, or from line N onward. Pass the repository with `-r` / `--repo` (`owner/repo`). Use `-p` to read from a specific line to end-of-file.
217
220
 
218
221
  ```bash
219
- wit tail ratatui/ratatui src/lib.rs # Last 10 lines
220
- wit tail -n 20 ratatui/ratatui Cargo.toml # Last 20 lines
221
- wit tail -p 100 ratatui/ratatui src/lib.rs # From line 100 to end
222
+ wit tail -r ratatui/ratatui src/lib.rs # Last 10 lines
223
+ wit tail -n 20 -r ratatui/ratatui Cargo.toml # Last 20 lines
224
+ wit tail -p 100 -r ratatui/ratatui src/lib.rs # From line 100 to end
222
225
  ```
223
226
 
224
227
  ## Packaging & Release
@@ -226,32 +229,31 @@ wit tail -p 100 ratatui/ratatui src/lib.rs # From line 100 to end
226
229
  - Every push to `main` triggers `.github/workflows/auto-tag.yml`, which increments the patch version in `Cargo.toml`, creates a new `vX.Y.Z` tag, and pushes it.
227
230
  - Push a semver tag (for example `v0.2.0`) to trigger `.github/workflows/release.yml`.
228
231
  - `.github/workflows/release.yml` can also be triggered manually with `workflow_dispatch` (select a `vX.Y.Z` tag ref).
229
- - The workflow builds and uploads `wit-<platform>-<arch>` archives plus `wit-checksums.txt` to the GitHub release.
230
- - `.github/workflows/publish-npm.yml` publishes `@nothumanwork/wit` from the GitHub release assets and can be re-run manually for an existing release tag without rebuilding Rust binaries.
232
+ - `.github/workflows/release.yml` validates the tag ref, builds Linux/macOS/Windows artifacts on GitHub-hosted runners, uploads `wit-<platform>-<arch>` archives plus `wit-checksums.txt`, and then invokes `.github/workflows/publish-npm.yml`.
233
+ - `.github/workflows/publish-npm.yml` publishes `@nothumanwork/wit` from the attached GitHub release assets and can be re-run manually for an existing release tag without rebuilding Rust binaries.
231
234
  - `install.sh` downloads the matching archive and verifies it against the checksum manifest when available.
232
235
 
233
236
  ## Architecture
234
237
 
235
238
  ```
236
- src/
237
- ├── cli.rs # CLI entry point and display logic
238
- ├── lib.rs # Library exports
239
- ├── sed.rs # POSIX-style sed engine
240
- ├── gitops/
241
- │ ├── mod.rs
242
- │ └── ops.rs # Bare-repo caching, file access, tree, ls, head/tail, ripgrep
243
- └── grep/
244
- ├── mod.rs
245
- ├── client.rs # grep.app API client
246
- └── types.rs # Response types and data structures
239
+ crates/wit/src/
240
+ ├── cli.rs # CLI entry point
241
+ ├── lib.rs # Library exports (gitops, sed, search, search_run)
242
+ ├── search.rs # GitHub repository search, query assembly, limit-aware pagination
243
+ ├── search_run.rs # `wit search`: GitHub-only orchestration
244
+ ├── sed.rs
245
+ └── gitops/ # Bare-repo cache, tree, ls, cat, rg, head, tail
246
+
247
+ crates/wits/ # grep.app client + `wits` binary; shared result printing
247
248
  ```
248
249
 
249
250
  ## Dependencies
250
251
 
251
252
  - `clap` - CLI argument parsing
252
253
  - `gix` (gitoxide) - Bare clone + tree traversal + blob reading
253
- - `reqwest` - HTTP client for grep.app
254
- - `scraper` - HTML parsing for code snippets
254
+ - `octocrab` - GitHub REST API (`wit search`)
255
+ - `reqwest` - HTTP client (grep.app in `wits`; other HTTP in wit)
256
+ - `scraper` - HTML parsing for grep.app snippets (`wits`)
255
257
  - `grep-regex` / `grep-searcher` / `grep-matcher` - Ripgrep-style search on blobs
256
258
  - `ptree` - Tree display
257
259
  - `colored` - Terminal output formatting
@@ -1,6 +1,6 @@
1
- 537832c6ed342cefdaae053365d0f2da0f0e5709c66a50b4cd0cf2aca8ca7cff wit-linux-aarch64.tar.gz
2
- 3e426c8e5925f3614f17f609d019801c7cde6d7d4a27a3458da6879ac29013a1 wit-linux-x86_64.tar.gz
3
- 19c0e55a68fabce3ade9d018037df5a2678c92374f5bf6c012f9fdc13f19ff49 wit-macos-aarch64.tar.gz
4
- 6df40e9e9e128db4d47a272a5cdbfd315e7b6479f0f84483a7fe00eb0d5374c5 wit-macos-x86_64.tar.gz
5
- cfe949d7f002547665c713f6d530b8915369651f7c2d7fe43114fd612494b8af wit-windows-aarch64.zip
6
- b9ceeec230d78e0448720781c3c19446a974f3803045d96d41617abab5b77915 wit-windows-x86_64.zip
1
+ 3a399a6e11d3d98a4cf643f95784a3dc4bc0550620a6783aad59fc420d8f3670 wit-linux-aarch64.tar.gz
2
+ a4941c90b17523605d75f1e5985146542e58602fd3bb73c76b1a03f109f42f40 wit-linux-x86_64.tar.gz
3
+ c8709c7af64d91397d495e59e5f74034cb2896e0ec20ab07f211b4ef1286f87e wit-macos-aarch64.tar.gz
4
+ e618b007eea0a21c3a6566cbf09f4aeb8cedae3d4804a10ac13f5c26ee397ed6 wit-macos-x86_64.tar.gz
5
+ 99acd626091d1f15bf318ac0b5e423f9162415ebe2b96ee8ce13ed98ddc17987 wit-windows-aarch64.zip
6
+ 87515be2a1da63b8d1e68467f43ae53f8c960cc726653e4cf0fc409fbc21e096 wit-windows-x86_64.zip
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nothumanwork/wit",
3
- "version": "0.1.16",
3
+ "version": "0.1.18",
4
4
  "description": "GitHub exploration CLI for AI agents",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {