跳到主要内容
    ↑↓ 选择↵ 打开esc 关闭
    dreamorosi

    Docview

    opencode-docview·v0.1.1·Git 与版本控制

    Markdown doc viewer side panel for the OpenCode TUI, with line numbers and GitHub-style range copying

    GitHub 星标

    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"]
    }

    OpenCode 启动时会通过内嵌运行时自动加载 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.md or /doc @file opens a doc; /doc alone 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

    同类生态推荐