opencode-reader
v0.1.1
Published
Read local Markdown and text documents inside the OpenCode TUI.
Readme
opencode-reader
opencode-reader adds a document reader to the OpenCode TUI. It recursively discovers local Markdown and text files, provides a searchable library, and opens documents in a scrollable pane at the bottom of the TUI.
Install
Requires OpenCode >=1.18.25 <2.
opencode plugin --global opencode-readerThis installs the npm package and adds its ./tui entrypoint to your global tui.json.
Configure
Add the package to OpenCode's tui.json (globally at ~/.config/opencode/tui.json or in a project's .opencode/tui.json):
{
"$schema": "https://opencode.ai/tui.json",
"plugin": [["opencode-reader", { "bookshelf": "~/read" }]]
}bookshelf defaults to ~/read. Only .md and .txt files are listed. Hidden entries and symbolic links are skipped. Documents larger than 5 MB are rejected.
OpenCode resolves the package's ./tui export automatically.
Usage
Press Ctrl+Shift+R in an OpenCode session to open the library or toggle the active document. The command palette also exposes Toggle reader and Open library. /read, /library, and /books open the library.
Keyboard controls
| Key | Action |
| ----------------------- | -------------------- |
| Ctrl+Shift+R | Toggle reader |
| Up / Down | Scroll one line |
| Page Up / Page Down | Scroll one page |
| Home / End | Jump to start or end |
| L | Open library |
| Q / Escape | Close reader |
The last document and scroll position are restored through OpenCode's plugin key-value store.
Development
Install dependencies and run all checks:
bun install
bun run checkIndividual commands:
bun run format:check
bun test
bun run typecheck
bun run buildBuild output is written to dist/. OpenCode and OpenTUI host packages remain external and are not bundled.
