{"id":50745538,"url":"https://github.com/foae/opencode-timings","last_synced_at":"2026-06-10T20:30:37.473Z","repository":{"id":362054609,"uuid":"1257019465","full_name":"foae/opencode-timings","owner":"foae","description":"OpenCode TUI sidebar panel showing per-session timing: total API/inference time, wall-clock, turns, average and slowest turn","archived":false,"fork":false,"pushed_at":"2026-06-02T11:39:36.000Z","size":15,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-02T12:23:31.410Z","etag":null,"topics":["opencode","opencode-ai","opencode-plugin","opencode-plugins"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@foae/opencode-timings","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/foae.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-02T09:39:22.000Z","updated_at":"2026-06-02T11:44:02.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/foae/opencode-timings","commit_stats":null,"previous_names":["foae/opencode-timings"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/foae/opencode-timings","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foae%2Fopencode-timings","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foae%2Fopencode-timings/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foae%2Fopencode-timings/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foae%2Fopencode-timings/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/foae","download_url":"https://codeload.github.com/foae/opencode-timings/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foae%2Fopencode-timings/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34170162,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-10T02:00:07.152Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["opencode","opencode-ai","opencode-plugin","opencode-plugins"],"created_at":"2026-06-10T20:30:35.876Z","updated_at":"2026-06-10T20:30:37.461Z","avatar_url":"https://github.com/foae.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# opencode-timings\n\nA tiny [OpenCode](https://opencode.ai) **TUI sidebar** plugin that shows\nper-session timing — how much wall-clock the session has taken and how much of\nthat was actually spent waiting on the model.\n\nIt renders into the same right-hand sidebar as the Quota / MCP / LSP / Todo /\nFiles panels, reading the session's messages directly from the TUI's reactive\nstate. Nothing is ever injected into the message stream, so there is **zero\ncontext-window pollution**.\n\n![The Timing panel in OpenCode's sidebar — api/wall 34%, api 19s · wall 56s, turns 5 · avg 4s, slowest 6s — sitting between the built-in Quota and LSP sections](https://raw.githubusercontent.com/foae/opencode-timings/main/opencode-timings-screenshot.png)\n\n```\nTiming\napi/wall ██████░░ 78%\napi 31s · wall 40s\nturns 4 · avg 8s\nslowest 19s\nper-turn ▄█▂▂\n```\n\nEvery row names itself, so there are no unlabeled numbers or glyphs to decode.\n\n## Metrics\n\n| Row        | Meaning |\n|------------|---------|\n| `api/wall` | How much of wall-clock was actual model inference, as a bar gauge and percent. |\n| `api`      | Total assistant inference time — the sum of `time.completed − time.created` over every completed assistant message. |\n| `wall`     | Span from the first to the last message timestamp. Includes the time you spend reading/typing between turns, so `api` is always a fraction of it. |\n| `turns`    | Number of completed assistant messages, plus the average per-turn duration. |\n| `slowest`  | The single slowest assistant message. |\n| `per-turn` | Sparkline of each recent turn's duration. |\n\nThe panel is always shown; before the first turn its values read zero.\n\n## Install\n\nAdd it to the `plugin` array of the **TUI** config that OpenCode loads\n(`~/.config/opencode/tui.json` or `tui.jsonc`) — this is a TUI plugin, so it\nbelongs in `tui.json`, not `opencode.json`:\n\n```jsonc\n{\n  \"$schema\": \"https://opencode.ai/tui.json\",\n  \"plugin\": [\"@foae/opencode-timings@latest\"]\n}\n```\n\nOpenCode installs the plugin and its dependencies with Bun at startup. Restart\nOpenCode and open the session sidebar to see the `Timing` panel.\n\nYou can also pin a version, e.g. `@foae/opencode-timings@0.1.2`.\n\n## Configuration\n\nPass options using the tuple form (`[spec, options]`) in `tui.json`:\n\n```jsonc\n{\n  \"$schema\": \"https://opencode.ai/tui.json\",\n  \"plugin\": [\n    [\"@foae/opencode-timings@latest\", {\n      \"mode\": \"fancy\",\n      \"fields\": { \"ratio\": true, \"api\": true, \"wall\": true, \"turns\": true, \"avg\": true, \"slow\": true, \"sparkline\": true }\n    }]\n  ]\n}\n```\n\n| Option   | Values | Default | Meaning |\n|----------|--------|---------|---------|\n| `mode`   | `\"fancy\"` \\| `\"simple\"` | `\"fancy\"` | `fancy` draws the gauge bar on the `api/wall` row and adds the per-turn sparkline; `simple` is the same rows without the bar or sparkline. |\n| `fields` | object of booleans | all `true` | Each toggles exactly one value: `ratio` (the `api/wall` gauge + percent), `api`, `wall`, `turns`, `avg`, `slow`, `sparkline` (`sparkline` is fancy-only). Values that share a line drop out individually. |\n\nWith no options (a plain `\"@foae/opencode-timings@latest\"` string), it defaults to `fancy` mode with all fields shown.\n\n## Requirements\n\n- OpenCode `1.15.x` or newer (uses the TUI slot plugin API).\n\n## Development\n\nBuilt and run with [Bun](https://bun.sh). The package ships raw source — there is no build step; OpenCode loads `src/tui.tsx` directly.\n\n- `src/timing.ts` — pure timing math, formatting, and config parsing (no JSX), unit-tested.\n- `src/tui.tsx` — the SolidJS sidebar component and the slot registration.\n\n```sh\nbun install\nbun run typecheck   # tsc --noEmit\nbun test            # unit tests for the pure logic in src/timing.ts\n```\n\n`opentui`, `solid-js`, and the OpenCode plugin/SDK are **peer dependencies** — at runtime they come from the OpenCode host so the plugin shares its renderer; the `devDependencies` mirror them for local typecheck and tests.\n\n## License\n\nMIT — see [LICENSE](./LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffoae%2Fopencode-timings","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffoae%2Fopencode-timings","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffoae%2Fopencode-timings/lists"}