Plugin + skill for OpenCode: full-text search over files indexed by
AnyTXT Searcher — PDF, DOCX, PPTX, XLSX, EPUB, RTF and
other formats grep/ripgrep cannot read.
Uses the local JSON-RPC 2.0 API inside the ATGUI process
(http://127.0.0.1:9920)
Plugin (src/main.ts, TypeScript — loaded via the
.opencode/plugins/anytxt.ts shim) — three agent-callable tools:
| Tool | RPC method | Purpose |
|---|---|---|
anytxt_search |
Searcher.V1.GetResult |
Files matching a pattern, verified against raw text, with per-file occurrence counts |
anytxt_fragment |
Searcher.V1.GetFragmentAll |
Snippets around matches in one file, by FID |
anytxt_sync |
Searcher.V1.SyncIndex |
Add/refresh a folder in the index, with post-sync feedback |
Skill (skills/anytxt/SKILL.md) — tells the agent when to prefer anytxt
over ripgrep (binary documents), the query syntax, and the golden rule.
Command (/anytxt-param) — change settings at runtime, no restart.
bunx [email protected] installOne command: copies the sources, generates the shim, installs skill and
command into ~/.config/opencode/. Idempotent, never clobbers your .env.
Then restart OpenCode.
Project-local install (scoped to one project, global config untouched):
cd your-project
bunx [email protected] install .opencodeAlternative: "plugin": ["anytxt-opencode"] in opencode.json (auto-install
at startup). Full details, manual install and prerequisites:
docs/user.md.
Uninstall: bunx [email protected] remove (project: bunx [email protected] remove .opencode) — deletes what install created, keeps .env.
Update: bunx [email protected] update — idempotent re-copy after a new release.
Search my notes for "hello world" → anytxt_search
Give me the context around that match → anytxt_fragment
Index a new folder first → anytxt_sync
Query syntax: & AND, | OR, ! NOT, ( ) grouping, "..." exact
phrase. verify (default on) drops index false positives and reports
occurrences per file. Golden rule: anytxt for binaries, grep for text —
versions, punctuation phrases and source code → grep.
- User guide — install, configuration, security, limitations, troubleshooting
- Developer guide — structure, testing, RPC reference, release process
- Changelog — Keep a Changelog format