cost-bubble 0.4.0 → 1.0.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 +15 -30
- package/install.sh +13 -40
- package/package.json +2 -2
- package/scripts/signed-release.json +2 -2
- package/scripts/unpack-release.sh +1 -1
- package/scripts/verify-release-app.sh +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Cost Bubble
|
|
2
2
|
|
|
3
|
-
**Live session cost and context monitoring for Codex, Claude Code, and Antigravity on macOS.**
|
|
3
|
+
**Live session cost and context monitoring for Codex, Claude Code, and Antigravity on macOS, Windows and Linux.**
|
|
4
4
|
|
|
5
5
|
Cost Bubble sits as a lightweight native floating pill right beside your AI coding app’s sidebar—keeping the open session’s estimated spend, context-window fill, and active background chats visible at a glance without breaking your flow.
|
|
6
6
|
|
|
@@ -14,19 +14,22 @@ Cost Bubble sits as a lightweight native floating pill right beside your AI codi
|
|
|
14
14
|
- **Input token gauge** — Four bars show the latest request’s input size. Their color changes at 50k, 100k, 200k and 300k tokens. Hover for a segmented cached/fresh context bar, headroom, and pricing-tier status. Purple dots underneath mark active subagents.
|
|
15
15
|
- **Instant cost breakdown** — Hover or click any price for 5-minute, hourly, daily, and lifetime spend, spend mix with cache-hit efficiency and estimated cache-miss overhead, a 1-hour stacked burn chart, top cost drivers with timestamps, and clickable Codex subagents.
|
|
16
16
|
- **Recent sessions on hover** — Hover the pill to compare recent chats, see today’s spend, sort by recent activity, daily cost or recency, or click any title to switch chats. Click outside or `×` to dismiss pinned popups.
|
|
17
|
-
- **Native & unobtrusive** — Built
|
|
17
|
+
- **Native & unobtrusive** — Built with native desktop integration. Drag or resize per app; stays quietly available on New Chat screens in Codex, Claude Code, and Antigravity while hiding on ordinary non-Code Claude chats.
|
|
18
18
|
|
|
19
19
|
---
|
|
20
20
|
|
|
21
21
|
## Install
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
Choose the download for your computer from the [latest release](https://github.com/anopows/cost-bubble/releases/latest).
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
| Platform | Install |
|
|
26
|
+
| --- | --- |
|
|
27
|
+
| macOS 14 or later, Intel or Apple Silicon | Open **Cost-Bubble-macOS.zip**, move **Cost Bubble.app** into Applications, then open it. The universal app is signed and notarized. |
|
|
28
|
+
| Windows 10/11, x64 or ARM64 | Run the **-setup.exe** for your system type. It installs for your Windows user. The installer is unsigned, so SmartScreen may ask you to confirm the publisher. |
|
|
29
|
+
| Ubuntu 24.04, amd64 or arm64 | Download the matching **.deb**. From its folder run `sudo apt install ./cost-bubble_1.0.0_amd64.deb` (use `arm64` on ARM). Open **Cost Bubble** from the applications menu. |
|
|
30
|
+
| Other compatible Linux distributions | Download the matching **.AppImage**, make it executable in file properties, then open it. |
|
|
28
31
|
|
|
29
|
-
|
|
32
|
+
On macOS, `npx cost-bubble@latest install` also installs the app and enables it at login. Use that command to upgrade an existing npm installation. On Linux, the floating HUD uses X11. Wayland desktops with AppIndicator support show spend in the tray.
|
|
30
33
|
|
|
31
34
|
### Enable Accessibility
|
|
32
35
|
|
|
@@ -55,16 +58,18 @@ Cost Bubble uses macOS Accessibility to detect the active chat, align beside the
|
|
|
55
58
|
## How Estimates Work
|
|
56
59
|
|
|
57
60
|
- **Direct local pricing:** Reads your local session logs directly and prices token usage against [LiteLLM](https://github.com/BerriAI/litellm)’s public pricing catalog (refreshed daily to a local cache, with a bundled offline fallback). A **`—`** means pricing is unavailable; sessions with incomplete pricing show the sum of their priced requests. Estimates may differ from subscription invoices or API bills.
|
|
61
|
+
- **Fast requests:** Codex uses the recorded response tier when available and falls back to the chat’s recorded speed. Fast, priority and Ultrafast estimates include the applicable cache and long-context rates. Claude uses the speed recorded on each response. A recognized premium tier without a known price is shown as unpriced. Antigravity estimates use the recorded model and tokens; its workflow mode alone does not establish a billing tier.
|
|
58
62
|
- **Input token bars:** Mint, cyan, yellow, orange and red mark progressively larger input sizes including cached input. Hover for the exact token count and the context-window share when recorded.
|
|
59
63
|
- **Subagents & auto-reviewers:** Up to four purple dots underneath the signal bars indicate ordinary subagents. Automatic reviewers are separated into their own row in the cost breakdown and included in totals when priced.
|
|
60
64
|
- **Per-request vs. per-turn rates:** Latest, average, and peak figures measure individual requests in Codex and Antigravity, or turns in Claude Code. If a refresh fails, the pill retains its last successful reading and continues aging spend out of the 5-minute window.
|
|
61
|
-
- **Local-only readers:**
|
|
65
|
+
- **Local-only readers:** The Rust readers normalize each app’s local storage and cache parsed usage. Custom `CODEX_HOME` and `CLAUDE_CONFIG_DIR` paths are preserved at install time.
|
|
62
66
|
|
|
63
67
|
---
|
|
64
68
|
|
|
65
69
|
## Update & Uninstall
|
|
66
70
|
|
|
67
|
-
- **
|
|
71
|
+
- **Windows and Linux:** Install the latest matching package to update. Use Installed Apps on Windows, your package manager for the Debian package, or remove the downloaded AppImage.
|
|
72
|
+
- **macOS update with npm:** Re-run `npx cost-bubble@latest install`.
|
|
68
73
|
- **Quit temporarily:** Click the menu bar gauge icon and choose **Quit Cost Bubble**.
|
|
69
74
|
- **Uninstall:** Unload the login agent, move the items below to the Trash, and optionally remove **Cost Bubble** from Accessibility Settings.
|
|
70
75
|
|
|
@@ -80,26 +85,6 @@ launchctl bootout "gui/$(id -u)/io.github.anopows.cost-bubble"
|
|
|
80
85
|
|
|
81
86
|
## Development
|
|
82
87
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
```sh
|
|
86
|
-
# Install from a local checkout
|
|
87
|
-
./install.sh
|
|
88
|
-
|
|
89
|
-
# Build without installing and verify the bundled reader loads
|
|
90
|
-
./build.sh "/absolute/path/Cost Bubble.app"
|
|
91
|
-
"/absolute/path/Cost Bubble.app/Contents/MacOS/SessionHUD" --check-bundle
|
|
92
|
-
|
|
93
|
-
# Run session-reader unit tests
|
|
94
|
-
PYTHONPATH=Sources/Readers python3 -B -m unittest discover -s Tests/Readers -v
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
If a local rebuild stops recognizing chats while Accessibility is enabled, remove and re-add `~/Applications/Cost Bubble.app` in Accessibility Settings, then restart the helper if needed:
|
|
98
|
-
|
|
99
|
-
```sh
|
|
100
|
-
launchctl kickstart -k "gui/$(id -u)/io.github.anopows.cost-bubble"
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
See [Publishing a signed macOS release](docs/signed-releases.md) for signing, notarization, npm packaging, and upgrade verification.
|
|
88
|
+
See the [cross-platform build and test instructions](v1/README.md) and [macOS signing instructions](docs/signed-releases.md).
|
|
104
89
|
|
|
105
90
|
Released under the [MIT License](LICENSE).
|
package/install.sh
CHANGED
|
@@ -17,28 +17,6 @@ case "${1:-}" in
|
|
|
17
17
|
--signed|"") ;;
|
|
18
18
|
*) echo "Usage: ./install.sh" >&2; exit 1 ;;
|
|
19
19
|
esac
|
|
20
|
-
if [[ "${1:-}" != "--signed" ]] && ! xcrun --find swiftc >/dev/null 2>&1; then
|
|
21
|
-
echo "Building from source requires Apple's Command Line Tools (xcode-select --install)." >&2
|
|
22
|
-
exit 1
|
|
23
|
-
fi
|
|
24
|
-
python=""
|
|
25
|
-
clt_installed=0
|
|
26
|
-
if xcode-select -p >/dev/null 2>&1; then clt_installed=1; fi
|
|
27
|
-
for candidate in "${PYTHON_BIN:-}" /opt/homebrew/bin/python3 /usr/local/bin/python3 "$(command -v python3 || true)" /usr/bin/python3; do
|
|
28
|
-
if [[ "$candidate" == "/usr/bin/python3" && "$clt_installed" -eq 0 ]]; then continue; fi
|
|
29
|
-
if [[ "$candidate" == /* && -x "$candidate" ]]; then
|
|
30
|
-
resolved="$("$candidate" -c 'import plistlib, sqlite3, sys; assert sys.version_info >= (3, 8); print(sys.executable)' 2>/dev/null || true)"
|
|
31
|
-
if [[ "$resolved" == /* && -x "$resolved" ]]; then
|
|
32
|
-
python="$resolved"
|
|
33
|
-
break
|
|
34
|
-
fi
|
|
35
|
-
fi
|
|
36
|
-
done
|
|
37
|
-
if [[ -z "$python" ]]; then
|
|
38
|
-
echo "Python 3.8+ with sqlite3 is required (install via Homebrew or xcode-select --install), then run this installer again." >&2
|
|
39
|
-
exit 1
|
|
40
|
-
fi
|
|
41
|
-
export PYTHON_BIN="$python"
|
|
42
20
|
if [[ -e "$app" ]] && [[ "$(/usr/libexec/PlistBuddy -c 'Print :CFBundleIdentifier' "$app/Contents/Info.plist" 2>/dev/null || true)" != "$label" ]]; then
|
|
43
21
|
echo "An unrelated app already exists at $app. Choose a different location for it first." >&2
|
|
44
22
|
exit 1
|
|
@@ -86,24 +64,19 @@ if [[ "${1:-}" == "--signed" ]]; then
|
|
|
86
64
|
else
|
|
87
65
|
./build.sh "$stage/$name.app"
|
|
88
66
|
fi
|
|
89
|
-
|
|
90
|
-
"$
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
with open(destination, "wb") as stream:
|
|
103
|
-
plistlib.dump({"Label": label, "ProgramArguments": [str(Path(app) / "Contents/MacOS/SessionHUD")],
|
|
104
|
-
"EnvironmentVariables": env, "RunAtLoad": True, "LimitLoadToSessionType": "Aqua",
|
|
105
|
-
"KeepAlive": {"SuccessfulExit": False}}, stream)
|
|
106
|
-
PY
|
|
67
|
+
/usr/bin/plutil -create xml1 "$stage/agent.plist"
|
|
68
|
+
/usr/bin/plutil -insert Label -string "$label" "$stage/agent.plist"
|
|
69
|
+
/usr/bin/plutil -insert ProgramArguments -json '[]' "$stage/agent.plist"
|
|
70
|
+
/usr/bin/plutil -insert ProgramArguments.0 -string "$app/Contents/MacOS/cost-bubble" "$stage/agent.plist"
|
|
71
|
+
/usr/bin/plutil -insert RunAtLoad -bool YES "$stage/agent.plist"
|
|
72
|
+
/usr/bin/plutil -insert LimitLoadToSessionType -string Aqua "$stage/agent.plist"
|
|
73
|
+
/usr/bin/plutil -insert KeepAlive -json '{"SuccessfulExit":false}' "$stage/agent.plist"
|
|
74
|
+
/usr/bin/plutil -insert EnvironmentVariables -json '{}' "$stage/agent.plist"
|
|
75
|
+
for key in CODEX_HOME CLAUDE_CONFIG_DIR; do
|
|
76
|
+
if [[ -n "${!key:-}" ]]; then
|
|
77
|
+
/usr/bin/plutil -insert "EnvironmentVariables.$key" -string "${!key}" "$stage/agent.plist"
|
|
78
|
+
fi
|
|
79
|
+
done
|
|
107
80
|
plutil -lint "$stage/agent.plist"
|
|
108
81
|
if launchctl print "$job" >/dev/null 2>&1; then
|
|
109
82
|
launchctl bootout "$job"
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cost-bubble",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "macOS installer for the Cost Bubble cross-platform desktop HUD.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -12,4 +12,4 @@ actual=$(/usr/bin/shasum -a 256 "$archive")
|
|
|
12
12
|
app="$destination/Cost Bubble.app"
|
|
13
13
|
"$(dirname "$0")/verify-release-app.sh" "$app" "$team" "$version"
|
|
14
14
|
/usr/sbin/spctl --assess --type execute "$app"
|
|
15
|
-
"$app/Contents/MacOS/
|
|
15
|
+
"$app/Contents/MacOS/cost-bubble" --check-bundle
|
|
@@ -10,7 +10,7 @@ requirement="identifier \"io.github.anopows.cost-bubble\" and anchor apple gener
|
|
|
10
10
|
[[ "$(/usr/libexec/PlistBuddy -c 'Print :CFBundleShortVersionString' "$app/Contents/Info.plist")" == "$version" ]] || {
|
|
11
11
|
echo "The signed app does not match the requested release version." >&2; exit 1;
|
|
12
12
|
}
|
|
13
|
-
arch_info=$(/usr/bin/file -b "$app/Contents/MacOS/
|
|
13
|
+
arch_info=$(/usr/bin/file -b "$app/Contents/MacOS/cost-bubble")
|
|
14
14
|
[[ "$arch_info" == *"(for architecture arm64):"* && "$arch_info" == *"(for architecture x86_64):"* ]] || {
|
|
15
15
|
echo "The signed app is not a universal arm64/x86_64 binary." >&2; exit 1;
|
|
16
16
|
}
|