From 66a46d0f910b5d4991bf4f2b0110612819a45644 Mon Sep 17 00:00:00 2001 From: placey Date: Sun, 2 Aug 2026 16:42:10 -0700 Subject: [PATCH 1/5] Add Windows ARM installation support --- CONTRIBUTING.md | 27 ++- README.md | 51 +++-- meter.py | 101 +++++++--- page.html | 8 +- scripts/install-windows.ps1 | 341 ++++++++++++++++++++++++++++++++ scripts/run-token-meter-mcp.cmd | 9 + scripts/start-token-meter.ps1 | 125 ++++++++++++ scripts/uninstall-windows.ps1 | 54 +++++ scripts/update-windows.ps1 | 123 ++++++++++++ tests/test_meter.py | 113 ++++++++--- 10 files changed, 886 insertions(+), 66 deletions(-) create mode 100644 scripts/install-windows.ps1 create mode 100644 scripts/run-token-meter-mcp.cmd create mode 100644 scripts/start-token-meter.ps1 create mode 100644 scripts/uninstall-windows.ps1 create mode 100644 scripts/update-windows.ps1 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index db913a1..cc887b5 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -46,7 +46,17 @@ For the full macOS experience, run the installer from your checkout: ./scripts/install ``` -This starts the local server and menu bar companion. Open +On Windows, install with the per-user PowerShell workflow: + +```powershell +pwsh -NoProfile -File .\scripts\install-windows.ps1 +``` + +This stages the browser dashboard under `%LOCALAPPDATA%\Token Meter\runtime` +and registers automatic startup for the current user. The AppKit menu-bar +companion is macOS-only. + +The macOS installer starts the local server and menu bar companion. Open [http://localhost:8722](http://localhost:8722) and check its health with: ```bash @@ -54,7 +64,8 @@ curl http://127.0.0.1:8722/health ``` Rerun `./scripts/install` after source changes when you want to test the staged -runtime. For dashboard-only development, when port 8722 is free, run: +runtime; on Windows, rerun `install-windows.ps1`. For dashboard-only +development, when port 8722 is free, run: ```bash python3 meter.py @@ -104,6 +115,18 @@ node -e "const fs=require('fs'); const html=fs.readFileSync('page.html','utf8'); git diff --check ``` +On Windows, run the Python commands with the installed Python executable, parse +the PowerShell scripts, and exercise the Windows installer: + +```powershell +python -m py_compile meter.py token_meter_mcp.py +python -m unittest discover -s tests -v +node -e "const fs=require('fs'); const html=fs.readFileSync('page.html','utf8'); const m=html.match(/