codex-usage-tracking 0.3.0__tar.gz → 0.3.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {codex_usage_tracking-0.3.0 → codex_usage_tracking-0.3.2}/.codex-plugin/plugin.json +1 -1
- {codex_usage_tracking-0.3.0 → codex_usage_tracking-0.3.2}/CHANGELOG.md +11 -0
- {codex_usage_tracking-0.3.0 → codex_usage_tracking-0.3.2}/PKG-INFO +10 -7
- {codex_usage_tracking-0.3.0 → codex_usage_tracking-0.3.2}/README.md +9 -6
- {codex_usage_tracking-0.3.0 → codex_usage_tracking-0.3.2}/SECURITY.md +1 -1
- {codex_usage_tracking-0.3.0 → codex_usage_tracking-0.3.2}/docs/cli-reference.md +5 -1
- {codex_usage_tracking-0.3.0 → codex_usage_tracking-0.3.2}/docs/dashboard-guide.md +7 -5
- {codex_usage_tracking-0.3.0 → codex_usage_tracking-0.3.2}/docs/development.md +13 -5
- {codex_usage_tracking-0.3.0 → codex_usage_tracking-0.3.2}/docs/install.md +10 -5
- {codex_usage_tracking-0.3.0 → codex_usage_tracking-0.3.2}/docs/mcp.md +3 -1
- {codex_usage_tracking-0.3.0 → codex_usage_tracking-0.3.2}/docs/privacy.md +3 -1
- {codex_usage_tracking-0.3.0 → codex_usage_tracking-0.3.2}/pyproject.toml +1 -1
- {codex_usage_tracking-0.3.0/src/codex_usage_tracker/plugin_data → codex_usage_tracking-0.3.2}/skills/codex-usage-api/SKILL.md +1 -1
- {codex_usage_tracking-0.3.0/src/codex_usage_tracker/plugin_data → codex_usage_tracking-0.3.2}/skills/codex-usage-tracker/SKILL.md +3 -3
- {codex_usage_tracking-0.3.0 → codex_usage_tracking-0.3.2}/skills/codex-usage-tracker/scripts/run_mcp.py +2 -2
- {codex_usage_tracking-0.3.0 → codex_usage_tracking-0.3.2}/src/codex_usage_tracker/__init__.py +1 -1
- {codex_usage_tracking-0.3.0 → codex_usage_tracking-0.3.2}/src/codex_usage_tracker/cli.py +13 -5
- {codex_usage_tracking-0.3.0 → codex_usage_tracking-0.3.2}/src/codex_usage_tracker/plugin_data/dashboard/dashboard.css +5 -0
- {codex_usage_tracking-0.3.0 → codex_usage_tracking-0.3.2}/src/codex_usage_tracker/plugin_data/dashboard/dashboard.js +41 -4
- {codex_usage_tracking-0.3.0 → codex_usage_tracking-0.3.2}/src/codex_usage_tracker/plugin_data/docs/dashboard-guide.html +4 -3
- {codex_usage_tracking-0.3.0 → codex_usage_tracking-0.3.2/src/codex_usage_tracker/plugin_data}/skills/codex-usage-api/SKILL.md +1 -1
- {codex_usage_tracking-0.3.0 → codex_usage_tracking-0.3.2/src/codex_usage_tracker/plugin_data}/skills/codex-usage-tracker/SKILL.md +3 -3
- {codex_usage_tracking-0.3.0 → codex_usage_tracking-0.3.2}/src/codex_usage_tracker/server.py +51 -7
- {codex_usage_tracking-0.3.0 → codex_usage_tracking-0.3.2}/src/codex_usage_tracking.egg-info/PKG-INFO +10 -7
- {codex_usage_tracking-0.3.0 → codex_usage_tracking-0.3.2}/tests/test_cli_release.py +47 -1
- {codex_usage_tracking-0.3.0 → codex_usage_tracking-0.3.2}/tests/test_plugin_installer.py +1 -1
- {codex_usage_tracking-0.3.0 → codex_usage_tracking-0.3.2}/tests/test_store_dashboard_mcp.py +50 -9
- {codex_usage_tracking-0.3.0 → codex_usage_tracking-0.3.2}/.mcp.json +0 -0
- {codex_usage_tracking-0.3.0 → codex_usage_tracking-0.3.2}/AGENTS.md +0 -0
- {codex_usage_tracking-0.3.0 → codex_usage_tracking-0.3.2}/CONTRIBUTING.md +0 -0
- {codex_usage_tracking-0.3.0 → codex_usage_tracking-0.3.2}/LICENSE +0 -0
- {codex_usage_tracking-0.3.0 → codex_usage_tracking-0.3.2}/MANIFEST.in +0 -0
- {codex_usage_tracking-0.3.0 → codex_usage_tracking-0.3.2}/assets/icon.svg +0 -0
- {codex_usage_tracking-0.3.0 → codex_usage_tracking-0.3.2}/docs/architecture.md +0 -0
- {codex_usage_tracking-0.3.0 → codex_usage_tracking-0.3.2}/docs/assets/dashboard-calls-preview.png +0 -0
- {codex_usage_tracking-0.3.0 → codex_usage_tracking-0.3.2}/docs/assets/dashboard-calls.png +0 -0
- {codex_usage_tracking-0.3.0 → codex_usage_tracking-0.3.2}/docs/assets/dashboard-details.png +0 -0
- {codex_usage_tracking-0.3.0 → codex_usage_tracking-0.3.2}/docs/assets/dashboard-insights.png +0 -0
- {codex_usage_tracking-0.3.0 → codex_usage_tracking-0.3.2}/docs/assets/dashboard-threads.png +0 -0
- {codex_usage_tracking-0.3.0 → codex_usage_tracking-0.3.2}/docs/assets/plugin-prompts.png +0 -0
- {codex_usage_tracking-0.3.0 → codex_usage_tracking-0.3.2}/docs/assets/plugin-thread-leaderboard.png +0 -0
- {codex_usage_tracking-0.3.0 → codex_usage_tracking-0.3.2}/docs/assets/ux/call-detail-panel.png +0 -0
- {codex_usage_tracking-0.3.0 → codex_usage_tracking-0.3.2}/docs/assets/ux/insight-overview.png +0 -0
- {codex_usage_tracking-0.3.0 → codex_usage_tracking-0.3.2}/docs/assets/ux/thread-investigation.png +0 -0
- {codex_usage_tracking-0.3.0 → codex_usage_tracking-0.3.2}/docs/cli-json-schemas.md +0 -0
- {codex_usage_tracking-0.3.0 → codex_usage_tracking-0.3.2}/docs/pricing-and-credits.md +0 -0
- {codex_usage_tracking-0.3.0 → codex_usage_tracking-0.3.2}/docs/ui-ux-improvement-plan.md +0 -0
- {codex_usage_tracking-0.3.0 → codex_usage_tracking-0.3.2}/scripts/benchmark_synthetic_history.py +0 -0
- {codex_usage_tracking-0.3.0 → codex_usage_tracking-0.3.2}/scripts/check_release.py +0 -0
- {codex_usage_tracking-0.3.0 → codex_usage_tracking-0.3.2}/scripts/install_local_plugin.py +0 -0
- {codex_usage_tracking-0.3.0 → codex_usage_tracking-0.3.2}/setup.cfg +0 -0
- {codex_usage_tracking-0.3.0 → codex_usage_tracking-0.3.2}/src/codex_usage_tracker/__main__.py +0 -0
- {codex_usage_tracking-0.3.0 → codex_usage_tracking-0.3.2}/src/codex_usage_tracker/allowance.py +0 -0
- {codex_usage_tracking-0.3.0 → codex_usage_tracking-0.3.2}/src/codex_usage_tracker/api_payloads.py +0 -0
- {codex_usage_tracking-0.3.0 → codex_usage_tracking-0.3.2}/src/codex_usage_tracker/context.py +0 -0
- {codex_usage_tracking-0.3.0 → codex_usage_tracking-0.3.2}/src/codex_usage_tracker/costing.py +0 -0
- {codex_usage_tracking-0.3.0 → codex_usage_tracking-0.3.2}/src/codex_usage_tracker/dashboard.py +0 -0
- {codex_usage_tracking-0.3.0 → codex_usage_tracking-0.3.2}/src/codex_usage_tracker/diagnostics.py +0 -0
- {codex_usage_tracking-0.3.0 → codex_usage_tracking-0.3.2}/src/codex_usage_tracker/formatting.py +0 -0
- {codex_usage_tracking-0.3.0 → codex_usage_tracking-0.3.2}/src/codex_usage_tracker/json_contracts.py +0 -0
- {codex_usage_tracking-0.3.0 → codex_usage_tracking-0.3.2}/src/codex_usage_tracker/mcp_server.py +0 -0
- {codex_usage_tracking-0.3.0 → codex_usage_tracking-0.3.2}/src/codex_usage_tracker/models.py +0 -0
- {codex_usage_tracking-0.3.0 → codex_usage_tracking-0.3.2}/src/codex_usage_tracker/parser.py +0 -0
- {codex_usage_tracking-0.3.0 → codex_usage_tracking-0.3.2}/src/codex_usage_tracker/paths.py +0 -0
- {codex_usage_tracking-0.3.0 → codex_usage_tracking-0.3.2}/src/codex_usage_tracker/plugin_data/__init__.py +0 -0
- {codex_usage_tracking-0.3.0 → codex_usage_tracking-0.3.2}/src/codex_usage_tracker/plugin_data/assets/icon.svg +0 -0
- {codex_usage_tracking-0.3.0 → codex_usage_tracking-0.3.2}/src/codex_usage_tracker/plugin_data/dashboard/dashboard_data.js +0 -0
- {codex_usage_tracking-0.3.0 → codex_usage_tracking-0.3.2}/src/codex_usage_tracker/plugin_data/dashboard/dashboard_format.js +0 -0
- {codex_usage_tracking-0.3.0 → codex_usage_tracking-0.3.2}/src/codex_usage_tracker/plugin_data/dashboard/dashboard_state.js +0 -0
- {codex_usage_tracking-0.3.0 → codex_usage_tracking-0.3.2}/src/codex_usage_tracker/plugin_data/dashboard/dashboard_template.html +0 -0
- {codex_usage_tracking-0.3.0 → codex_usage_tracking-0.3.2}/src/codex_usage_tracker/plugin_data/docs/assets/dashboard-calls.png +0 -0
- {codex_usage_tracking-0.3.0 → codex_usage_tracking-0.3.2}/src/codex_usage_tracker/plugin_data/docs/assets/dashboard-details.png +0 -0
- {codex_usage_tracking-0.3.0 → codex_usage_tracking-0.3.2}/src/codex_usage_tracker/plugin_data/docs/assets/dashboard-insights.png +0 -0
- {codex_usage_tracking-0.3.0 → codex_usage_tracking-0.3.2}/src/codex_usage_tracker/plugin_data/docs/assets/dashboard-threads.png +0 -0
- {codex_usage_tracking-0.3.0 → codex_usage_tracking-0.3.2}/src/codex_usage_tracker/plugin_data/rate_cards/codex-credit-rates.json +0 -0
- {codex_usage_tracking-0.3.0 → codex_usage_tracking-0.3.2}/src/codex_usage_tracker/plugin_installer.py +0 -0
- {codex_usage_tracking-0.3.0 → codex_usage_tracking-0.3.2}/src/codex_usage_tracker/pricing.py +0 -0
- {codex_usage_tracking-0.3.0 → codex_usage_tracking-0.3.2}/src/codex_usage_tracker/pricing_config.py +0 -0
- {codex_usage_tracking-0.3.0 → codex_usage_tracking-0.3.2}/src/codex_usage_tracker/pricing_estimates.py +0 -0
- {codex_usage_tracking-0.3.0 → codex_usage_tracking-0.3.2}/src/codex_usage_tracker/pricing_openai.py +0 -0
- {codex_usage_tracking-0.3.0 → codex_usage_tracking-0.3.2}/src/codex_usage_tracker/projects.py +0 -0
- {codex_usage_tracking-0.3.0 → codex_usage_tracking-0.3.2}/src/codex_usage_tracker/recommendations.py +0 -0
- {codex_usage_tracking-0.3.0 → codex_usage_tracking-0.3.2}/src/codex_usage_tracker/reports.py +0 -0
- {codex_usage_tracking-0.3.0 → codex_usage_tracking-0.3.2}/src/codex_usage_tracker/schema.py +0 -0
- {codex_usage_tracking-0.3.0 → codex_usage_tracking-0.3.2}/src/codex_usage_tracker/store.py +0 -0
- {codex_usage_tracking-0.3.0 → codex_usage_tracking-0.3.2}/src/codex_usage_tracker/support.py +0 -0
- {codex_usage_tracking-0.3.0 → codex_usage_tracking-0.3.2}/src/codex_usage_tracker/threads.py +0 -0
- {codex_usage_tracking-0.3.0 → codex_usage_tracking-0.3.2}/src/codex_usage_tracking.egg-info/SOURCES.txt +0 -0
- {codex_usage_tracking-0.3.0 → codex_usage_tracking-0.3.2}/src/codex_usage_tracking.egg-info/dependency_links.txt +0 -0
- {codex_usage_tracking-0.3.0 → codex_usage_tracking-0.3.2}/src/codex_usage_tracking.egg-info/entry_points.txt +0 -0
- {codex_usage_tracking-0.3.0 → codex_usage_tracking-0.3.2}/src/codex_usage_tracking.egg-info/requires.txt +0 -0
- {codex_usage_tracking-0.3.0 → codex_usage_tracking-0.3.2}/src/codex_usage_tracking.egg-info/top_level.txt +0 -0
- {codex_usage_tracking-0.3.0 → codex_usage_tracking-0.3.2}/tests/test_allowance.py +0 -0
- {codex_usage_tracking-0.3.0 → codex_usage_tracking-0.3.2}/tests/test_cli_lifecycle.py +0 -0
- {codex_usage_tracking-0.3.0 → codex_usage_tracking-0.3.2}/tests/test_json_contracts.py +0 -0
- {codex_usage_tracking-0.3.0 → codex_usage_tracking-0.3.2}/tests/test_mcp_launcher.py +0 -0
- {codex_usage_tracking-0.3.0 → codex_usage_tracking-0.3.2}/tests/test_parser.py +0 -0
- {codex_usage_tracking-0.3.0 → codex_usage_tracking-0.3.2}/tests/test_pricing.py +0 -0
- {codex_usage_tracking-0.3.0 → codex_usage_tracking-0.3.2}/tests/test_projects.py +0 -0
- {codex_usage_tracking-0.3.0 → codex_usage_tracking-0.3.2}/tests/test_recommendations.py +0 -0
- {codex_usage_tracking-0.3.0 → codex_usage_tracking-0.3.2}/tests/test_schema.py +0 -0
- {codex_usage_tracking-0.3.0 → codex_usage_tracking-0.3.2}/tests/test_threads.py +0 -0
|
@@ -2,6 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 0.3.2 - 2026-06-08
|
|
6
|
+
|
|
7
|
+
- Make `open-dashboard` and `serve-dashboard` refresh active-session logs by default, with `--no-refresh` as the explicit cached-index mode.
|
|
8
|
+
- Add a token-protected dashboard action for enabling context loading without restarting a localhost server that started with context loading off.
|
|
9
|
+
|
|
10
|
+
## 0.3.1 - 2026-06-08
|
|
11
|
+
|
|
12
|
+
- Fix packaged Codex Usage Tracker skills so dashboard-open requests start the live localhost dashboard instead of a static snapshot.
|
|
13
|
+
- Mirror live-dashboard skill guidance between source-tree skills and packaged plugin-data copies so release and wheel checks stay green.
|
|
14
|
+
- Use the valid explicit context API flag form, `serve-dashboard --refresh --context-api explicit --open`, for live dashboard launches.
|
|
15
|
+
|
|
5
16
|
## 0.3.0 - 2026-06-08
|
|
6
17
|
|
|
7
18
|
0.3.0 is a stabilization and public-preview release for the dashboard, CLI, MCP tools, local privacy model, packaged Codex plugin, and companion usage skills. The PyPI/TestPyPI distribution name is now `codex-usage-tracking`; the GitHub repository remains `douglasmonsky/codex-usage-tracker`, the Python import package remains `codex_usage_tracker`, and the installed CLI command remains `codex-usage-tracker`.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: codex-usage-tracking
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.2
|
|
4
4
|
Summary: Unofficial local Codex plugin and dashboard for investigating aggregate token usage, costs, caching, and thread patterns.
|
|
5
5
|
Author: Douglas Monsky
|
|
6
6
|
License-Expression: MIT
|
|
@@ -44,6 +44,7 @@ Dynamic: license-file
|
|
|
44
44
|
Local-first dashboard, Codex plugin, and companion skill for understanding where your Codex tokens and usage credits are going.
|
|
45
45
|
|
|
46
46
|
[](https://github.com/douglasmonsky/codex-usage-tracker/actions/workflows/ci.yml)
|
|
47
|
+
[](https://pypi.org/project/codex-usage-tracking/)
|
|
47
48
|

|
|
48
49
|
[](LICENSE)
|
|
49
50
|
|
|
@@ -51,7 +52,7 @@ Local-first dashboard, Codex plugin, and companion skill for understanding where
|
|
|
51
52
|
|
|
52
53
|
Codex Usage Tracker reads the JSONL logs already written by Codex, indexes aggregate usage counters into SQLite, and gives you a dashboard, CLI, and MCP tools for investigating real usage patterns. It keeps prompts, assistant messages, tool output, pasted secrets, and raw transcript content out of SQLite, CSV exports, and generated dashboard HTML.
|
|
53
54
|
|
|
54
|
-
Built for developers using Codex locally who want to know which threads, models, subagents, and long chats are driving usage without uploading logs anywhere.
|
|
55
|
+
Built for developers using Codex locally who want to know which threads, models, subagents, and long chats are driving usage without uploading logs anywhere. The public PyPI package is [`codex-usage-tracking`](https://pypi.org/project/codex-usage-tracking/), and it installs the `codex-usage-tracker` command.
|
|
55
56
|
|
|
56
57
|
After install, you get a localhost dashboard, a local SQLite aggregate index, CLI reports, MCP tools, and a companion Codex skill for asking questions like "what drove my usage this week?"
|
|
57
58
|
|
|
@@ -67,9 +68,11 @@ codex-usage-tracker serve-dashboard --open
|
|
|
67
68
|
|
|
68
69
|
Use your normal Python launcher for your platform: `python3` is common on macOS/Linux, and `py` may be preferable on Windows. On macOS with Homebrew, `brew install pipx` is also fine.
|
|
69
70
|
|
|
71
|
+
`serve-dashboard` refreshes active-session usage before opening by default. Use `--no-refresh` only when you intentionally want to inspect the cached local index.
|
|
72
|
+
|
|
70
73
|
Package naming: the PyPI distribution is `codex-usage-tracking`; the installed command is `codex-usage-tracker`; the GitHub repository remains `douglasmonsky/codex-usage-tracker`. The `codex-usage-tracker` PyPI name is not this project, so avoid similarly named packages when following these docs.
|
|
71
74
|
|
|
72
|
-
|
|
75
|
+
Source install for development or branch testing:
|
|
73
76
|
|
|
74
77
|
```bash
|
|
75
78
|
pipx install "git+https://github.com/douglasmonsky/codex-usage-tracker.git"
|
|
@@ -77,7 +80,7 @@ pipx install "git+https://github.com/douglasmonsky/codex-usage-tracker.git"
|
|
|
77
80
|
|
|
78
81
|
`setup` installs or refreshes the local Codex plugin wrapper, initializes local config templates when needed, refreshes the aggregate index, runs `codex-usage-tracker doctor`, and tells you whether Codex needs a restart for plugin discovery.
|
|
79
82
|
|
|
80
|
-
Want Codex to do it for you? Paste: `Install codex-usage-tracking with pipx, run codex-usage-tracker setup, and open the Codex Usage Tracker dashboard
|
|
83
|
+
Want Codex to do it for you? Paste: `Install codex-usage-tracking with pipx, run codex-usage-tracker setup, and open the Codex Usage Tracker dashboard.`
|
|
81
84
|
|
|
82
85
|
After plugin discovery, Codex can use the companion usage skill to refresh local aggregates, call the MCP tools, and explain usage patterns conversationally. Examples: [MCP And Codex Skills](docs/mcp.md).
|
|
83
86
|
|
|
@@ -192,7 +195,7 @@ codex-usage-tracker summary --preset last-7-days
|
|
|
192
195
|
codex-usage-tracker query --since 2026-06-01 --min-credits 1
|
|
193
196
|
codex-usage-tracker session <session-id>
|
|
194
197
|
codex-usage-tracker export --output usage.csv
|
|
195
|
-
codex-usage-tracker dashboard
|
|
198
|
+
codex-usage-tracker open-dashboard
|
|
196
199
|
codex-usage-tracker support-bundle --output ~/.codex-usage-tracker/support-bundle.json
|
|
197
200
|
```
|
|
198
201
|
|
|
@@ -204,7 +207,7 @@ The tracker stores aggregate metrics only: session ids, timestamps, local source
|
|
|
204
207
|
|
|
205
208
|
It does **not** store prompts, assistant messages, tool output, pasted secrets, raw transcript snippets, or raw context in SQLite, CSV exports, generated dashboard HTML, or synthetic screenshots.
|
|
206
209
|
|
|
207
|
-
On-demand context loading reads a single original local JSONL file only after an explicit row action, redacts common secret patterns, caps returned text size, and can
|
|
210
|
+
On-demand context loading reads a single original local JSONL file only after an explicit row action, redacts common secret patterns, caps returned text size, and can start off until you enable it from the details panel:
|
|
208
211
|
|
|
209
212
|
```bash
|
|
210
213
|
codex-usage-tracker serve-dashboard --no-context-api --open
|
|
@@ -237,7 +240,7 @@ Open a Codex session on your machine and paste this:
|
|
|
237
240
|
|
|
238
241
|
```text
|
|
239
242
|
Install and configure Codex Usage Tracker.
|
|
240
|
-
Install the PyPI distribution codex-usage-tracking with pipx. The installed command should be codex-usage-tracker.
|
|
243
|
+
Install the PyPI distribution codex-usage-tracking with pipx. The installed command should be codex-usage-tracker. Use pipx install "git+https://github.com/douglasmonsky/codex-usage-tracker.git" only for branch testing or if PyPI is temporarily unavailable.
|
|
241
244
|
If pipx is missing, install it with the platform's Python launcher or use a local virtual environment.
|
|
242
245
|
After installation, run codex-usage-tracker setup and serve-dashboard --open.
|
|
243
246
|
Verify the dashboard opens locally and tell me the dashboard URL plus whether I need to restart Codex for plugin discovery.
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
Local-first dashboard, Codex plugin, and companion skill for understanding where your Codex tokens and usage credits are going.
|
|
9
9
|
|
|
10
10
|
[](https://github.com/douglasmonsky/codex-usage-tracker/actions/workflows/ci.yml)
|
|
11
|
+
[](https://pypi.org/project/codex-usage-tracking/)
|
|
11
12
|

|
|
12
13
|
[](LICENSE)
|
|
13
14
|
|
|
@@ -15,7 +16,7 @@ Local-first dashboard, Codex plugin, and companion skill for understanding where
|
|
|
15
16
|
|
|
16
17
|
Codex Usage Tracker reads the JSONL logs already written by Codex, indexes aggregate usage counters into SQLite, and gives you a dashboard, CLI, and MCP tools for investigating real usage patterns. It keeps prompts, assistant messages, tool output, pasted secrets, and raw transcript content out of SQLite, CSV exports, and generated dashboard HTML.
|
|
17
18
|
|
|
18
|
-
Built for developers using Codex locally who want to know which threads, models, subagents, and long chats are driving usage without uploading logs anywhere.
|
|
19
|
+
Built for developers using Codex locally who want to know which threads, models, subagents, and long chats are driving usage without uploading logs anywhere. The public PyPI package is [`codex-usage-tracking`](https://pypi.org/project/codex-usage-tracking/), and it installs the `codex-usage-tracker` command.
|
|
19
20
|
|
|
20
21
|
After install, you get a localhost dashboard, a local SQLite aggregate index, CLI reports, MCP tools, and a companion Codex skill for asking questions like "what drove my usage this week?"
|
|
21
22
|
|
|
@@ -31,9 +32,11 @@ codex-usage-tracker serve-dashboard --open
|
|
|
31
32
|
|
|
32
33
|
Use your normal Python launcher for your platform: `python3` is common on macOS/Linux, and `py` may be preferable on Windows. On macOS with Homebrew, `brew install pipx` is also fine.
|
|
33
34
|
|
|
35
|
+
`serve-dashboard` refreshes active-session usage before opening by default. Use `--no-refresh` only when you intentionally want to inspect the cached local index.
|
|
36
|
+
|
|
34
37
|
Package naming: the PyPI distribution is `codex-usage-tracking`; the installed command is `codex-usage-tracker`; the GitHub repository remains `douglasmonsky/codex-usage-tracker`. The `codex-usage-tracker` PyPI name is not this project, so avoid similarly named packages when following these docs.
|
|
35
38
|
|
|
36
|
-
|
|
39
|
+
Source install for development or branch testing:
|
|
37
40
|
|
|
38
41
|
```bash
|
|
39
42
|
pipx install "git+https://github.com/douglasmonsky/codex-usage-tracker.git"
|
|
@@ -41,7 +44,7 @@ pipx install "git+https://github.com/douglasmonsky/codex-usage-tracker.git"
|
|
|
41
44
|
|
|
42
45
|
`setup` installs or refreshes the local Codex plugin wrapper, initializes local config templates when needed, refreshes the aggregate index, runs `codex-usage-tracker doctor`, and tells you whether Codex needs a restart for plugin discovery.
|
|
43
46
|
|
|
44
|
-
Want Codex to do it for you? Paste: `Install codex-usage-tracking with pipx, run codex-usage-tracker setup, and open the Codex Usage Tracker dashboard
|
|
47
|
+
Want Codex to do it for you? Paste: `Install codex-usage-tracking with pipx, run codex-usage-tracker setup, and open the Codex Usage Tracker dashboard.`
|
|
45
48
|
|
|
46
49
|
After plugin discovery, Codex can use the companion usage skill to refresh local aggregates, call the MCP tools, and explain usage patterns conversationally. Examples: [MCP And Codex Skills](docs/mcp.md).
|
|
47
50
|
|
|
@@ -156,7 +159,7 @@ codex-usage-tracker summary --preset last-7-days
|
|
|
156
159
|
codex-usage-tracker query --since 2026-06-01 --min-credits 1
|
|
157
160
|
codex-usage-tracker session <session-id>
|
|
158
161
|
codex-usage-tracker export --output usage.csv
|
|
159
|
-
codex-usage-tracker dashboard
|
|
162
|
+
codex-usage-tracker open-dashboard
|
|
160
163
|
codex-usage-tracker support-bundle --output ~/.codex-usage-tracker/support-bundle.json
|
|
161
164
|
```
|
|
162
165
|
|
|
@@ -168,7 +171,7 @@ The tracker stores aggregate metrics only: session ids, timestamps, local source
|
|
|
168
171
|
|
|
169
172
|
It does **not** store prompts, assistant messages, tool output, pasted secrets, raw transcript snippets, or raw context in SQLite, CSV exports, generated dashboard HTML, or synthetic screenshots.
|
|
170
173
|
|
|
171
|
-
On-demand context loading reads a single original local JSONL file only after an explicit row action, redacts common secret patterns, caps returned text size, and can
|
|
174
|
+
On-demand context loading reads a single original local JSONL file only after an explicit row action, redacts common secret patterns, caps returned text size, and can start off until you enable it from the details panel:
|
|
172
175
|
|
|
173
176
|
```bash
|
|
174
177
|
codex-usage-tracker serve-dashboard --no-context-api --open
|
|
@@ -201,7 +204,7 @@ Open a Codex session on your machine and paste this:
|
|
|
201
204
|
|
|
202
205
|
```text
|
|
203
206
|
Install and configure Codex Usage Tracker.
|
|
204
|
-
Install the PyPI distribution codex-usage-tracking with pipx. The installed command should be codex-usage-tracker.
|
|
207
|
+
Install the PyPI distribution codex-usage-tracking with pipx. The installed command should be codex-usage-tracker. Use pipx install "git+https://github.com/douglasmonsky/codex-usage-tracker.git" only for branch testing or if PyPI is temporarily unavailable.
|
|
205
208
|
If pipx is missing, install it with the platform's Python launcher or use a local virtual environment.
|
|
206
209
|
After installation, run codex-usage-tracker setup and serve-dashboard --open.
|
|
207
210
|
Verify the dashboard opens locally and tell me the dashboard URL plus whether I need to restart Codex for plugin discovery.
|
|
@@ -22,7 +22,7 @@ The MCP `usage_call_context` tool is disabled unless the MCP server process expl
|
|
|
22
22
|
|
|
23
23
|
## Localhost Dashboard Token
|
|
24
24
|
|
|
25
|
-
`serve-dashboard` creates a random per-server API token and embeds it in the generated dashboard HTML for that local server session. The token is used for localhost `/api/usage` refreshes
|
|
25
|
+
`serve-dashboard` creates a random per-server API token and embeds it in the generated dashboard HTML for that local server session. The token is used for localhost `/api/usage` refreshes, `/api/context` requests, and runtime context-loading settings. Treat generated active dashboard files and URLs as local-only artifacts; do not publish them or send them to someone else.
|
|
26
26
|
|
|
27
27
|
The dashboard server rejects non-loopback hosts and cross-origin requests. This is a local hardening measure, not a reason to expose the server on a network interface.
|
|
28
28
|
|
|
@@ -33,11 +33,15 @@ codex-usage-tracker inspect-log ~/.codex/sessions/YYYY/MM/DD/rollout-...jsonl --
|
|
|
33
33
|
codex-usage-tracker dashboard --open
|
|
34
34
|
codex-usage-tracker dashboard --include-archived --open
|
|
35
35
|
codex-usage-tracker open-dashboard
|
|
36
|
+
codex-usage-tracker open-dashboard --no-refresh
|
|
36
37
|
codex-usage-tracker serve-dashboard --open
|
|
38
|
+
codex-usage-tracker serve-dashboard --no-refresh --open
|
|
37
39
|
codex-usage-tracker serve-dashboard --no-context-api --open
|
|
38
40
|
```
|
|
39
41
|
|
|
40
|
-
`serve-dashboard --context-api explicit` is the default and keeps context loading as an explicit per-row action. `serve-dashboard --no-context-api` or `--context-api disabled`
|
|
42
|
+
`serve-dashboard --context-api explicit` is the default and keeps context loading as an explicit per-row action. `serve-dashboard --no-context-api` or `--context-api disabled` starts with context loading off; a token-protected button in the local details panel can enable it without restarting the server.
|
|
43
|
+
|
|
44
|
+
`open-dashboard` and `serve-dashboard` refresh active-session logs before opening by default. Use `--no-refresh` only for an intentionally cached snapshot. The lower-level `dashboard` command writes from the current SQLite index and does not rescan logs.
|
|
41
45
|
|
|
42
46
|
Dashboards default to active sessions only. Use `--include-archived` for an all-history static/opened dashboard, or switch the served dashboard's `History` control from `Active sessions only` to `All history` when you intentionally want archived logs scanned and included.
|
|
43
47
|
|
|
@@ -35,6 +35,8 @@ codex-usage-tracker --privacy-mode strict dashboard --open
|
|
|
35
35
|
|
|
36
36
|
Redacted mode hides raw cwd/source paths, hides Git remote labels, and hashes unnamed projects while preserving configured aliases. Strict mode also hides project-relative cwd, Git branch, and tags. The dashboard header shows the active metadata mode.
|
|
37
37
|
|
|
38
|
+
`serve-dashboard` refreshes active-session logs before opening by default. Use `--no-refresh` only when you intentionally want a cached view of the existing local index.
|
|
39
|
+
|
|
38
40
|
The server keeps the HTML aggregate-only and enables two live features:
|
|
39
41
|
|
|
40
42
|
- `Refresh` rescans local Codex logs and updates the dashboard rows.
|
|
@@ -43,12 +45,12 @@ The server keeps the HTML aggregate-only and enables two live features:
|
|
|
43
45
|
For a static snapshot, use:
|
|
44
46
|
|
|
45
47
|
```bash
|
|
46
|
-
codex-usage-tracker dashboard
|
|
48
|
+
codex-usage-tracker open-dashboard
|
|
47
49
|
```
|
|
48
50
|
|
|
49
|
-
Static file mode can still filter, sort, and inspect aggregate call fields.
|
|
51
|
+
Static file mode can still filter, sort, and inspect aggregate call fields. `open-dashboard` refreshes before writing the snapshot unless you pass `--no-refresh`. Static files cannot refresh from logs or load raw context after opening; use `serve-dashboard` when you want those live controls.
|
|
50
52
|
|
|
51
|
-
The localhost server uses a random per-server token for refresh and context API calls, validates loopback `Host` and `Origin` headers, and can
|
|
53
|
+
The localhost server uses a random per-server token for refresh and context API calls, validates loopback `Host` and `Origin` headers, and can start with context loading off through `codex-usage-tracker serve-dashboard --no-context-api`.
|
|
52
54
|
|
|
53
55
|
## Insights View
|
|
54
56
|
|
|
@@ -141,12 +143,12 @@ When served from localhost, the details panel includes `Load context` and `Inclu
|
|
|
141
143
|
- `Load context` fetches a size-limited, redacted context excerpt for only that call.
|
|
142
144
|
- `Include tool output` repeats the request with tool output included, still redacted and capped.
|
|
143
145
|
- Raw context is not written to SQLite, CSV, or the generated dashboard HTML.
|
|
144
|
-
- If the server was started with `--no-context-api`,
|
|
146
|
+
- If the server was started with `--no-context-api`, context loading starts off. Use `Enable context loading` in the details panel when you want to allow explicit row actions without restarting the dashboard server.
|
|
145
147
|
|
|
146
148
|
## Practical Workflow
|
|
147
149
|
|
|
148
150
|
1. Start with `serve-dashboard --open`.
|
|
149
|
-
2.
|
|
151
|
+
2. Leave `Live` enabled while you work, or click `Refresh` after a Codex run finishes.
|
|
150
152
|
3. Leave `History` on `Active sessions only` for current work. Switch to `All history` when you intentionally want archived sessions included in the live refresh.
|
|
151
153
|
4. Optionally run `parse-allowance` with copied values from Codex Usage or `/status`, or initialize and edit `allowance.json` manually.
|
|
152
154
|
5. Start in `Insights` view and review the highest-severity attention cards.
|
|
@@ -12,7 +12,7 @@ python -m pip install ".[dev]" twine
|
|
|
12
12
|
codex-usage-tracker install-plugin --python .venv/bin/python
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
-
The public PyPI distribution is `codex-usage-tracking
|
|
15
|
+
The public PyPI distribution is [`codex-usage-tracking`](https://pypi.org/project/codex-usage-tracking/); it installs the `codex-usage-tracker` command. The repository and import package remain `douglasmonsky/codex-usage-tracker` and `codex_usage_tracker`.
|
|
16
16
|
|
|
17
17
|
## Repo Layout
|
|
18
18
|
|
|
@@ -119,15 +119,23 @@ The release checker verifies version alignment, required public docs, packaged p
|
|
|
119
119
|
|
|
120
120
|
Publishing uses GitHub Actions Trusted Publishing through `.github/workflows/publish.yml`; do not upload from a local machine and do not add PyPI or TestPyPI API tokens.
|
|
121
121
|
|
|
122
|
-
|
|
122
|
+
The first public package release, `0.3.0`, was published on June 8, 2026. Patch release `0.3.1` followed the same day to ship the live-dashboard skill launch fix. Patch release `0.3.2` made dashboard launch refresh the default and added runtime enablement for context loading:
|
|
123
|
+
|
|
124
|
+
- GitHub Release: `https://github.com/douglasmonsky/codex-usage-tracker/releases/tag/v0.3.0`
|
|
125
|
+
- GitHub Release: `https://github.com/douglasmonsky/codex-usage-tracker/releases/tag/v0.3.1`
|
|
126
|
+
- GitHub Release: `https://github.com/douglasmonsky/codex-usage-tracker/releases/tag/v0.3.2`
|
|
127
|
+
- PyPI: `https://pypi.org/project/codex-usage-tracking/`
|
|
128
|
+
- TestPyPI: `https://test.pypi.org/project/codex-usage-tracking/`
|
|
129
|
+
|
|
130
|
+
Before publishing a future release, confirm Trusted Publishers are still configured in both services with project name `codex-usage-tracking`, owner `douglasmonsky`, repository `codex-usage-tracker`, workflow filename `publish.yml`, and the matching environment name:
|
|
123
131
|
|
|
124
132
|
- TestPyPI environment: `testpypi`
|
|
125
133
|
- PyPI environment: `pypi`
|
|
126
134
|
|
|
127
|
-
TestPyPI and PyPI are separate services/accounts. Configure both before publishing to both.
|
|
135
|
+
TestPyPI and PyPI are separate services/accounts. Configure both before publishing to both, and keep the `pypi` GitHub environment behind manual approval.
|
|
128
136
|
|
|
129
137
|
To publish to TestPyPI, run the `Publish Python package` workflow manually with `target` set to `testpypi`. The job builds once, checks the artifacts with `twine`, uploads them as workflow artifacts, then publishes the same artifacts to `https://test.pypi.org/project/codex-usage-tracking/`.
|
|
130
138
|
|
|
131
|
-
To publish to PyPI, either publish a GitHub Release for the tag or manually run the workflow with `target` set to `pypi`.
|
|
139
|
+
To publish to PyPI, either publish a GitHub Release for the tag or manually run the workflow with `target` set to `pypi`. The final project URL is `https://pypi.org/project/codex-usage-tracking/`.
|
|
132
140
|
|
|
133
|
-
PyPI and TestPyPI filenames and versions cannot be reused after upload. If a bad
|
|
141
|
+
PyPI and TestPyPI filenames and versions cannot be reused after upload. If a bad artifact is uploaded, cut the next patch version instead of trying to replace it.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
## Recommended Install
|
|
4
4
|
|
|
5
|
-
Use `pipx` so the tracker is installed as a command-line app without mixing dependencies into another project.
|
|
5
|
+
Use `pipx` so the tracker is installed from PyPI as a command-line app without mixing dependencies into another project.
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
8
|
python -m pip install --user pipx
|
|
@@ -20,12 +20,14 @@ Use the Python launcher that is normal for your platform:
|
|
|
20
20
|
|
|
21
21
|
If `codex-usage-tracker` is not found immediately after `ensurepath`, open a new terminal or add the printed pipx binary directory to `PATH`.
|
|
22
22
|
|
|
23
|
-
Package naming: the PyPI distribution is `codex-usage-tracking
|
|
23
|
+
Package naming: the public PyPI distribution is [`codex-usage-tracking`](https://pypi.org/project/codex-usage-tracking/); the installed command is `codex-usage-tracker`; the GitHub repository remains `douglasmonsky/codex-usage-tracker`. The `codex-usage-tracker` PyPI name is not this project, so avoid similarly named packages when following these docs.
|
|
24
24
|
|
|
25
25
|
`setup` installs or refreshes the package-owned plugin wrapper, including MCP tools and companion Codex skills, initializes local config templates when needed, refreshes the aggregate index, runs `doctor`, prints a success/failure summary, and tells you whether Codex needs a restart for plugin discovery.
|
|
26
26
|
|
|
27
27
|
Restart Codex after plugin registration if you want Codex to discover the MCP tools in a fresh session. The localhost dashboard can run immediately.
|
|
28
28
|
|
|
29
|
+
`serve-dashboard` and `open-dashboard` refresh active-session usage before opening by default. Add `--no-refresh` only when you intentionally want to inspect the cached local index without scanning logs first.
|
|
30
|
+
|
|
29
31
|
## Platform Support
|
|
30
32
|
|
|
31
33
|
The CLI, SQLite index, dashboard generator, and localhost server are Python-based and are not macOS-only. CI runs the package on Ubuntu with Python 3.10, 3.11, 3.12, and 3.13.
|
|
@@ -41,7 +43,7 @@ pipx upgrade codex-usage-tracking
|
|
|
41
43
|
codex-usage-tracker setup
|
|
42
44
|
```
|
|
43
45
|
|
|
44
|
-
For development or
|
|
46
|
+
For source installs used during development or branch testing, rerun the GitHub install with `--force`:
|
|
45
47
|
|
|
46
48
|
```bash
|
|
47
49
|
pipx install --force "git+https://github.com/douglasmonsky/codex-usage-tracker.git"
|
|
@@ -54,7 +56,7 @@ Open a Codex session on your machine and paste:
|
|
|
54
56
|
|
|
55
57
|
```text
|
|
56
58
|
Install and configure Codex Usage Tracker.
|
|
57
|
-
Install the PyPI distribution codex-usage-tracking with pipx. The installed command should be codex-usage-tracker.
|
|
59
|
+
Install the PyPI distribution codex-usage-tracking with pipx. The installed command should be codex-usage-tracker. Use pipx install "git+https://github.com/douglasmonsky/codex-usage-tracker.git" only for branch testing or if PyPI is temporarily unavailable.
|
|
58
60
|
If pipx is missing, install it with the platform's Python launcher or use a local virtual environment.
|
|
59
61
|
After installation, run codex-usage-tracker setup and serve-dashboard --open.
|
|
60
62
|
Verify the dashboard opens locally and tell me the dashboard URL plus whether I need to restart Codex for plugin discovery.
|
|
@@ -107,8 +109,8 @@ codex-usage-tracker install-plugin --python .venv/bin/python --force
|
|
|
107
109
|
Generate a static dashboard:
|
|
108
110
|
|
|
109
111
|
```bash
|
|
110
|
-
codex-usage-tracker dashboard --open
|
|
111
112
|
codex-usage-tracker open-dashboard
|
|
113
|
+
codex-usage-tracker open-dashboard --no-refresh
|
|
112
114
|
```
|
|
113
115
|
|
|
114
116
|
Serve the dashboard with live aggregate refresh and lazy context loading:
|
|
@@ -119,6 +121,9 @@ codex-usage-tracker serve-dashboard --no-context-api --open
|
|
|
119
121
|
```
|
|
120
122
|
|
|
121
123
|
The server binds to localhost, requires a per-server token for refresh/context endpoints, and rejects non-loopback `Host` or cross-origin `Origin` headers.
|
|
124
|
+
`--no-context-api` starts context loading off; the details panel can enable it later without restarting the server.
|
|
125
|
+
|
|
126
|
+
`open-dashboard` and `serve-dashboard` refresh active-session logs before opening by default. The lower-level `dashboard --open` command writes from the current SQLite index when you need a fully static file-generation step.
|
|
122
127
|
|
|
123
128
|
## Setup Checks
|
|
124
129
|
|
|
@@ -18,7 +18,9 @@ codex-usage-tracker install-plugin --python .venv/bin/python
|
|
|
18
18
|
|
|
19
19
|
Restart Codex after registration so it can discover the plugin.
|
|
20
20
|
|
|
21
|
-
Marketplace installs use the bundled MCP launcher at `skills/codex-usage-tracker/scripts/run_mcp.py`. On first MCP startup it creates a cached runtime under `~/.cache/codex-usage-tracker/mcp-runtime/` and installs the Python package from GitHub, so it does not require a `.venv` inside the plugin directory.
|
|
21
|
+
Marketplace installs use the bundled MCP launcher at `skills/codex-usage-tracker/scripts/run_mcp.py`. On first MCP startup it creates a cached runtime under `~/.cache/codex-usage-tracker/mcp-runtime/` and installs the Python package from a pinned GitHub source commit, so it does not require a `.venv` inside the plugin directory.
|
|
22
|
+
|
|
23
|
+
This is intentional: normal user installs come from the PyPI distribution `codex-usage-tracking`, while the plugin bootstrapper pins a reviewed repository commit so MCP startup does not accidentally track `main`.
|
|
22
24
|
|
|
23
25
|
The launcher stores the GitHub package spec used for that runtime and reinstalls when the bundled package pin changes. Set `CODEX_USAGE_TRACKER_PACKAGE_SPEC` to test a different Git ref or `CODEX_USAGE_TRACKER_RUNTIME_DIR` to use a separate cache while debugging plugin startup.
|
|
24
26
|
|
|
@@ -29,12 +29,14 @@ Those fields are not written to SQLite, CSV exports, generated dashboard HTML, o
|
|
|
29
29
|
|
|
30
30
|
`usage_call_context`, `codex-usage-tracker context`, and the `serve-dashboard` context endpoint read a single source JSONL file only when explicitly requested. Returned context is redacted for common secret patterns and capped in size.
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
Dashboard context loading can start off and then be enabled from the local details panel without restarting:
|
|
33
33
|
|
|
34
34
|
```bash
|
|
35
35
|
codex-usage-tracker serve-dashboard --no-context-api --open
|
|
36
36
|
```
|
|
37
37
|
|
|
38
|
+
The enable action is still token-protected, localhost-only, and does not load any context until you click a row-level context action.
|
|
39
|
+
|
|
38
40
|
For MCP users, `usage_call_context` is additionally disabled unless the MCP server process has this environment variable:
|
|
39
41
|
|
|
40
42
|
```bash
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "codex-usage-tracking"
|
|
7
|
-
version = "0.3.
|
|
7
|
+
version = "0.3.2"
|
|
8
8
|
description = "Unofficial local Codex plugin and dashboard for investigating aggregate token usage, costs, caching, and thread patterns."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.10"
|
|
@@ -17,7 +17,7 @@ The only exception is `usage_call_context`, which reads one selected record's lo
|
|
|
17
17
|
|
|
18
18
|
## First Steps
|
|
19
19
|
|
|
20
|
-
1. For "Open dashboard" or similar dashboard-open requests, do not inspect repository files, plugin manifests, tool registries, git status, or local logs first.
|
|
20
|
+
1. For "Open dashboard" or similar dashboard-open requests, do not inspect repository files, plugin manifests, tool registries, git status, or local logs first. Start the live localhost dashboard with `codex-usage-tracker serve-dashboard --context-api explicit --open` so Refresh and Live can use the local API, then report the localhost URL or a brief failure. Refresh is the default for dashboard launch commands; use `--no-refresh` only when the user explicitly asks for a cached snapshot. Use `codex-usage-tracker open-dashboard` only for explicit static/offline snapshots or when the environment cannot keep a long-running server process alive; if you fall back, say the dashboard is static and Live requires `serve-dashboard`.
|
|
21
21
|
2. For "Heaviest thread?", "Thread leaderboard", or similar thread-ranking requests, do not inspect repository files, SQLite schemas, plugin manifests, process lists, dashboard servers, or local logs manually. Refresh the aggregate index, then call `usage_summary(group_by="thread", limit=10, response_format="json")`. If MCP tools are unavailable, run `codex-usage-tracker refresh --json` and `codex-usage-tracker summary --group-by thread --limit 10 --json`.
|
|
22
22
|
3. For normal usage questions, do not inspect repository files, plugin manifests, or local logs first. Start with the aggregate MCP tools. If MCP tools are unavailable, use the CLI JSON fallback below.
|
|
23
23
|
4. Refresh before analysis with `refresh_usage_index` unless the user asks for a static historical snapshot. Keep archived sessions excluded unless the user explicitly asks for all history.
|
|
@@ -17,14 +17,14 @@ The only exception is `usage_call_context`, which intentionally reads one select
|
|
|
17
17
|
|
|
18
18
|
## Fast Paths
|
|
19
19
|
|
|
20
|
-
- For "Open dashboard" or similar dashboard-open requests, do not inspect repository files, plugin manifests, tool registries, git status, or local logs first.
|
|
20
|
+
- For "Open dashboard" or similar dashboard-open requests, do not inspect repository files, plugin manifests, tool registries, git status, or local logs first. Start the live localhost dashboard with `codex-usage-tracker serve-dashboard --context-api explicit --open` so Refresh, Live, load-limit, and history-scope controls can call the local API. Refresh is the default for dashboard launch commands; use `--no-refresh` only when the user explicitly asks for a cached snapshot. Keep the server running while the user is using the dashboard. Use `codex-usage-tracker open-dashboard` only when the user explicitly asks for a static/offline snapshot or when the current environment cannot keep a server process running, and say that the result is static and Live requires `serve-dashboard`.
|
|
21
21
|
- For "Heaviest thread?", "Thread leaderboard", or similar thread-ranking requests, do not inspect repository files, SQLite schemas, plugin manifests, process lists, dashboard servers, or local logs manually. Use the tracker API: refresh the aggregate index, then rank threads with `usage_summary(group_by="thread", limit=10, response_format="json")`.
|
|
22
22
|
- If MCP tools are unavailable for thread-ranking requests, run `codex-usage-tracker refresh --json` and `codex-usage-tracker summary --group-by thread --limit 10 --json`. The summary is already ordered by `total_tokens` descending.
|
|
23
23
|
- Answer thread-ranking requests directly from the summary rows. For the heaviest-thread question, lead with the first row's thread and total tokens; for leaderboard requests, show a compact ranked list.
|
|
24
|
-
- If the CLI command is missing for open
|
|
24
|
+
- If the CLI command is missing for dashboard-open requests and you are already inside the source checkout, use `PYTHONPATH=src .venv/bin/python -m codex_usage_tracker.cli serve-dashboard --context-api explicit --open`. Use the source-checkout `open-dashboard` fallback only for static/offline snapshots or when a long-running server cannot be kept alive.
|
|
25
25
|
- If the CLI command is missing for thread-ranking requests and you are already inside the source checkout, use `PYTHONPATH=src .venv/bin/python -m codex_usage_tracker.cli refresh --json` and `PYTHONPATH=src .venv/bin/python -m codex_usage_tracker.cli summary --group-by thread --limit 10 --json`.
|
|
26
26
|
- If neither command is available, say briefly that the tracker CLI is not on `PATH` and ask the user to run `codex-usage-tracker setup` or reinstall with `pipx`.
|
|
27
|
-
- Keep open
|
|
27
|
+
- Keep dashboard-open narration minimal: one short progress note if needed, then the localhost URL, or if falling back to a static file, the file path plus a note that Live requires `serve-dashboard`. Do not narrate plugin discovery.
|
|
28
28
|
|
|
29
29
|
## Common Workflows
|
|
30
30
|
|
|
@@ -15,9 +15,9 @@ from pathlib import Path
|
|
|
15
15
|
|
|
16
16
|
PACKAGE_SPEC = os.environ.get(
|
|
17
17
|
"CODEX_USAGE_TRACKER_PACKAGE_SPEC",
|
|
18
|
-
"git+https://github.com/douglasmonsky/codex-usage-tracker.git@
|
|
18
|
+
"git+https://github.com/douglasmonsky/codex-usage-tracker.git@262f51960747a3eb061602e92c929684f8490adb",
|
|
19
19
|
)
|
|
20
|
-
RUNTIME_VERSION = "0.3.
|
|
20
|
+
RUNTIME_VERSION = "0.3.2"
|
|
21
21
|
PACKAGE_SPEC_MARKER = ".codex-usage-tracker-package-spec"
|
|
22
22
|
MODULE_CHECK = (
|
|
23
23
|
"import importlib.metadata; "
|
|
@@ -394,8 +394,12 @@ def _add_dashboard_parsers(
|
|
|
394
394
|
)
|
|
395
395
|
open_dashboard.add_argument(
|
|
396
396
|
"--refresh",
|
|
397
|
-
action=
|
|
398
|
-
|
|
397
|
+
action=argparse.BooleanOptionalAction,
|
|
398
|
+
default=True,
|
|
399
|
+
help=(
|
|
400
|
+
"Refresh the SQLite index before generating the dashboard. "
|
|
401
|
+
"This is the default; use --no-refresh to open the cached index only."
|
|
402
|
+
),
|
|
399
403
|
)
|
|
400
404
|
open_dashboard.add_argument("--codex-home", type=Path, default=DEFAULT_CODEX_HOME)
|
|
401
405
|
open_dashboard.add_argument("--json", action="store_true", dest="as_json")
|
|
@@ -419,13 +423,17 @@ def _add_dashboard_parsers(
|
|
|
419
423
|
serve.add_argument(
|
|
420
424
|
"--no-context-api",
|
|
421
425
|
action="store_true",
|
|
422
|
-
help="
|
|
426
|
+
help="Start with dashboard context loading off; it can be enabled from the local dashboard.",
|
|
423
427
|
)
|
|
424
428
|
serve.add_argument("--open", action="store_true")
|
|
425
429
|
serve.add_argument(
|
|
426
430
|
"--refresh",
|
|
427
|
-
action=
|
|
428
|
-
|
|
431
|
+
action=argparse.BooleanOptionalAction,
|
|
432
|
+
default=True,
|
|
433
|
+
help=(
|
|
434
|
+
"Refresh the SQLite index before generating and serving the dashboard. "
|
|
435
|
+
"This is the default; use --no-refresh to serve the cached index only."
|
|
436
|
+
),
|
|
429
437
|
)
|
|
430
438
|
serve.add_argument("--codex-home", type=Path, default=DEFAULT_CODEX_HOME)
|
|
431
439
|
serve.add_argument("--include-archived", action="store_true")
|
|
@@ -875,6 +875,11 @@
|
|
|
875
875
|
cursor: pointer;
|
|
876
876
|
}
|
|
877
877
|
.context-button:hover { background: #eff6ff; }
|
|
878
|
+
.context-button:disabled {
|
|
879
|
+
cursor: not-allowed;
|
|
880
|
+
opacity: 0.62;
|
|
881
|
+
background: var(--panel);
|
|
882
|
+
}
|
|
878
883
|
.context-button.secondary { color: var(--muted); }
|
|
879
884
|
.context-result {
|
|
880
885
|
margin-top: 12px;
|
|
@@ -1345,17 +1345,24 @@
|
|
|
1345
1345
|
}
|
|
1346
1346
|
function contextControls(row) {
|
|
1347
1347
|
const fileMode = window.location.protocol === 'file:';
|
|
1348
|
-
const
|
|
1349
|
-
const
|
|
1348
|
+
const apiMissing = !apiToken;
|
|
1349
|
+
const apiDisabled = !contextApiEnabled;
|
|
1350
|
+
const disabled = fileMode || apiMissing || apiDisabled ? ' disabled' : '';
|
|
1350
1351
|
const hint = fileMode
|
|
1351
1352
|
? 'Open this dashboard with codex-usage-tracker serve-dashboard to load raw context on demand.'
|
|
1352
|
-
:
|
|
1353
|
-
? 'Context loading
|
|
1353
|
+
: apiMissing
|
|
1354
|
+
? 'Context loading requires a localhost dashboard API token.'
|
|
1355
|
+
: apiDisabled
|
|
1356
|
+
? 'Context loading is off for this dashboard server. Enable it here to load local JSONL context on demand.'
|
|
1354
1357
|
: 'Context is not embedded in this dashboard. Press a button to read this call from the local JSONL source.';
|
|
1358
|
+
const enableButton = !fileMode && !apiMissing && apiDisabled
|
|
1359
|
+
? '<button class="context-button" type="button" data-context-enable>Enable context loading</button>'
|
|
1360
|
+
: '';
|
|
1355
1361
|
return `
|
|
1356
1362
|
<div class="context-actions">
|
|
1357
1363
|
<button class="context-button" type="button" data-context-load${disabled}>Load context</button>
|
|
1358
1364
|
<button class="context-button secondary" type="button" data-context-load-output${disabled}>Include tool output</button>
|
|
1365
|
+
${enableButton}
|
|
1359
1366
|
</div>
|
|
1360
1367
|
<div id="contextResult" class="context-result"><p class="context-note">${escapeHtml(hint)}</p></div>
|
|
1361
1368
|
`;
|
|
@@ -1363,8 +1370,38 @@
|
|
|
1363
1370
|
function bindContextButtons(row) {
|
|
1364
1371
|
const loadButton = detailEl.querySelector('[data-context-load]');
|
|
1365
1372
|
const outputButton = detailEl.querySelector('[data-context-load-output]');
|
|
1373
|
+
const enableButton = detailEl.querySelector('[data-context-enable]');
|
|
1366
1374
|
if (loadButton) loadButton.addEventListener('click', () => loadContext(row, false));
|
|
1367
1375
|
if (outputButton) outputButton.addEventListener('click', () => loadContext(row, true));
|
|
1376
|
+
if (enableButton) enableButton.addEventListener('click', () => enableContextApi(row));
|
|
1377
|
+
}
|
|
1378
|
+
async function enableContextApi(row) {
|
|
1379
|
+
const target = document.getElementById('contextResult');
|
|
1380
|
+
if (!target) return;
|
|
1381
|
+
target.innerHTML = '<p class="context-note">Enabling context loading for this dashboard server...</p>';
|
|
1382
|
+
try {
|
|
1383
|
+
const params = new URLSearchParams({ enabled: '1', _: String(Date.now()) });
|
|
1384
|
+
const response = await fetch(`/api/context-settings?${params.toString()}`, {
|
|
1385
|
+
headers: {
|
|
1386
|
+
'Accept': 'application/json',
|
|
1387
|
+
'X-Codex-Usage-Token': apiToken,
|
|
1388
|
+
},
|
|
1389
|
+
cache: 'no-store',
|
|
1390
|
+
});
|
|
1391
|
+
if (!response.ok) {
|
|
1392
|
+
throw new Error(`Context settings returned HTTP ${response.status}.`);
|
|
1393
|
+
}
|
|
1394
|
+
const payload = await response.json();
|
|
1395
|
+
if (payload.error) throw new Error(payload.error);
|
|
1396
|
+
contextApiEnabled = Boolean(payload.context_api_enabled);
|
|
1397
|
+
showDetail(row);
|
|
1398
|
+
const nextTarget = document.getElementById('contextResult');
|
|
1399
|
+
if (nextTarget && contextApiEnabled) {
|
|
1400
|
+
nextTarget.innerHTML = '<p class="context-note">Context loading is enabled. Press Load context to read this call from the local JSONL source.</p>';
|
|
1401
|
+
}
|
|
1402
|
+
} catch (error) {
|
|
1403
|
+
target.innerHTML = `<p class="context-note">${escapeHtml(error.message || String(error))}</p>`;
|
|
1404
|
+
}
|
|
1368
1405
|
}
|
|
1369
1406
|
async function loadContext(row, includeToolOutput) {
|
|
1370
1407
|
const target = document.getElementById('contextResult');
|
|
@@ -86,8 +86,9 @@ codex-usage-tracker serve-dashboard --open</code></pre>
|
|
|
86
86
|
<p>To tune review thresholds locally, run <code>codex-usage-tracker init-thresholds</code> and edit <code>~/.codex-usage-tracker/thresholds.json</code>. These thresholds control low-cache, high-context, high-uncached-input, large-thread, reasoning-spike, low-output, and high-cost recommendations.</p>
|
|
87
87
|
<p>To tune project attribution locally, run <code>codex-usage-tracker init-projects</code> and edit <code>~/.codex-usage-tracker/projects.json</code>. The dashboard derives project name, relative cwd, branch, tags, and a hashed remote origin from aggregate <code>cwd</code> and local Git metadata when available.</p>
|
|
88
88
|
<p>Before sharing screenshots or generated artifacts, put <code>--privacy-mode redacted</code> or <code>--privacy-mode strict</code> before the subcommand, such as <code>codex-usage-tracker --privacy-mode strict serve-dashboard --open</code>. Redacted mode hides raw cwd/source paths, hides Git remote labels, and hashes unnamed projects while preserving configured aliases. Strict mode also hides project-relative cwd, Git branch, and tags. The dashboard header shows the active metadata mode.</p>
|
|
89
|
-
<p>
|
|
90
|
-
<p>The
|
|
89
|
+
<p><code>serve-dashboard</code> refreshes active-session logs before opening by default. Use <code>--no-refresh</code> only when you intentionally want a cached view of the existing local index.</p>
|
|
90
|
+
<p>The server enables live aggregate refresh and on-demand context loading. Static file mode can still filter, sort, and inspect aggregate fields. <code>open-dashboard</code> refreshes before writing the snapshot unless you pass <code>--no-refresh</code>. Static files cannot refresh logs or load context after opening.</p>
|
|
91
|
+
<p>The localhost server uses a random per-server token for refresh and context API calls, validates loopback <code>Host</code> and <code>Origin</code> headers, and can start with context loading off through <code>codex-usage-tracker serve-dashboard --no-context-api</code>.</p>
|
|
91
92
|
|
|
92
93
|
<h2>Insights View</h2>
|
|
93
94
|
<img src="assets/dashboard-insights.png" alt="Insights view with ranked attention cards, investigation presets, and top threads by attention score.">
|
|
@@ -121,7 +122,7 @@ codex-usage-tracker serve-dashboard --open</code></pre>
|
|
|
121
122
|
|
|
122
123
|
<h2>Details And Context</h2>
|
|
123
124
|
<img src="assets/dashboard-details.png" alt="Details panel showing aggregate usage fields for a selected call.">
|
|
124
|
-
<p>The details panel shows primary cost, Codex credits, allowance impact, cache, context, pricing, and next-action signals first. It then groups thread narrative, token/pricing breakdowns, credit confidence and rate-card source metadata, collapsed raw identifiers, and source metadata. When served from localhost with the context API enabled, <code>Load context</code> fetches one redacted, size-limited source excerpt on demand. When started with <code>--no-context-api</code>, context
|
|
125
|
+
<p>The details panel shows primary cost, Codex credits, allowance impact, cache, context, pricing, and next-action signals first. It then groups thread narrative, token/pricing breakdowns, credit confidence and rate-card source metadata, collapsed raw identifiers, and source metadata. When served from localhost with the context API enabled, <code>Load context</code> fetches one redacted, size-limited source excerpt on demand. When started with <code>--no-context-api</code>, context loading starts off; use <code>Enable context loading</code> in the details panel when you want to allow explicit row actions without restarting the dashboard server.</p>
|
|
125
126
|
|
|
126
127
|
<h2>Investigating Long Chat Growth</h2>
|
|
127
128
|
<p class="note">Prompt caching helps, but cached input is not free. Long-running chats can carry a large cached prefix into later turns, so usage can climb quickly even when the visible request looks small.</p>
|
|
@@ -17,7 +17,7 @@ The only exception is `usage_call_context`, which reads one selected record's lo
|
|
|
17
17
|
|
|
18
18
|
## First Steps
|
|
19
19
|
|
|
20
|
-
1. For "Open dashboard" or similar dashboard-open requests, do not inspect repository files, plugin manifests, tool registries, git status, or local logs first.
|
|
20
|
+
1. For "Open dashboard" or similar dashboard-open requests, do not inspect repository files, plugin manifests, tool registries, git status, or local logs first. Start the live localhost dashboard with `codex-usage-tracker serve-dashboard --context-api explicit --open` so Refresh and Live can use the local API, then report the localhost URL or a brief failure. Refresh is the default for dashboard launch commands; use `--no-refresh` only when the user explicitly asks for a cached snapshot. Use `codex-usage-tracker open-dashboard` only for explicit static/offline snapshots or when the environment cannot keep a long-running server process alive; if you fall back, say the dashboard is static and Live requires `serve-dashboard`.
|
|
21
21
|
2. For "Heaviest thread?", "Thread leaderboard", or similar thread-ranking requests, do not inspect repository files, SQLite schemas, plugin manifests, process lists, dashboard servers, or local logs manually. Refresh the aggregate index, then call `usage_summary(group_by="thread", limit=10, response_format="json")`. If MCP tools are unavailable, run `codex-usage-tracker refresh --json` and `codex-usage-tracker summary --group-by thread --limit 10 --json`.
|
|
22
22
|
3. For normal usage questions, do not inspect repository files, plugin manifests, or local logs first. Start with the aggregate MCP tools. If MCP tools are unavailable, use the CLI JSON fallback below.
|
|
23
23
|
4. Refresh before analysis with `refresh_usage_index` unless the user asks for a static historical snapshot. Keep archived sessions excluded unless the user explicitly asks for all history.
|