Skip to main content

opencode-db

Python License

CLI for OpenCode's local database. OpenCode saves every agent session, conversation, token usage, and cost in a local SQLite file. This tool lets you inspect, export, analyze, and clean up that data.

pip install opencode-db

Quick start

opencode-db list         # recent sessions
opencode-db view         # interactive session viewer (colored, scrollable)
opencode-db stats        # database summary
opencode-db costs --total  # total token costs
opencode-db export       # export dialog to .md (interactive)
opencode-db help         # full reference

Features

  • view — просмотр сессии в терминале с ANSI-цветами, Markdown-рендерингом и прокруткой через less
  • list / info / search / tree — навигация и поиск по сессиям
  • export — экспорт диалога в Markdown (с поддержкой Obsidian)
  • delete / prune — удаление и массовая очистка с фильтрами
  • costs / stats — аналитика токенов и расходов
  • --db-path / OPENCODE_DB — кастомный путь к БД

Optional extras

pip install opencode-db[rich]   # enhanced Markdown rendering (recommended)
pip install opencode-db         # zero external dependencies

Requirements

  • Python 3.12+
  • OpenCode (must have been run at least once)
  • macOS / Linux

Metadata

Release files for opencode-db 0.7.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for opencode-db 0.7.0
File Size Uploaded
opencode_db-0.7.0.tar.gz 52.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for opencode-db 0.7.0
File Interpreter ABI Platform
opencode_db-0.7.0-py3-none-any.whl Python 3 none any Details

Total release size: 102.0 kB

Release files / opencode_db-0.7.0.tar.gz

Download URL opencode_db-0.7.0.tar.gz
Size 52.6 kB
Tags Source
SHA-256 checksum
How to use checksums
947d24f09a31ab50712c27e0d1bbdae8cb8d4d44625b5ab575d7f895021134b9
BLAKE2b-256 checksum
How to use checksums
a9c86ad47a7826d3fca889393562b5ef7f56324b624ea5aca8c769775c605450
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 25, 2026.

Transparency log

Release files / opencode_db-0.7.0-py3-none-any.whl

Download URL opencode_db-0.7.0-py3-none-any.whl
Size 49.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c5e5401c66978d6d96c5f9376b6d6564a7487cf24eb413ee9688894235ea9da3
BLAKE2b-256 checksum
How to use checksums
ddccece761a6946428e20ef16275f12f64663ce13b8468c3b4e5781574a5a5ec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 25, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.7.0 This release

2 release files

0.6.2

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.9

2 release files

0.4.8

2 release files

0.4.7

2 release files

0.4.6

2 release files

0.4.4

2 release files

0.3.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page