@nothumanwork/wit 0.1.15 → 0.1.17

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
@@ -88,28 +88,28 @@ wit rg 'fn main' ratatui/ratatui --ignore '.git' --ignore '*.lock'
88
88
  wit cat 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
 
@@ -226,32 +226,31 @@ wit tail -p 100 ratatui/ratatui src/lib.rs # From line 100 to end
226
226
  - 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
227
  - Push a semver tag (for example `v0.2.0`) to trigger `.github/workflows/release.yml`.
228
228
  - `.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.
229
+ - `.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`.
230
+ - `.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
231
  - `install.sh` downloads the matching archive and verifies it against the checksum manifest when available.
232
232
 
233
233
  ## Architecture
234
234
 
235
235
  ```
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
236
+ crates/wit/src/
237
+ ├── cli.rs # CLI entry point
238
+ ├── lib.rs # Library exports (gitops, sed, search, search_run)
239
+ ├── search.rs # GitHub repository search, query assembly, limit-aware pagination
240
+ ├── search_run.rs # `wit search`: GitHub-only orchestration
241
+ ├── sed.rs
242
+ └── gitops/ # Bare-repo cache, tree, ls, cat, rg, head, tail
243
+
244
+ crates/wits/ # grep.app client + `wits` binary; shared result printing
247
245
  ```
248
246
 
249
247
  ## Dependencies
250
248
 
251
249
  - `clap` - CLI argument parsing
252
250
  - `gix` (gitoxide) - Bare clone + tree traversal + blob reading
253
- - `reqwest` - HTTP client for grep.app
254
- - `scraper` - HTML parsing for code snippets
251
+ - `octocrab` - GitHub REST API (`wit search`)
252
+ - `reqwest` - HTTP client (grep.app in `wits`; other HTTP in wit)
253
+ - `scraper` - HTML parsing for grep.app snippets (`wits`)
255
254
  - `grep-regex` / `grep-searcher` / `grep-matcher` - Ripgrep-style search on blobs
256
255
  - `ptree` - Tree display
257
256
  - `colored` - Terminal output formatting
@@ -1,6 +1,6 @@
1
- cb0f5ca02cad7aa6ca9ab72f06c28274bc1d03cd0634878ec0c7860858a324e7 wit-linux-aarch64.tar.gz
2
- 06fcc3ba0d0827aa0cb77b2c1c26ea98526f9e2d74aaa446629b889f23271a2c wit-linux-x86_64.tar.gz
3
- 43322f2cd008f69e6d648c12ab2d120dc23b631fd0429424ce93eeebfd78fe2b wit-macos-aarch64.tar.gz
4
- d92b487faa3e30290e69f853b2d1df067f8174d3104eacc5395ecd8b1cf2c2cc wit-macos-x86_64.tar.gz
5
- 339ed6145aae0a6a25d22ba3b6572b550eac278462bd463e327ddfa2c99e38b4 wit-windows-aarch64.zip
6
- 69e55278c53bee00c7a850c58c0ca1f2fa05cc7f5709173a488aab450006401e wit-windows-x86_64.zip
1
+ d9d4a5542e4c25ae08626ef229b3d98a517fa68c589c2c84c054ec6d85326fd7 wit-linux-aarch64.tar.gz
2
+ 418ecdb63c68aac8b6acb147c26bb5c26de84d1a2f5b9b61132925706facf88e wit-linux-x86_64.tar.gz
3
+ fac9570a652a6f76dcef35bc75275a11600d1f1cbff923d60c5e173d4aeb33ea wit-macos-aarch64.tar.gz
4
+ 90aa2a80f6293720d124b24be9cbfccafccb9dcb09da6fc6f630bc5060840179 wit-macos-x86_64.tar.gz
5
+ c9200339d94c94e35ea47d4839bf80f22aecd4832845a233024bfe1c12407284 wit-windows-aarch64.zip
6
+ 9c74e5067eae8122ba9cf4b2a90e026b47b160c82b4c30a42081bbf6340e6b4f 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.15",
3
+ "version": "0.1.17",
4
4
  "description": "GitHub exploration CLI for AI agents",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {
@@ -109,15 +109,15 @@ function extractArchive(archivePath, destination) {
109
109
  }
110
110
 
111
111
  if (archivePath.endsWith(".zip")) {
112
+ const escapedArchivePath = archivePath.replace(/'/g, "''");
113
+ const escapedDestination = destination.replace(/'/g, "''");
112
114
  runCommand(
113
115
  "powershell.exe",
114
116
  [
115
117
  "-NoProfile",
116
118
  "-NonInteractive",
117
119
  "-Command",
118
- "Expand-Archive -LiteralPath $args[0] -DestinationPath $args[1] -Force",
119
- archivePath,
120
- destination,
120
+ `Expand-Archive -LiteralPath '${escapedArchivePath}' -DestinationPath '${escapedDestination}' -Force`,
121
121
  ],
122
122
  );
123
123
  return;