[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-81077":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":8,"htmlUrl":8,"language":9,"languages":8,"totalLinesOfCode":8,"stars":10,"forks":11,"watchers":12,"openIssues":13,"contributorsCount":13,"subscribersCount":13,"size":13,"stars1d":13,"stars7d":14,"stars30d":15,"stars90d":13,"forks30d":13,"starsTrendScore":13,"compositeScore":16,"rankGlobal":8,"rankLanguage":8,"license":17,"archived":18,"fork":18,"defaultBranch":19,"hasWiki":20,"hasPages":18,"topics":21,"createdAt":8,"pushedAt":8,"updatedAt":36,"readmeContent":37,"aiSummary":38,"trendingCount":13,"starSnapshotCount":13,"syncStatus":39,"lastSyncTime":40,"discoverSource":41},81077,"CodexScope","JUk1-GH\u002FCodexScope","JUk1-GH",null,"JavaScript",47,5,43,0,3,4,41.23,"MIT License",false,"main",true,[22,23,24,25,26,27,28,29,30,31,32,33,34,35],"codex","codex-dashboard","cost-estimation","golang","local-first","openai","openai-codex","privacy-first","quota-monitor","static-dashboard","token-usage","typescript","usage-analytics","usage-dashboard","2026-06-12 04:01:31","# CodexScope\n\nEnglish | [简体中文](README.zh-CN.md)\n\n[![LINUX DO](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FLINUX-DO-FFB003?style=flat-square)](https:\u002F\u002Flinux.do)\n\nCodexScope is a local-first dashboard for inspecting Codex usage from local session logs. It turns local Codex metadata into a clean desktop dashboard with token trends, quota and risk status, session rankings, model rankings, request distribution, cache hit rate, and estimated cost.\n\n![CodexScope dashboard](assets\u002Fcodexscope-dashboard-24h.png)\n\nThe dashboard is a static HTML app: no backend, no account connection, and no hosted telemetry. Your real usage export stays local in `data.js` and `data.raw.js`, which are intentionally ignored by git. Recent exports keep precomputed dashboard views in `data.js`; compact catalogs and raw rows are loaded from `data.raw.js` only for custom date ranges.\n\n## Why\n\nCodex usage is easiest to understand when quota, token volume, model mix, and session-level hotspots are visible in one place. CodexScope is built for that narrow job: open a local page, generate a local export, and see where usage went without shipping prompts or project data to another service.\n\n## Features\n\n- Cumulative token trend with absolute and logarithmic views\n- Date filters for last 24 hours, today, last 7 days, last 30 days, all history, and custom ranges\n- Request and token distribution charts for spotting usage peaks\n- Codex quota and risk status from local `rate_limits` events when available\n- Session and model rankings with token totals and request counts\n- Estimated cost by model and token type, shown in USD by default with optional CNY conversion\n- Local-only data generation from `~\u002F.codex\u002Fsessions`\n- Desktop-focused responsive layout with a lightweight static frontend\n\n## Quick Start\n\nDownload the project and open `index.html` directly in a browser. It will show bundled sample data immediately, so you can preview the dashboard without running anything else.\n\nTo view your real local Codex usage, normal users should download the platform package from GitHub Releases:\n\n- **macOS**: download `CodexScope-mac.zip`, unzip it, then double-click `Open CodexScope.command` in the extracted folder\n- **Windows**: download `CodexScope-windows.zip`, unzip it, then double-click `Open CodexScope.cmd` in the extracted folder\n\nRelease zips include a prebuilt generator, so normal users do not need to install Go. The launcher generates `data.js` and `data.raw.js` from your local Codex logs and then opens `index.html`. Source checkouts can still fall back to `go build` when the prebuilt generator is absent.\nSubsequent runs reuse a local `.codexscope-cache.json` file and only rescan changed session logs. If nothing changed, the generator can skip rewriting the export files; if a log grew, it appends from the previous cached offset.\n\nNote: GitHub's automatic **Source code (zip)** asset is for developers, not the recommended user download. It may require Go or local compilation. Prefer `CodexScope-mac.zip` \u002F `CodexScope-windows.zip`.\n\nIf macOS says it cannot verify `open-dashboard.command`, open **System Settings → Privacy & Security**, find the blocked `open-dashboard.command` message, and click **Open Anyway**. You can also right-click the file and choose **Open**.\n\nIf macOS still refuses to open it, run this once in Terminal from the project folder:\n\n```bash\nxattr -dr com.apple.quarantine .\nchmod +x macos\u002Fopen-dashboard.command\n```\n\nYou can also run the same steps manually on macOS or Linux:\n\n```bash\ngo run generate_codex_data.go\nopen index.html\n```\n\nOn Windows PowerShell:\n\n```powershell\ngo run .\\generate_codex_data.go\nstart .\\index.html\n```\n\nBy default, the generator reads Codex logs from:\n\n- macOS\u002FLinux: `~\u002F.codex\u002Fsessions`\n- Windows: `%USERPROFILE%\\.codex\\sessions`\n\nIf your Codex sessions are stored elsewhere, pass the path explicitly:\n\n```powershell\ngo run .\\generate_codex_data.go --root \"$env:USERPROFILE\\.codex\\sessions\"\n```\n\nThe generator writes `data.js` and `data.raw.js` next to `index.html`. Once those files exist, the dashboard automatically uses your real local data instead of the bundled demo. `data.js`, `data.raw.js`, and `.codexscope-cache.json` may contain private project names, session ids, timestamps, usage patterns, and quota status, so they are excluded by `.gitignore`.\n\n## Project Structure\n\n- `index.html`: the static dashboard shell.\n- `styles.css`: dashboard layout and visual styling.\n- `app.ts`: TypeScript source for charts, filters, rankings, quota display, and cost estimation.\n- `app.js`: compiled browser script loaded by `index.html`.\n- `generate_codex_data.go`: the local data generator. It scans Codex JSONL session logs, extracts usage metadata, and writes `data.js` plus `data.raw.js`.\n- `data.sample.js`: bundled demo data used when no local `data.js` exists.\n- `CHANGELOG.md`: release notes for each published version.\n- `macos\u002Fopen-dashboard.command`: macOS launcher that runs the generator and opens the dashboard.\n- `windows\u002Fopen-dashboard.cmd`: Windows launcher that runs the generator and opens the dashboard.\n- `verify_responsive.js`: Playwright-based layout and interaction audit.\n- `scripts\u002Fbuild-release.sh`: builds platform-specific release folders and zip packages.\n- `assets\u002F`: screenshots and static project assets.\n\n## Data Flow\n\n1. Codex writes local JSONL session logs under `~\u002F.codex\u002Fsessions`.\n2. `generate_codex_data.go` scans local `.jsonl` files and extracts only usage metadata: token counts, model names, session ids, timing, failures, and rate-limit metadata.\n3. The generator writes precomputed range views to `data.js` as `window.CODEXSCOPE_DATA`, and compact catalogs plus raw event rows to `data.raw.js` as `window.CODEXSCOPE_RAW_DATA`.\n4. `index.html` loads `data.sample.js` first and then `data.js`. If real local data exists, it overrides the sample data; `data.raw.js` is loaded only when custom date ranges need raw rows.\n5. Date filters, charts, rankings, quota status, and cost estimates are computed in the browser from that local record set.\n\n## What Gets Displayed\n\n- **Token trend**: cumulative input, cached, output, and reasoning token usage over the selected range.\n- **Quota and risk**: remaining short-window and weekly quota when Codex local logs include rate-limit metadata.\n- **Distribution**: request count or token volume grouped by time bucket.\n- **Rankings**: busiest sessions and models for the selected period.\n- **Cost estimate**: a local estimate using token counts and model pricing rules exported by the generator.\n\n## Cost Estimates\n\nThe cost card is an estimate, not an official bill. It uses local token counts and generator-exported rules based on OpenAI's published USD model prices. Actual ChatGPT\u002FCodex billing, credits, and subscription quota status should always be checked with the official account or billing page.\n\nUSD is the source currency. The CNY view is only a display conversion. When available, CodexScope fetches the USD\u002FCNY rate from the Frankfurter API with the ECB provider selected. If that request fails, it falls back to the last bundled reference rate and marks the conversion as offline fallback in the UI.\n\n## Verify Layout\n\nThe responsive visual audit uses Playwright:\n\n```bash\nnpm install\nnpm run verify\n```\n\n## Build Release Packages\n\nRelease packages include prebuilt generators, so end users do not need Go:\n\n```bash\nnpm install\nnpm run release:local\n```\n\nThis writes:\n\n- `dist\u002FCodexScope-mac.zip` with a root-level launcher and instructions, with the rest tucked under `CodexScope Files\u002F`\n- `dist\u002FCodexScope-windows.zip` with a root-level launcher and instructions, with the rest tucked under `CodexScope Files\u002F`\n\nThe GitHub Actions release workflow builds the same zip files for tags named `v*`.\n\n## Privacy\n\nCodexScope does not send data to a server. `generate_codex_data.go` reads local Codex session logs and exports only usage metadata:\n\n- session id and working-directory basename\n- model name\n- token counts\n- rate limit metadata\n- task duration, first-token latency, failures\n\nIt does not export prompt text, assistant messages, tool output, or file contents.\n\nReview `data.js` and `data.raw.js` before sharing screenshots or artifacts generated from your own usage.\n\n## License\n\nMIT\n","CodexScope 是一个本地优先的仪表盘工具，用于从本地会话日志中检查 Codex 的使用情况。它将本地 Codex 元数据转换为简洁的桌面仪表盘，展示包括令牌趋势、配额和风险状态、会话排名、模型排名、请求分布、缓存命中率和预估成本等信息。该项目采用静态 HTML 应用形式，无需后端服务或账户连接，也不涉及托管遥测数据，确保了用户数据的私密性和安全性。适用于需要在本地环境中监控和分析 Codex 使用情况的开发者或团队，特别是那些对隐私有较高要求的场景。通过简单的下载与运行，用户即可快速获得详尽且直观的 Codex 使用报告。",2,"2026-06-11 04:03:26","CREATED_QUERY"]