@superbased/observer 1.27.0 → 1.28.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 +77 -0
- package/README.template.md +18 -0
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -38,6 +38,7 @@ the full two-plane explainer.
|
|
|
38
38
|
|
|
39
39
|
- [Install](#install)
|
|
40
40
|
- [Five-minute quickstart](#five-minute-quickstart)
|
|
41
|
+
- [Zero-setup cost report: `observer usage`](#zero-setup-cost-report-observer-usage)
|
|
41
42
|
- [Two planes, one binary](#two-planes-one-binary)
|
|
42
43
|
- [Per-AI-client setup](#per-ai-client-setup)
|
|
43
44
|
- [Architecture in detail](#architecture-in-detail)
|
|
@@ -103,6 +104,23 @@ the [main repo](https://github.com/superbasedapp/observer).
|
|
|
103
104
|
|
|
104
105
|
## Five-minute quickstart
|
|
105
106
|
|
|
107
|
+
**No install at all, just a cost table:**
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
npx @superbased/observer # a 30-day cost table, right now
|
|
111
|
+
npx @superbased/observer usage # the explicit, same-thing form
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
On a fresh machine with no SuperBased state yet, bare `npx
|
|
115
|
+
@superbased/observer` scans each detected AI tool's own local session
|
|
116
|
+
files into a throwaway temp database, prints one tool × model cost
|
|
117
|
+
table, and deletes the database again — no daemon, no config written,
|
|
118
|
+
no network call. See [Zero-setup cost report](#zero-setup-cost-report-observer-usage)
|
|
119
|
+
below for what it does and doesn't do.
|
|
120
|
+
|
|
121
|
+
**For the full local tool** — proxy-accurate tokens, live dashboard,
|
|
122
|
+
conversation compression, cache tracking:
|
|
123
|
+
|
|
106
124
|
```bash
|
|
107
125
|
# 1) Install.
|
|
108
126
|
npm install -g @superbased/observer
|
|
@@ -143,6 +161,65 @@ MCP and codex routing are explicit-only because both write per-client
|
|
|
143
161
|
config files. Hooks self-heal on every `start`.
|
|
144
162
|
|
|
145
163
|
|
|
164
|
+
## Zero-setup cost report: `observer usage`
|
|
165
|
+
|
|
166
|
+
Before `observer start` and the daemon, there's a one-shot path for
|
|
167
|
+
"how much have I spent so far": `observer usage` reads each detected
|
|
168
|
+
AI tool's own local session files (JSONL / SQLite — the same files
|
|
169
|
+
the watcher normally tails), rolls up the last 30 days into one
|
|
170
|
+
tool × model cost table, and prints it. Everything it reads goes into
|
|
171
|
+
a throwaway database in a temp directory (foreign-mount adapter
|
|
172
|
+
mirrors — e.g. WSL reading a Windows-side tool store — land there too),
|
|
173
|
+
deleted again when the command exits — it never creates or touches
|
|
174
|
+
`~/.observer`, never writes any AI tool's config, and never opens a
|
|
175
|
+
socket. Pricing is embedded in the binary (the same rate sheet the
|
|
176
|
+
dashboard's Cost tab uses), so the whole run makes zero network calls.
|
|
177
|
+
|
|
178
|
+
On a fresh machine with no SuperBased state yet — no
|
|
179
|
+
`~/.observer/observer.db` and no `~/.observer/config.toml` — running
|
|
180
|
+
bare `observer` with no arguments runs this same report instead of the
|
|
181
|
+
usual welcome screen. Set `OBSERVER_ONESHOT=off` to always get the
|
|
182
|
+
welcome screen instead; a default-config daemon can't run without
|
|
183
|
+
first creating one of those two files, so there's no separate "is a
|
|
184
|
+
daemon listening" check — no port probe, no network activity at all.
|
|
185
|
+
Once either file exists on the machine, the fallthrough stops firing
|
|
186
|
+
on its own and bare `observer` goes back to the welcome screen —
|
|
187
|
+
`observer usage` stays available as an explicit command regardless.
|
|
188
|
+
|
|
189
|
+
The report is honest about its own limits: reliability is **log
|
|
190
|
+
tier** — parsed from each tool's own self-reported counts, not the
|
|
191
|
+
wire-accurate numbers the proxy captures — and every dollar figure is
|
|
192
|
+
labeled `estimated list price, not invoiced`. When it's ready for
|
|
193
|
+
more, `observer start` is the next step: it keeps the proxy, the
|
|
194
|
+
watcher, and the dashboard running so cost, cache, and compression
|
|
195
|
+
numbers stay current instead of being recomputed from scratch on
|
|
196
|
+
every invocation.
|
|
197
|
+
|
|
198
|
+
Flags: `--since` (`7d`/`30d`/`90d`/`all`/an RFC3339 timestamp, default
|
|
199
|
+
`30d`), `--group-by` (`tool-model`/`tool`/`model`/`day`), `--tool`,
|
|
200
|
+
`--budget` (wall-clock cap on the scan only, default `30s`, `0` =
|
|
201
|
+
unlimited — on expiry the table still prints with a `partial:`
|
|
202
|
+
footer), `--json`, and `--keep-db <path>` to keep the scratch database
|
|
203
|
+
instead of deleting it. See `observer usage --help` for the full
|
|
204
|
+
reference.
|
|
205
|
+
|
|
206
|
+
## A wordmarked one-line status: `observer statusline`
|
|
207
|
+
|
|
208
|
+
For an always-on glance instead of an on-demand report, `observer
|
|
209
|
+
statusline` prints exactly one line — a short `▞ superbased` wordmark plus
|
|
210
|
+
(when the data is available that invocation) the current session's
|
|
211
|
+
cost, today's total observed spend, and the active model name — sized
|
|
212
|
+
for a terminal prompt (Claude Code's `statusLine` contract) or any host
|
|
213
|
+
tool that execs a command and reads its stdout. It's fail-open by
|
|
214
|
+
design: with no daemon running it degrades to the wordmark alone (and
|
|
215
|
+
makes no network call of any kind to find that out), and with a daemon
|
|
216
|
+
running the only network-shaped call it makes is a bounded loopback
|
|
217
|
+
request to that same-machine daemon. Every dollar figure is an
|
|
218
|
+
estimated list-price total, not an invoiced amount. Registration is
|
|
219
|
+
opt-in (`observer init --statusline`) — never automatic. See
|
|
220
|
+
[`docs/observer-statusline.md`](https://github.com/superbasedapp/observer/blob/main/docs/observer-statusline.md)
|
|
221
|
+
for the full reference.
|
|
222
|
+
|
|
146
223
|
## Two planes, one binary
|
|
147
224
|
|
|
148
225
|
Everything below this line — proxy routing, per-client capture,
|
package/README.template.md
CHANGED
|
@@ -38,6 +38,7 @@ the full two-plane explainer.
|
|
|
38
38
|
|
|
39
39
|
- [Install](#install)
|
|
40
40
|
- [Five-minute quickstart](#five-minute-quickstart)
|
|
41
|
+
- [Zero-setup cost report: `observer usage`](#zero-setup-cost-report-observer-usage)
|
|
41
42
|
- [Two planes, one binary](#two-planes-one-binary)
|
|
42
43
|
- [Per-AI-client setup](#per-ai-client-setup)
|
|
43
44
|
- [Architecture in detail](#architecture-in-detail)
|
|
@@ -103,6 +104,23 @@ the [main repo](https://github.com/superbasedapp/observer).
|
|
|
103
104
|
|
|
104
105
|
## Five-minute quickstart
|
|
105
106
|
|
|
107
|
+
**No install at all, just a cost table:**
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
npx @superbased/observer # a 30-day cost table, right now
|
|
111
|
+
npx @superbased/observer usage # the explicit, same-thing form
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
On a fresh machine with no SuperBased state yet, bare `npx
|
|
115
|
+
@superbased/observer` scans each detected AI tool's own local session
|
|
116
|
+
files into a throwaway temp database, prints one tool × model cost
|
|
117
|
+
table, and deletes the database again — no daemon, no config written,
|
|
118
|
+
no network call. See [Zero-setup cost report](#zero-setup-cost-report-observer-usage)
|
|
119
|
+
below for what it does and doesn't do.
|
|
120
|
+
|
|
121
|
+
**For the full local tool** — proxy-accurate tokens, live dashboard,
|
|
122
|
+
conversation compression, cache tracking:
|
|
123
|
+
|
|
106
124
|
```bash
|
|
107
125
|
# 1) Install.
|
|
108
126
|
npm install -g @superbased/observer
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@superbased/observer",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.28.0",
|
|
4
4
|
"description": "Claude Code cost tracking, Cursor token usage, Codex spend — AI coding agent observability across 29 adapters, proxy-accurate token counts and cost.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai",
|
|
@@ -42,11 +42,11 @@
|
|
|
42
42
|
"LICENSE"
|
|
43
43
|
],
|
|
44
44
|
"optionalDependencies": {
|
|
45
|
-
"@superbased/observer-linux-x64": "1.
|
|
46
|
-
"@superbased/observer-linux-arm64": "1.
|
|
47
|
-
"@superbased/observer-darwin-x64": "1.
|
|
48
|
-
"@superbased/observer-darwin-arm64": "1.
|
|
49
|
-
"@superbased/observer-win32-x64": "1.
|
|
45
|
+
"@superbased/observer-linux-x64": "1.28.0",
|
|
46
|
+
"@superbased/observer-linux-arm64": "1.28.0",
|
|
47
|
+
"@superbased/observer-darwin-x64": "1.28.0",
|
|
48
|
+
"@superbased/observer-darwin-arm64": "1.28.0",
|
|
49
|
+
"@superbased/observer-win32-x64": "1.28.0"
|
|
50
50
|
},
|
|
51
51
|
"scripts": {
|
|
52
52
|
"test": "node bin/observer.js --version"
|