Skip to content

About

A single, self-contained, CDN-based web tool for browsing an [opencode](https://opencode.ai) database — sessions, chat messages, tool calls, and statistics.

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

6 Commits

Folders and files

Repository files navigation

Opencode DB Viewer

A single, self-contained, CDN-based web tool for browsing an opencode database — sessions, chat messages, tool calls, and statistics.

No build step. No local dependencies. Data is read locally in your browser and never uploaded.

Features

  • 🗄️ Session list — browse all sessions with title, date, cost, tokens, model, and working directory
  • 🔍 Search — filter sessions by title, or by message content (with in-chat highlight); Ctrl+F searches rendered chat text via the browser
  • 💬 Chat view — user/assistant messages rendered as markdown (incl. mermaid flowcharts), expandable tool calls, collapsible reasoning
  • ⌨️ Timeline — per-session message-flow visualization (user / assistant / tool / error)
  • 📊 Statistics — totals for sessions, messages, cost, tokens, plus breakdowns by project, agent, model, and activity
  • 📥 Export markdown — export the current session (Ctrl+E) or download all sessions

Usage

  1. Open opencode-db-viewer.html in any modern browser (double-click works; file:// protocol).

    Initial view
  2. Click Load Database and pick an opencode.db file.

    • macOS: ~/Library/Application Support/opencode/opencode.db
    • Linux: ~/.local/share/opencode/opencode.db (or $XDG_DATA_HOME/opencode/opencode.db)
    • Windows: %USERPROFILE%\.local\share\opencode\opencode.db (e.g. C:\Users\<name>\.local\share\opencode\opencode.db)
    After loading a database
  3. Select a session in the sidebar to view its chat.

sql.js, markdown-it, DOMPurify, and mermaid are loaded from a CDN, so an internet connection is needed on first use.

Privacy

All processing happens locally in your browser via sql.js (SQLite compiled to WebAssembly). The database file is only read in memory — nothing is uploaded or sent to any server.

Requirements

  • A modern browser (Chrome 80+, Firefox 74+, Edge 80+, Safari 13.1+) — the app uses ES2020 features
  • Internet access for the sql.js CDN

How the DB is read (schema notes)

  • Timestamps are stored in milliseconds.
  • A message's visible content is assembled from its part rows (part.data), not the message row itself.
  • Tool-call input/output live inside each tool part's state field.

License

MIT

About

A single, self-contained, CDN-based web tool for browsing an [opencode](https://opencode.ai) database — sessions, chat messages, tool calls, and statistics.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages