opencode-history-fulltext-search
v0.1.0
Published
opencode TUI plugin for full-text search over session history
Maintainers
Readme
opencode-history-fulltext-search

A opencode TUI plugin that adds full-text search over your session history to the command palette. Search across session titles and message content, with two scopes: the current directory, or everywhere.
⚠️ Experimental. This plugin is in the testing phase and reads a large local SQLite database on every search, which may slow down opencode.
Features
- Full-text search across
session.title+ message content. - Two scopes:
Search history — This dir(current directory) orSearch history — Anywhere(all sessions). - Live filtering with the match highlighted and centered in a single-line snippet.
- Noise filtering — indexes only
text/reasoningparts, ignoring tool I/O, step markers, patches and other operational noise. - Cross-dir resume — selecting a session from another directory copies the exact resume command (
cd '<dir>' && opencode --session <id>) to the clipboard instead of switching context.
Install
Add one line to ~/.config/opencode/tui.json:
{
"$schema": "https://opencode.ai/tui.json",
"plugin": ["opencode-history-fulltext-search"]
}Or via the CLI (patches the config for you):
opencode plugin opencode-history-fulltext-searchThen restart opencode — the package and its dependencies are installed automatically.
Not published to npm yet? Install directly from GitHub:
{ "plugin": ["opencode-history-fulltext-search@github:forstjiri/opencode-history-fulltext-search"] }
Usage
- Open the command palette (
Ctrl+P). - Run Search history — This dir or Search history — Anywhere.
- Type to filter;
Enterto open the session (This dir) or copy the resume command (Anywhere);Escto close.
How it works
- Reads
~/.local/share/opencode/opencode.dbread-only (WAL-safe). - Content filter: only
part.data.typeoftextorreasoning, excludingsyntheticrows — drops ~70% of rows that are pure operational noise. - Clipboard tool is auto-detected (
wl-copy→xclip→xsel).
License
MIT — see LICENSE.
