modelstat 0.1.2 → 0.2.0
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.
- package/README.md +10 -10
- package/dist/cli.mjs +168 -104
- package/dist/cli.mjs.map +1 -1
- package/package.json +7 -7
- package/scripts/postinstall.mjs +7 -7
- package/vendor/ModelstatTray.app/Contents/MacOS/modelstat-tray +0 -0
- package/vendor/tray-mac/Package.swift +1 -1
- package/vendor/tray-mac/Sources/ModelstatTray/main.swift +8 -8
package/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# modelstat
|
|
2
2
|
|
|
3
|
-
> **See every AI token your team spends.** Local
|
|
3
|
+
> **See every AI token your team spends.** Local daemon for [modelstat](https://modelstat.ai) — reads the session logs your AI coding tools already write (Claude Code, Codex, Cursor, Cline, Continue, Aider, Windsurf, Zed, Copilot, Claude Desktop), tokenises events on-device, and uploads only metadata to your modelstat dashboard.
|
|
4
4
|
|
|
5
|
-
**Your prompts never leave your machine.** The
|
|
5
|
+
**Your prompts never leave your machine.** The daemon uploads only token counts, model ids, timestamps, and a provider-assigned session id. Source is auditable on [GitHub](https://github.com/modelstat/modelstat/tree/main/apps/daemon).
|
|
6
6
|
|
|
7
7
|
## Install
|
|
8
8
|
|
|
@@ -19,7 +19,7 @@ bunx modelstat@latest
|
|
|
19
19
|
pnpm dlx modelstat@latest
|
|
20
20
|
```
|
|
21
21
|
|
|
22
|
-
The first run downloads the on-device summariser model (~2.7 GB Qwen3.5-4B GGUF to `~/.modelstat/models/`), pairs the device, and installs a **launchd user
|
|
22
|
+
The first run downloads the on-device summariser model (~2.7 GB Qwen3.5-4B GGUF to `~/.modelstat/models/`), pairs the device, and installs a **launchd user daemon** on macOS (at `~/Library/LaunchAgents/ai.modelstat.daemon.plist`) or a **systemd user unit** on Linux (at `~/.config/systemd/user/modelstat.service`). The daemon starts automatically on login and watches your AI-tool session logs in the background. The CLI exits cleanly — there's no foreground process to keep open.
|
|
23
23
|
|
|
24
24
|
Requires Node 20+. macOS and Linux (x86_64, arm64) supported.
|
|
25
25
|
|
|
@@ -51,11 +51,11 @@ Emits one NDJSON event per line, so a wrapper can drive pairing non-interactivel
|
|
|
51
51
|
|
|
52
52
|
## Shared state across install methods
|
|
53
53
|
|
|
54
|
-
Installing via both Homebrew and npm on the same laptop produces the **same binary reading the same state file** — on macOS that's `~/Library/Preferences/modelstat-
|
|
54
|
+
Installing via both Homebrew and npm on the same laptop produces the **same binary reading the same state file** — on macOS that's `~/Library/Preferences/modelstat-daemon-nodejs/config.json`. Your device UUID, bearer token, and pairing state persist across install methods — and the service deduplicates the device server-side, so you won't see the same laptop twice in the dashboard.
|
|
55
55
|
|
|
56
56
|
## MCP server
|
|
57
57
|
|
|
58
|
-
Pair the
|
|
58
|
+
Pair the daemon, then install [`@modelstat/mcp`](https://www.npmjs.com/package/@modelstat/mcp) to query your own spend from inside Claude Desktop, Cursor, Cline, Continue, or Zed:
|
|
59
59
|
|
|
60
60
|
```bash
|
|
61
61
|
# Claude Code
|
|
@@ -66,18 +66,18 @@ Full wire-up docs per client: https://modelstat.ai/mcp
|
|
|
66
66
|
|
|
67
67
|
## Self-host
|
|
68
68
|
|
|
69
|
-
To point the
|
|
69
|
+
To point the daemon at your own modelstat API (not the hosted SaaS):
|
|
70
70
|
|
|
71
71
|
```bash
|
|
72
|
-
export
|
|
72
|
+
export DAEMON_API_URL=https://your-modelstat-api.example.com
|
|
73
73
|
npx modelstat@latest
|
|
74
74
|
```
|
|
75
75
|
|
|
76
|
-
`
|
|
76
|
+
`DAEMON_API_URL` can also be set persistently via `.env` or in the systemd/launchd unit.
|
|
77
77
|
|
|
78
78
|
## Privacy
|
|
79
79
|
|
|
80
|
-
-
|
|
80
|
+
- Daemon reads local session logs written by the tools you use. Nothing is intercepted — the tools already write these files.
|
|
81
81
|
- Upload payload: token counts, model name, timestamps, provider-assigned session id, git remote URL (redactable), redacted work-type summary.
|
|
82
82
|
- Never uploaded: prompt text, model responses, file contents, tool-call arguments, environment variables, SSH keys, secrets.
|
|
83
83
|
- Redaction is on-device via [`@modelstat/parsers`](https://github.com/modelstat/modelstat/tree/main/packages/parsers).
|
|
@@ -91,4 +91,4 @@ npx modelstat@latest
|
|
|
91
91
|
|
|
92
92
|
## License
|
|
93
93
|
|
|
94
|
-
Apache-2.0. Source at https://github.com/modelstat/modelstat/tree/main/apps/
|
|
94
|
+
Apache-2.0. Source at https://github.com/modelstat/modelstat/tree/main/apps/daemon.
|