Skip to main content

opencode-dashboard-server

FastAPI aggregation backend for the opencode-dashboard project. Reads opencode's local SQLite storage via the opencode db CLI and exposes a JSON + SSE API for the dashboard front end.

Install

pip install opencode-dashboard-server

Requires Python ≥ 3.10 and the opencode CLI on the same host (the server shells out to opencode db "<SQL>" — it never opens the SQLite file directly, which is WAL-mode and actively written while opencode runs).

Usage

On each host that runs opencode:

uvicorn app:app --port 8791

Run on more hosts with different ports (8792, 8793, …) and point the front end at each.

API

  • GET /health — liveness
  • GET /overview — whole-host aggregate (tokens by type + cost, session counts, updatedAt)
  • GET /projects — per-project rollups
  • GET /projects/{id} — one project's sessions (parent/child tree)
  • GET /sessions/{id} — per-model breakdown for one session (handles mid-conversation model switches)
  • GET /stream — SSE: updated events when the DB changes (polled ~5s)

JSON is camelCase, timestamps are epoch-ms. Full contract in the repo's API.md.

Development

uv sync          # install deps (fastapi, uvicorn) + dev (pytest, httpx)
uv run pytest    # run tests
uvx ruff check . # lint

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

opencode_dashboard_server-0.1.1.tar.gz (8.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

opencode_dashboard_server-0.1.1-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

Details for the file opencode_dashboard_server-0.1.1.tar.gz.

File metadata

File hashes

Hashes for opencode_dashboard_server-0.1.1.tar.gz
Algorithm Hash digest
SHA256 0475c0ec9fb8a607ceee00fd2ec70d651163cfabbe3052ba5ce5bbcbe4e1abb7
MD5 5e1e24ea7783d5deca2cee2662df438e
BLAKE2b-256 a76f64a284cbf0ac7909bee977825f716f11c2ae73865a59600512ad1fca6c76

See more details on using hashes here.

File details

Details for the file opencode_dashboard_server-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for opencode_dashboard_server-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d6c7e299dd44543655e0ac279c1f9a98ece65b15af0df116c809046b699a1ba0
MD5 d04ca36c76671533a2d8db183e3a1c50
BLAKE2b-256 a1204ab9ab16a603f241a621cba69971fe1ceb7f48e37be63fc5747fc9927c68

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page