Skip to content

Releases

v1.2.4

Choose a tag to compare

@dhaern dhaern released this 07 Nov 02:08
be8182a

1.2.4

opencode-bettergrep

  • When neither rg nor GNU grep can be used, the error now says what each check found: system rg not found on PATH or system rg at <path> failed its --version check, the managed rg, and the same for system grep. Before, it only listed which checks had run. Related to #21.

opencode-betterglob

  • Same change: when the auto-install fails, the error says whether the system rg was missing from PATH or was rejected, and that there was no valid managed rg.

opencode-betterread

No code changes. The version moves to 1.2.4 so the three packages stay on the same release.

Verification: Bun 1.4.4. check, typecheck and build are clean. One new test per package; both fail on 1.2.3. No test fails. Windows 11: bettergrep 233 pass and 86 skip, betterglob 143 and 56. Linux x64 with Node 24: bettergrep 317 and 2, betterglob 198 and 1.

PR: #24

v1.2.3

Choose a tag to compare

@dhaern dhaern released this 07 Nov 01:42
459dad3

1.2.3

opencode-bettergrep

  • On Windows, the ripgrep auto-install now extracts the archive with %SystemRoot%\System32\tar.exe. It used to run whatever tar came first on PATH. When OpenCode was started from Git Bash or MSYS2, that was Git's GNU tar, which fails on drive letters, so the install failed and searches fell back to GNU grep. Related to #21.
  • The GNU grep fallback recognizes the Binary file X matches notice that GNU grep before 3.5 prints on stdout. It is no longer lost: the result is marked as truncated and carries the same warning as when the notice comes on stderr.
  • On Windows, paths from the GNU grep fallback no longer mix separators (C:\repo\src/a.ts).

opencode-betterglob

  • Same tar.exe fix for the ripgrep auto-install on Windows. Without it betterglob could not install rg at all in that setup.
  • The README now says that under Bun on Linux and macOS node must be on PATH in every session. It used to say a validated rg on PATH could search without it, which was not true.

opencode-betterread

No code changes. The version moves to 1.2.3 so the three packages stay on the same release.

Tests

The suite now passes on Windows as well as Linux. The tests no longer assume GNU grep on PATH, POSIX shebang fakes, / in paths or a particular readdir order, and on Windows they no longer write to the real ripgrep cache under LOCALAPPDATA. CONTRIBUTING.md lists what they need.

Verification: Bun 1.4.4. check, typecheck and build are clean on Windows 11 and Linux x64. No test fails. Windows 11 without GNU grep: grep 232 pass and 86 skip, glob 142 and 56, read 171 and 10. Linux x64 with Node 24: grep 316 and 2, glob 197 and 1, read 181 and 0. Each of the three code fixes has a test that fails on 1.2.2.

PR: #23

v1.2.2

Choose a tag to compare

@dhaern dhaern released this 06 Nov 23:46
8419806

1.2.2

All three packages

  • On Windows, the child processes the plugins start (rg and grep for searches, version probes, pdfinfo) no longer open a console window. When OpenCode ran the tools from a process with no console, such as opencode serve, every grep and glob call flashed a terminal window for a fraction of a second. All spawn and spawnSync calls now pass windowsHide: true, which other platforms ignore.

No other behavior changes.

Verification: check, typecheck and build are clean on Windows 11 (Bun 1.4.3) and Linux (Bun 1.4.4). The test results match 1.2.1 test by test on both systems. A detached process with no console opened a Windows Terminal window for each rg call without windowsHide and none with it.

PR: #22

v1.2.1

Choose a tag to compare

@dhaern dhaern released this 30 Oct 23:35

1.2.1

opencode-bettergrep

  • context, before_context and after_context now accept any value and clamp it to 50 lines. The old cap was 20. OpenCode 2 rejected larger values with Too big: expected number to be <=20, which made the model retry, and OpenCode 1 cut them to 20 without saying so. The field descriptions now state the cap.
  • Results with many matches and wide context no longer risk a RangeError while the output is formatted.

opencode-betterglob and opencode-betterread

No code changes. The version moves to 1.2.1 so the three packages stay on the same release.

Verification: check, typecheck and build are clean, and 693 tests pass on Bun 1.4.4 (197 glob, 315 grep, 181 read).

PR: #20

Better OpenCode Tools 1.2.0

Choose a tag to compare

@dhaern dhaern released this 30 Oct 03:42

1.2.0

The three packages now load in OpenCode 2.x as well as 1.x, from the same entry. Until now OpenCode 2 rejected them at startup with Plugin must export a default definition with an id and an effect or setup function.

OpenCode v2 support

  • The default export is { id, server, setup }. OpenCode 1.x (tested on 1.19.5) calls server as before; OpenCode 2.x (tested on 2.2.2) calls setup, which replaces the built-in grep, glob or read with the plugin tool. Your config entries do not change.

  • In v2 the tools keep their v1 features: context lines, several paths and globs, sorting by modification time, the 500-result default, paging, images and PDFs.

  • In v2, read takes path instead of filePath, like the built-in tool. v2 does not pass its config to plugins, so the read budget comes from the plugin options:

    ["opencode-betterread", { "tool_output": { "max_lines": 4000, "max_bytes": 153600 } }]

    Without them it uses the v2 default of 2000 lines and 50 KiB. OpenCode 1.x accepts the same entry and keeps reading the top-level tool_output block.

  • Permissions in v2 use the same patterns as the built-in tools. "Always allow" for an external directory is saved at the enclosing Git or Mercurial project root, and for read it covers every file (*). For a symlink, read also asks for the resolved target, so rules such as *.env still apply.

  • Not available in v2: read does not load AGENTS.md files from subdirectories, which the built-in v2 read does through an internal host service. The v1 progress title is not shown; the TUI still shows the match and file counts.

Packaging

  • OpenCode 1.x behavior does not change. @opencode-ai/plugin moves from 1.18.32 to 1.19.5.
  • Each package adds a ./server export pointing at the same dist/index.js. @opencode/plugin is used for types only: it is a devDependency and an optional peer (^2.2.2), and the compiled code does not import it.
  • Bun 1.4.4, Biome 2.6.4 and TypeScript 7.0.2 for development. Biome now formats the README files.

Verification: check, typecheck and build are clean, and 690 tests pass on Bun 1.4.4 (197 glob, 312 grep, 181 read). The glob host tests need BETTERGLOB_TEST_RG to point at a ripgrep binary. With the real binaries, OpenCode 2.2.2 loaded the three packages and ran glob, grep with context and read with offset/limit through them, and OpenCode 1.19.5 ran the same tools from the 1.2.0 build. Against the v1 entry, the v2 adapter adds no consistent cost: the differences measured from -3 to +5.5 ms over 20 cases.

Better OpenCode Tools 1.1.0

Choose a tag to compare

@dhaern dhaern released this 29 Sep 14:59

1.1.0

Fixes for opencode-bettergrep and opencode-betterglob. opencode-betterread has no source changes: its compiled dist is the same as in 1.0.1, and its version moves to 1.1.0 so the three packages stay in step.

opencode-bettergrep

  • On Bun 1.4 the plugin could fail with TypeError: Invalid state: Controller is already closed while reading ripgrep output. It now reads the pipes without Readable.toWeb. In a benchmark run under Bun 1.4.2, 1.0.1 exited with that error and 1.1.0 did not. OpenCode 1.18.33 ships Bun 1.3.14, which was not affected, so this matters for newer Bun builds and for other hosts.
  • An include or globs entry that matches every path (*, **, **/*) no longer overrides .gitignore. Before, it made ripgrep search ignored directories such as node_modules. With include: "*" on the OpenCode repository, a search took 580 ms in 1.0.1 and takes 36 ms now.
  • .git directories are skipped even when hidden is on, unless a search path is inside one. path: ".git" still searches it, as in the built-in grep.

opencode-betterglob

  • glob starts ripgrep directly instead of through the Node supervisor, so a call no longer waits on the 250 ms kill timer. With default arguments on a repository of about 6,600 files, **/*.ts went from 322 ms to 33 ms and **/* from 1,172 ms to 49 ms. With limit: 100 and sort_by: "none" it takes about the same time as the built-in tool.
  • A match-all pattern (*, **, **/*) no longer overrides .gitignore. In an OpenCode checkout, 464 of the first 500 results for **/* were under node_modules before, and none are now.
  • On POSIX, ripgrep runs in its own process group, and a timeout or cancellation signals the whole group. A wrapper script that does not exec ripgrep no longer leaves it running after the wrapper is killed. On Windows only the launched process is stopped, as in 1.0.1.

Documentation

The root README no longer compares code size with 0.3.1. It now has a benchmark of read, grep and glob against the built-in tools, with the method, and each package README carries its own table.

Verification: check, typecheck and build are clean, and 670 tests pass on Bun 1.4.2 and Bun 1.3.14 (306 grep, 190 glob, 174 read). The glob host tests need BETTERGLOB_TEST_RG to point at a ripgrep binary.

Better OpenCode Tools 1.0.1

Choose a tag to compare

@dhaern dhaern released this 28 Sep 22:30

1.0.1

Manifest and documentation release. No source changes: the compiled dist of all three plugins is the same code as 1.0.0.

  • opencode-betterglob and opencode-bettergrep now declare engines.node as ^22.22.2 || ^24.15.0 || >=26.0.0, matching their which@7 dependency. In 1.0.0, betterglob still declared >=22.9.0 and bettergrep declared no range at all.
  • The READMEs of the monorepo and of the three packages were rewritten. Per-release changelogs were removed from the README in favor of this page. The root README no longer claims that read cannot return image and PDF attachments; it does return them as embedded data: base64.
  • Versions of all three packages and the workspace root move to 1.0.1 so the new READMEs appear on npm.

Verification: check, typecheck and build clean, and 663 tests passing (187 glob, 302 grep, 174 read) on Bun 1.4.2.

Better OpenCode Tools 1.0.0

Choose a tag to compare

@dhaern dhaern released this 28 Sep 20:29

1.0.0

First stable release. All three plugins move from 0.3.1 to 1.0.0 together. Every plugin was refactored for less code and deterministic behavior, with no features removed. Greptile scored 5/5 on all three pull requests (#13, #14, #15).

opencode-bettergrep

Production code went from 8,270 to about 7,320 lines (39 to 32 files). Search results with equal timestamps now sort by raw path bytes, so output no longer depends on worker finish order or locale. The GNU fallback sets LC_ALL=C.UTF-8 and clears LANGUAGE, keeping version parsing in English on systems with translated locales. The fallback memo records the rejected ripgrep candidate and expires after the 10 minute negative-cache TTL, so a transient ripgrep failure recovers on its own instead of pinning GNU grep forever. The CLI probe now races process exit against termination, so a timed-out probe resolves even when a child process holds stdio open. Suite: 302 tests, 79 snapshots.

opencode-betterread

Production code went from 2,902 to 2,121 lines (24 to 15 files). Reads now follow the host tool_output budget (2000 lines, 51200 bytes) and print a continuation footer with the next offset instead of letting the host cut output silently, which saves wasted re-reads. The effect module loads lazily, cutting cold start from about 260 ms to about 70 ms. Directory entries sort by UTF-16 code units, a fixed order that does not depend on ICU or runtime locale. Suite: 174 tests, 21 snapshots.

opencode-betterglob

Production code went from 4,746 to 3,892 lines (28 to 26 files). Search processes now share one lifecycle: a truncated search stops in about 0.3 s instead of waiting out the 5 s generic kill grace. which and proper-lockfile load lazily, so importing the plugin no longer patches host globals or spawns resolution work. Stale .install-* staging directories older than 24 h are swept under lock. Suite: 187 tests.

Dependencies

All three plugins now build against @opencode-ai/plugin 1.18.32, effect 4.0.0-beta.83 (exact, single copy), TypeScript 7.0.2, @biomejs/biome 2.5.14, @types/node 24, bun-types 1.4.2, which 7, with packageManager set to [email protected].

Verification

Full gate green on Bun 1.4.2: check, typecheck, and 663 tests (302 grep, 174 read, 187 glob) with zero failures. Mutant checks and bundle size checks passed per package during review.

Compatibility

Verified on OpenCode v1 (plugin API 1.18.x): full gate green on Bun 1.4.2. The entry points use the v1 module shape ({ id, server }); loading under a v2 host has not been exercised, no v2 host available here.

Better OpenCode Tools v0.3.1

Choose a tag to compare

@dhaern dhaern released this 09 Sep 22:33
  • bettergrep/betterglob: rg now runs with --no-mmap, so a search no longer aborts when a file is truncated while another process edits it. On many-small-files trees this is also cheaper than mmap; large single-file searches may be slightly slower.
  • Packages bumped to 0.3.1.

Better OpenCode Tools v0.3.0

Choose a tag to compare

@dhaern dhaern released this 08 Sep 05:52

v0.3.0

  • Security audit fixes across all three plugins (multi-round review): hardened process lifecycle and cleanup confirmation, atomic ripgrep cache publication under inter-process locks (proper-lockfile), fail-closed symlink traversal, strict ERE translation allowlist, byte-exact non-UTF-8 path sorting, deterministic top-K admission with context preservation, and preserved partial results with authoritative metadata.
  • betterglob: follow_symlinks:true explicitly rejected (unsafe traversal races); supervised POSIX process groups with watchdog and confirmed cleanup; abort-gated extraction timeouts.
  • bettergrep: GNU grep fallback hardened under LC_ALL=C.UTF-8; LF rejection in literal search; binary-match truncation; walker fail-closed on non-UTF-8 symlink targets.
  • betterread: descriptor-safe reads with single-handle ownership and streaming-abort race fixes.
  • Codebase modularized per phase 3 review: oversized modules split into focused units (fallback x6, downloader x4 in both grep/glob, tool/runner splits, attachments) with identical public surface.
  • All packages aligned to OpenCode 1.18.29.

Validation:

  • bun test: betterread 106 pass / bettergrep 145 pass / betterglob 158 pass + 9 skip, 0 fail
  • biome check, typecheck, build green on all three packages
  • oracle review of refactor diff: APTO (459 function bodies verified byte-identical)