A plugin that embeds the OpenCode CLI directly into Obsidian. Browse conversation history and resume work without leaving your vault.
@path/to/file.md#1 mentions for OpenCode.PATH for the isolated PTY helper.main.js, manifest.json, and styles.css from the latest releaseopencode in your vault's .obsidian/plugins/ directoryCtrl/Cmd + P) and select "OpenCode: Open Terminal" to launch the CLI.opencode executable, default CLI arguments, per-vault environment variables, and terminal styling preferences (font size/family) in the Obsidian settings under the "OpenCode" tab. Environment values are passed literally. Do not rely on a command name from your shell PATH, because desktop-launched Obsidian may not inherit your shell environment.To develop the plugin, you can run the development script which automatically rebuilds the plugin when files change:
npm run dev
Unit tests run with npm test. To create a fresh isolated vault and test the built plugin inside a sandboxed Obsidian instance, run:
npm run test:obsidian
Use npm run test:obsidian:smoke for the smaller baseline suite. Windows contributors can also run npm run test:obsidian:windows-ui to exercise the installed OpenCode CLI and native terminal interactions.
See Testing in Obsidian for setup, coverage, evidence, and limitations.
large session preview: While the buffer size for exporting sessions has been increased (up to 100MB), exceptionally large or deeply complex OpenCode sessions with massive token counts may still occasionally fail to preview or load properly.
not tested on all Linux distros: While the plugin should work on major distros, it's only tested on manjaro, ubuntu, and fedora.
Experimental Windows pty: It's usable but far from linux and macos experience.
shortcuts conflicts:: Default opencode shortcuts like Ctrl+P could conflict with obsidian shortcuts. A solution for now is to always use leader key for opencode shortcuts.
pty.fork() and 4-pipe stdio for resize control (FD 3).MIT License