Skip to content

[FEATURE]: Interactive /visualize command with multi-target diagramming #48585

Closed as not planned

Description

@prethiv

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

Problem

When discussing complex distributed systems, execution lifecycles, or relational schemas, agents either dump 150+ lines of raw Mermaid/ASCII into the terminal or produce dense walls of text that are hard to visualize.

Proposal

Add an intent-aware /visualize command (opencode visualize) with an interactive confirmation step before rendering:

  1. Confirmation Loop: Prompts the user with @clack/prompts to pick the target output (browser, terminal, ascii, file, or skip).
  2. First-Class Targets: Supports context (System Context algebra & Session Runtime pipeline), architecture (monorepo layer topology), flow <module> (sequence diagrams), schema <path> (database ERD), deps (package graph), and state (Session drain lifecycle).
  3. CLI HTML Artifact: Whenever run in CLI, generates an interactive dark-mode HTML canvas (.opencode/artifacts/visualize-*.html) with Mermaid.js, pan/zoom controls, and SVG download, presenting the clickable link to the user.

Activity

  1. github-actions commented on Sep 12, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    If your request overlaps with any of these, please consider commenting there instead of opening a new issue.

  2. teodor-georgiev commented on Oct 21, 2026

    @teodor-georgiev

    Related, but a different piece of the problem — filing for the plugin/chat-timeline case so it does not get lost here.

    This issue is about a CLI /visualize command that writes an HTML file and gives a clickable link. My gap is narrower and lower-level: when a plugin tool returns an HTML artifact, the Desktop chat has no way to render it inline.

    For reference, in 2.1.2 the chat renders assistant markdown through DOMPurify whose html profile includes neither iframe nor script, and tool-result file parts are not rendered in the message at all — the bubble renders only text, reasoning and tool parts. The only live HTML rendering is the Files-panel artifact viewer (blob-URL iframe, sandbox="allow-scripts ...").

    Filed as #57818.

  3. neriousy commented on Oct 21, 2026

    @neriousy
    Member

    Thanks for the suggestion. You can set this up yourself as a custom command (https://opencode.ai/v2/docs/commands), a custom agent (https://opencode.ai/v2/docs/agents) or a skill (https://opencode.ai/v2/docs/skills), and share it with others that way. We're not planning to build this specific workflow into opencode. Native Mermaid rendering in the TUI is tracked separately in #40508. Closing as not planned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions