GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - fede-ciliberti/opencode-brief: OpenCode TUI plugin: /brief opens an executive summary of the current session in a dialog, without touching the transcript

BranchesTags
Open more actions menu

Latest commit

 

History

12 Commits
12 Commits

Folders and files

NameName
Last commit message
Last commit date
test
test
 
 
.gitignore
.gitignore
 
 
CHANGELOG.md
CHANGELOG.md
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
package-lock.json
package-lock.json
 
 
package.json
package.json
 
 
reasoning.ts
reasoning.ts
 
 
title.ts
title.ts
 
 
tsconfig.build.json
tsconfig.build.json
 
 
tsconfig.json
tsconfig.json
 
 
tui.tsx
tui.tsx
 
 

Repository files navigation

opencode-brief

OpenCode TUI plugin: /brief opens an executive summary of the current session in a dialog.

Uses the same window as the built-in /btw: one model call that reads the session context and returns transient text, rendered in a dismissable dialog — so the brief never lands in the transcript. The same call also proposes a title for the session, which you can apply to the session with one key.

Install

opencode plugin add opencode-brief

That installs the package and registers it in the global configuration. Restart the TUI. Rollback is opencode plugin remove opencode-brief.

A local checkout works the same way: point the package field in ~/.config/opencode/cli.json at the directory instead of the registry name.

Use

/brief              # brief of the current session
/brief deploy       # same brief, focused on one aspect
  • c copies the brief, t applies the proposed session title, j/k, arrows, page keys and home/end scroll, esc closes.
  • While the brief is being generated, /brief shows up in the prompt footer — the same indicator /btw uses.
  • Instructions come from ~/.config/opencode/skills/brief/SKILL.md when that file exists, read at call time, so editing the skill changes both this panel and any /brief chat command. A built-in English fallback is used when it is missing.

Session title

The same generation also proposes a title for the session, because both answers come from the same read of the conversation — a second request would cost a second pass over the same context. The naming rules are the ones OpenCode uses for session_rename, so a title proposed here reads like one generated by the host: three to five words, the specific subject, sentence case, same language as the session.

The title is only a proposal: it shows in the dialog header and is written to the session only when you press t (through client.session.update). Nothing is renamed by opening the dialog, and if the model does not honor the TITLE: … / --- output contract the brief still renders and the title action is not offered.

Thinking / reasoning effort

session.generate takes only { sessionID, prompt }: there is no per-call thinking switch, so by default the brief inherits the session's model and variant. The plugin lowers the effort from the server-side setup of the same entrypoint (the host loads it without a renderer and with the server context) using session.hook("generate") — the hook the host provides for auxiliary requests (SessionRequestKind has a separate generate kind). It writes reasoningEffort / reasoning_effort into the request options and only touches requests carrying the <!-- opencode-brief --> marker, so normal turns and other plugins' transient generations are untouched.

{
  "plugins": [
    {
      "package": "opencode-brief",
      "options": { "thinking": "low" }
    }
  ]
}
  • low is the default; inherit skips the hook entirely.
  • none / minimal are only valid if the model exposes them. Some models only have low, high and max; models built on gpt-oss do have none/minimal.
  • The hook is registered when the server loads the plugin for a location, so a long-running background service keeps the previous load until it restarts. reasoning.init in ~/.local/share/opencode-brief/brief.log tells you the current process has it; generate.hook confirms it was applied to a brief. The host also logs session generation usage diagnostic with reasoningTokens for the same request.

Window mechanics (mirrors /btw)

The dialog is opened the way the host opens /btw, not with plugin-specific plumbing:

  • ui.dialog.show(render, onClose) first, ui.dialog.set({ size: "large", centered: true }) second. Order matters: show replaces the dialog stack and resets size to medium and centering to false, so a set before show is silently discarded.
  • The key layer is registered by the panel component itself with mode: "modal", so it lives exactly as long as the dialog: the host pushes modal while any dialog is open and pops it on close. No custom mode push, and esc/ctrl+c close come from the host layer (which also clears a text selection before closing).
  • Body: markdown on background.raised.high with internalBlockMode="top-level" and tableOptions: grid, inside a scrollbox capped at 60% of the terminal height. The syntax style is built from the theme's markdown and syntax tokens with the same scope table the host generates for /btw, so headings, strong/emphasis, links and inline code are styled instead of flat text.
  • Chrome: theme.surface("dialog") colors, lateral inset 3, header with the title and the focus.

Two host internals /btw uses are not exported to plugins, so the panel rebuilds them with @opentui primitives: the Dialog/DialogHeader/DialogFooter components (header + footer rows are plain boxes here) and the clipboard hook (c falls back to OSC52, so a terminal without OSC52 support reports the failure in a toast instead of copying).

Model

By default the brief is generated by the session's own model, through client.session.generate — it sees the conversation natively, cannot call tools, and does not mutate history.

That endpoint returns an empty string on some sessions (observed on long or busy ones), so the plugin falls back to the stateless client.generate.text with the serialized transcript (read from the server, tail-capped at 40k characters) and the session's current model. Every attempt is logged to ~/.local/share/opencode-brief/brief.log with lengths only, never content; override the path with OPENCODE_BRIEF_LOG.

To pin a different model, set model in the plugin options (provider/model or provider/model#variant). That skips the session path and always uses the stateless one, which costs more input tokens and loses anything that never made it into the transcript:

{
  "plugins": [
    {
      "package": "opencode-brief",
      "options": { "model": "anthropic/claude-sonnet-4-5" }
    }
  ]
}

Why a dialog

A slash command submits its expanded template as a user prompt, so a 50-line command fills the transcript. This plugin keeps the instruction out of the conversation and renders the result in a dismissable panel instead.

Development

npm install
npm run typecheck   # tsc --noEmit
npm test            # bun test (reasoning hook: scoping and effort parsing)

License

MIT — see LICENSE.

About

OpenCode TUI plugin: /brief opens an executive summary of the current session in a dialog, without touching the transcript

Topics

briefopencodeopencode-pluginsession-summarytui

Resources

Readme
MIT license
Activity

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.