0
603
近 7 天 603
37.1
生态多维模型
3 天前
2026-10-17
快速安装与配置
opencode.json写入当前项目的 opencode.json,只对这个仓库生效。
opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["opencode-docview@0.1.1"]
}写入 ~/.config/opencode/opencode.json,对所有项目生效。
~/.config/opencode/opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["opencode-docview@0.1.1"]
}若你要在本地改造这个插件,先装到项目里再从本地路径引用。
shell
pnpm add -D opencode-docviewOpenCode 启动时会通过内嵌运行时自动加载 npm 依赖并缓存至本地目录,无需手动在全局环境执行安装。
Markdown doc viewer side panel for the OpenCode TUI, with line numbers and GitHub-style range copying.
Requires OpenCode 2.x.
Install
Add it to ~/.config/opencode/cli.json and restart the TUI:
{ "plugins": ["opencode-docview"] }
Use
/doc path/to/file.mdor/doc @fileopens a doc;/docalone opens a picker.- Click or drag the line numbers to copy a range like
#L3-L8. Shift-click extends it. - Frontmatter is dimmed and unnumbered, so L1 is the first line after it.
- The panel reloads when the file changes.
| Key | Action |
|---|---|
j / k, g / G |
Scroll, top / bottom |
s |
Rendered / source view |
y / esc |
Copy / clear selection |
o / r |
Open another doc / reload |
f / q |
Fullscreen / close |
<leader> left and <leader> right move focus between the prompt and the panel.
Develop
npm install
npm run typecheck
npm test # unit tests (vitest)
npm run test:render # gutter layout against OpenTUI (bun)
npm run build
bun test/e2e/smoke.ts # real OpenCode TUI, needs opencode on PATH and a build
License
Apache-2.0
同类生态推荐
Review
@opencode-cockpit/review
A pull request in the terminal: read the diff, hold your notes, send one review
Trail
@opencode-cockpit/trail
What a conversation made: the PRs, tickets and pages the agent created or changed, kept, ordered and one click away
Dir Tree Tui
opencode-dir-tree-tui
OpenCode V2 TUI plugin: VS Code-style file tree in the sidebar with git status coloring and click-to-open