agy-bar 1.0.1 → 1.1.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/CHANGELOG.md CHANGED
@@ -2,6 +2,24 @@
2
2
 
3
3
  All notable changes to **agy-bar** are documented here.
4
4
 
5
+ ## [1.1.0] - 2026-11-27
6
+
7
+ ### Added
8
+ - **Cross-Platform Browser-Free Multi-Account Vault & Passive Quota CLI (`src/keyring.mjs`, `src/account-store.mjs`, `src/account-quota.mjs`, `bin/agy-bar.mjs`)**:
9
+ - Added opt-in `agy-bar account` (`save`, `add`, `import`, `ls`, `use`, `next`, `rename`, `rm`, `backup`, `restore`) and `agy-bar switch` commands with zero third-party dependencies and zero private API calls (untouched unless invoked).
10
+ - **Native OS Credential Bridges on macOS, Linux, and Windows**: macOS Keychain via `/usr/bin/security -i` stdin `-X <hex>` (zero secret exposure in `ps` argv; preserves existing Keychain ACL on `-U` updates), Linux Secret Service via `secret-tool` stdin (auto-falling back to `0600` local file on headless/SSH machines), and Windows Credential Manager via zero-dependency PowerShell P/Invoke (`advapi32.dll`, stdin JSON, UTF-8/UTF-16LE read support), mirrored atomically with `~/.gemini/jetski-standalone-oauth-token` (`0600`).
11
+ - **Multi-Terminal Concurrency Protection**: Cross-platform atomic lockfile with dead-PID/stale recovery, `refresh_token` / JWT `sub` / `emailHash` identity matching across hourly `access_token` refreshes (including `go-keyring-base64:` decoding), pre-switch refresh writeback, atomic rollback on write failure, and a zero-overhead `agy-bar run` drift guard that saves refreshed tokens from background terminals without ever clobbering manual untracked logins.
12
+ - **Cockpit Tools & JSON Importer (`src/account-import.mjs`)**: One-command `agy-bar account import` discovers Cockpit Tools (`~/.cockpit_tools` / `~/.antigravity_cockpit`) or exported JSON files, decrypts Cockpit Tools' local AES-256-GCM envelopes using Node.js `node:crypto`, seeds passive 5h/7d quota snapshots & `[ULTRA]`/`[PRO]`/`[FREE]` tiers, and passively links the currently active `agy` login.
13
+ - **Per-Account Passive Quota Cache & Smart Selector (`src/quota-sync.mjs`, `src/account-quota.mjs`)**: Backward-compatible `v2` `quota-cache.json` preserves per-account 5h/7d buckets across switches (14-day retention), computes `READY` / `LOW` / `LIMITED` / `UNKNOWN` with reset-due auto-promotion and weekly-cap blocking, supports `agy-bar switch next --family gemini|claude|auto`, interactive arrow-key terminal picker, zero-secret `--json` projection, and `scrypt + AES-256-GCM` encrypted vault backup/restore.
14
+ - **Lossless Context Handoff & Auto-Resume Guard (`src/handoff.mjs`, `src/proxy.mjs`, `src/render.mjs`, `src/config.mjs`)**:
15
+ - `agy-bar switch ... --handoff` and `agy-bar handoff [--print]` assemble a compact redacted handoff prompt combining active `brain/<id>/*.md` plan/task artifacts, `git log -n 3`, `git status` / `diff --stat`, in-flight file list, and recent redacted `transcript.jsonl` turns, launching fresh `agy -i` through the no-TUN proxy.
16
+ - **Statusline `SWAP→<alias>` Hint (`swapHint`, default `on`)**: Automatically highlights the best `READY` backup account next to `0%` quota bars whenever the active model family hits `LIMITED`.
17
+ - **Pre-Launch Auto-Switch (`autoSwitchOnLimit` / `--auto-switch`) & Exit-and-Resume Guard (`autoHandoff` / `--auto-handoff`)**: Optionally skips `LIMITED` accounts before launching `agy`, and upon `/exit` after hitting a model family limit, automatically writes back, switches to the next `READY` account, builds the deep handoff prompt, and resumes `agy -i` in-place (preserving `--model`/`--effort` flags and skipping `-p`/`--print` mode).
18
+
19
+ ### Fixed
20
+ - **Interactive `ask_question` Waiting State (`src/step-timing.mjs`, `src/agent-state.mjs`, `src/statusline.mjs`, `src/title.mjs`, `src/telemetry.mjs`)**:
21
+ - When Antigravity CLI pauses on an `ask_question` prompt while still reporting `agent_state: "working"`, `agy-bar` now detects numeric `steps.status = 9` (`WAITING`, indexed read-only lookup, zero chat text read), lighting up `?` in the terminal tab title, `INPUT` on statusline Line 1, and `input` in `agy-bar monitor`, and immediately reverting once answered.
22
+
5
23
  ## [1.0.1] - 2026-11-27
6
24
 
7
25
  ### Fixed & Improved
package/README.md CHANGED
@@ -2,9 +2,9 @@
2
2
 
3
3
  # agy-bar
4
4
 
5
- **Zero-dependency statusline, no-TUN proxy launcher, 52-week token heatmap & multi-CLI HUD for Antigravity CLI (`agy`)**
5
+ **Zero-dependency statusline HUD, native 6-state tab titles, no-TUN local proxy launcher, 52-week token heatmap & multi-CLI monitor for Antigravity CLI (`agy`)**
6
6
 
7
- **English** | [简体中文](./README.zh-CN.md)
7
+ **English** | [简体中文](./README.zh-CN.md) | [AI Agent Install Guide (`AGENTS.md`)](./AGENTS.md) | [Machine-Readable Index (`llms.txt`)](./llms.txt) | [LINUX DO](https://linux.do)
8
8
 
9
9
  [![CI](https://github.com/xy-tuoren/agy-bar/actions/workflows/ci.yml/badge.svg)](https://github.com/xy-tuoren/agy-bar/actions/workflows/ci.yml)
10
10
  [![npm](https://img.shields.io/npm/v/agy-bar.svg)](https://www.npmjs.com/package/agy-bar)
@@ -15,97 +15,158 @@
15
15
 
16
16
  </div>
17
17
 
18
- ![agy-bar live Ghostty terminal screenshot](https://raw.githubusercontent.com/xy-tuoren/agy-bar/main/assets/live-statusline.png)
19
-
20
- <sub>Real Ghostty capture: 10 running subagents (displayed as `SUB 10` in v1.0+), live Git diff (`+14.3K -803`), no-TUN proxy (`PX 7897`), 1.01B cumulative tokens, 99% prompt cache TTL, TTFT & speed, live conversation spend, and 5h/7d quotas.</sub>
21
-
22
18
  ![agy-bar true-color statusline preview](https://raw.githubusercontent.com/xy-tuoren/agy-bar/main/assets/preview.svg)
23
19
 
24
20
  ```sh
25
- # Install in one command (Node.js >= 20, zero dependencies)
21
+ # Install in one command (Node.js >= 20, zero dependencies, macOS / Linux / Windows)
26
22
  npx -y agy-bar@latest install
27
23
  ```
28
24
 
25
+ > **Let your AI agent install it for you** — paste into `agy`, Claude Code, or Codex:
26
+ > ```text
27
+ > Follow https://raw.githubusercontent.com/xy-tuoren/agy-bar/main/AGENTS.md to install agy-bar for me.
28
+ > ```
29
+
30
+ ---
31
+
32
+ ## Why `agy-bar`?
33
+
34
+ Antigravity CLI (`agy`) ships with a minimal default footer and identical tab titles across windows. **`agy-bar`** upgrades it into a calm, high-signal engineering HUD using **100% official `settings.json` hooks** — no binary patches, no dependencies, and no TUN-mode headaches.
35
+
36
+ | Pain Point in Default `agy` | How `agy-bar` Solves It |
37
+ | --- | --- |
38
+ | **Blind to context, cache, latency & cost** | Live segmented `CTX` bar (`→/compact` alert), **5-min prompt cache TTL countdown**, exact DB-backed **TTFT & pure streaming `tok/s`**, per-conversation spend (including nested subagents), and `DAY / WK / MO / ALL` totals. |
39
+ | **Quota drift across multiple terminals** | Auto-matches **Gemini 4 (Neon / Carbon / Hydrogen / Argon)** & **Claude 3p** `5h` / `7d` pools, syncs the freshest quota snapshot locally across open terminals, and turns expired 5h resets green `(ready)` when `7d` still has headroom. |
40
+ | **Identical `agy --dangerously-skip-per...` tabs** | Uses AGY's official native `title` hook (`macOS / Linux / Windows Terminal`) to display **6 live state icons** (`●`, `● [N]`, `?`, `✗`, `…`, `✓`) + auto-resolved conversation summary titles (even on brand-new sessions) + optional low-token topic tracking. |
41
+ | **Forced to enable global TUN mode for proxy** | Built-in **no-TUN proxy launcher** (`agy-bar run` or opt-in 7-line `agy()` shell hook) auto-detects macOS/Windows system proxies and local Clash / Clash Verge / Surge / v2ray ports (`7897`, `7890`, `6152`, `10809`, …) with loopback-safe `NO_PROXY`. |
42
+ | **No visibility across parallel CLI sessions or history** | Side-pane **`agy-bar monitor`** tracks every active terminal live; **`agy-bar stats`** renders a **52-week true-color token heatmap**, active streaks, CLI vs Desktop split, and estimated API cost + cache savings in `< 20ms` cached. |
43
+ | **Fear of breakage, bloat, or privacy leaks** | **`0` npm dependencies**, zero binary patching, zero private API calls, zero-subprocess idle refreshes, `readOnly: true` SQLite metadata scans (**never reads prompts or replies**), and strict offline mode via `pricingAutoSync off`. |
44
+
29
45
  ---
30
46
 
31
- ## At a Glance — Two-Line Anatomy
47
+ ## Complete Badge, Metric & Status Reference
32
48
 
33
- `agy-bar` keeps idle terminals calm and high-signal, separating **workspace identity & cumulative overview (Line 1)** from **live session metrics & account quotas (Line 2)**:
49
+ `agy-bar` separates **Line 1 (Workspace Identity, Activity Badges & Cumulative Totals)** from **Line 2 (Live Session Telemetry & Account Quotas)**, keeping idle terminals calm while surfacing warnings only when action is needed:
34
50
 
35
51
  ```text
36
52
  ~/code/agy-bar (main* +142 -38) · PX 7897 DAY 136M/$13.2 · WK 810M · MO 875M · ALL 906M │ Gemini 4 Neon · xhigh
37
53
  CTX ▮▮▮▯▯▯▯▯ 42.6% (1.0M) │ CACHE 88%·3m42s │ TTFT 1.9s·158t/s │ ~$0.18 5h ▮▮▮▮▮▯ 85% (2h30m) │ 7d ▮▮▮▮▯▯ 64% (3d)
38
54
  ```
39
55
 
40
- | Zone | What It Shows | Smart Behavior |
41
- | --- | --- | --- |
42
- | **Line 1 · Left** | `~/code/agy-bar (main* +142 -38) · PX 7897` | Compact `~` path (`dirStyle`), live Git diff lines (tracked + untracked text, 3s cache), active proxy port badge, plus on-demand state badges (`CONFIRM` / `INPUT` when waiting on you, `ERR`, `● 34s · esc`, `SUB N` subagents, `TASK N` background tasks, `PLAN` / `SANDBOX`, Vim `[NORMAL]`) |
43
- | **Line 1 · Right** | `DAY 136M/$13.2 · WK 810M · MO 875M · ALL 906M │ Model` | Calm neutral cumulative token/spend strip + active model & reasoning effort; sheds gracefully on narrow split panes |
44
- | **Line 2 · Left** | `CTX ▮▮▮▯▯▯▯▯ 42.6% (1.0M) │ CACHE 88%·3m42s │ TTFT 1.9s·158t/s │ ~$0.18` | Unified health context gauge (`→/compact` at danger), 5-min prompt cache TTL countdown, exact first-token latency + streaming decode speed, and live conversation spend (rolls up nested subagent costs automatically, refreshing every 20s while subagents run) |
45
- | **Line 2 · Right** | `5h ▮▮▮▮▮▯ 85% (2h30m) │ 7d ▮▮▮▮▯▯ 64% (3d)` | Active model pool quotas (**Gemini 4 Neon / Carbon / Hydrogen / Argon** & **Claude 3p**) with live reset countdowns, local cross-terminal freshness sync, and green `(ready)` hint once a 5h reset point has passed |
56
+ ### Line 1 · Resident Workspace, Totals & Model
57
+
58
+ | Label / Example | Meaning | Smart Behavior & Colors | Config Toggle |
59
+ | --- | --- | --- | --- |
60
+ | `~/code/agy-bar` | Active workspace directory | Home-abbreviated (`dirStyle`: `short` \| `parent` \| `name`), compacts to folder name on narrow panes | `dir` |
61
+ | `(main* +142 -38)` | Git branch, dirty `*` & live diff lines | Purple branch, amber `*` when dirty, green `+added` / red `-removed` (tracked + untracked text files, 3s cache, hidden when clean) | `git`, `gitDirty`, `gitDiff` |
62
+ | `PX 7897` / `PX on` | Active proxy port micro-badge | Reads `HTTPS_PROXY`/`HTTP_PROXY`/`ALL_PROXY` from process memory (`0ms`, no credentials shown); hidden when running direct | `proxy` |
63
+ | `DAY 136M/$13.2` | Today's total tokens & estimated API cost | Neutral white tokens + cyan USD across CLI & Desktop history, live-incremented every turn | `todayTokens`, `todayCost` |
64
+ | `WK 810M` / `MO 875M` / `ALL 906M` | Rolling 7-day, calendar month & all-time tokens | Calm neutral palette; sheds gracefully (`MO` → `WK` → `ALL` → `DAY`) on narrow split panes | `weekTokens`, `monthTokens`, `totalTokens` |
65
+ | `Gemini 4 Neon · xhigh` | Active model & reasoning effort | Strips duplicate effort suffix automatically | `model`, `effort` |
66
+
67
+ ### Line 1 · On-Demand Activity & Mode Badges *(auto-hidden when idle)*
68
+
69
+ | Badge / Example | When It Appears | Color & Thresholds | Config Toggle |
70
+ | --- | --- | --- | --- |
71
+ | `[NORMAL]` / `[INSERT]` / `[VISUAL]` | Vim input mode active in `agy` | Cyan `[NORMAL]`, green `[INSERT]`, purple `[VISUAL]` | `vim` |
72
+ | `CONFIRM` | Agent is waiting for tool-call approval (`tool_confirmation_pending: true`) | Bold amber attention badge | `mode` / `hint` |
73
+ | `INPUT` | Agent is paused waiting for your review/input (`agent_state: "reviewing"`) | Bold amber attention badge | `mode` / `hint` |
74
+ | `ERR` | Session hit an error (`agent_state: "error"`) | Bold red alert badge | `mode` / `hint` |
75
+ | `PLAN` / `SANDBOX` | Non-default execution mode active (`cycle_mode: "plan"` / `sandbox.enabled`) | Bold amber `PLAN`, bold purple `SANDBOX` | `mode` |
76
+ | `SUB N` | `N` subagents actively running | Muted `SUB` + bold cyan count `N` | `subagents` |
77
+ | `TASK N` | `N` background tasks / dev servers running (`task_count > 0`) | Muted `TASK` + cyan count `N` | `subagents` |
78
+ | `● 34s · esc` | Main agent busy (`working` / `tool_use` / `thinking`) + live turn elapsed timer | Cyan `<30s` → Amber `≥30s` → Bold red `≥90s`; `esc` cancel hint | `turnTimer`, `hint` |
79
+
80
+ ### Line 2 · Live Session Metrics, Optional Labels & Quotas
81
+
82
+ | Label / Example | Meaning | Color Rules & Thresholds | Config Toggle |
83
+ | --- | --- | --- | --- |
84
+ | `CTX ▮▮▮▯▯▯▯▯ 42.6% (1.0M)` | Context window usage, 8-cell gauge & window capacity | Unified `health` mode: green `<70%` → bold amber `≥70%` → bold red `≥88%` (per-model overrides via `modelThreshold.<model>.*`) | `context`, `contextBar`, `capacity` |
85
+ | `→/compact` | Actionable compaction reminder | Bold red; appears right beside `CTX` once danger threshold (`≥88%`) is hit | `compactHint` |
86
+ | `+12.4K` *(off by default)* | Last turn's context growth delta | Muted; enable via `agy-bar config enable contextDelta` | `contextDelta` |
87
+ | `CACHE 88%·3m42s` | Prompt cache hit rate + 5-min cache TTL countdown | Hit rate: green `≥70%`, white `30–69%`, amber `<30%`. TTL: muted `>90s`, amber `≤90s`, bold red `≤30s` / `exp` | `cache`, `cacheTtl` |
88
+ | `TTFT 1.9s` | Exact Time-To-First-Token latency (from local step metadata, `stdin` fallback) | Green `≤3s` → white `3–8s` → bold amber `≥8s` → bold red `≥15s` (tunable via `ttftWarnSec` / `ttftDangerSec`) | `ttft` |
89
+ | `158t/s` | Pure streaming decode speed (excludes TTFT wait) | Cyan `≥60 t/s` → white `25–59 t/s` → amber `<25 t/s` | `speed` |
90
+ | `~$0.18` | Live estimated spend for current conversation | Automatically rolls up nested subagent & grandchild spend (refreshes every 20s while subagents run) | `cost` |
91
+ | `12m·8t` *(off by default)* | Session elapsed duration & turn count | Muted; enable via `agy-bar config enable session` | `session` |
92
+ | `5h ▮▮▮▮▮▯ 85% (2h30m)` / `7d …` | Active model pool 5-hour & weekly remaining quotas + reset countdown | Green `>25%` → bold amber `≤25%` → bold red `≤10%` (`quotaWarn` / `quotaDanger`); synced across local terminals | `quota`, `quotaBar`, `quota5h`, `quotaWeekly`, `reset` |
93
+ | `(ready)` vs `(due)` | Expired 5h reset-window indicator | Green `(ready)` when 5h reset time has passed & `7d` still has quota (send a prompt to refresh); red `(due)` when blocked by `7d` | `reset` |
94
+
95
+ ### Terminal Tab Title · 6-State Unified Activity Machine (Multi-Tab Triage at a Glance)
96
+
97
+ | Tab Prefix | Session State | Trigger | Why It Matters in Parallel Workflows | Statusline / Monitor |
98
+ | --- | --- | --- | --- | --- |
99
+ | `● <topic>` | **Working** | Main agent active (`working` / `tool_use` / `thinking`) | Agent is actively running — stay focused in other tabs without blind polling | `● 34s · esc` / `working` |
100
+ | `● [N] <topic>` | **Subagents Running** | Main agent idle while `N` subagents are still running | Shows `N` background subagents are still finishing so you **never close or interrupt early** | `SUB N` / `sub:N` |
101
+ | `? <topic>` | **Blocked on You** | Tool approval pending (`tool_confirmation_pending`) or `reviewing` | Highest-priority cue — jump straight to the blocked tab instead of letting it sit idle | `CONFIRM` / `INPUT` |
102
+ | `✗ <topic>` | **Error** | Session hit an error (`agent_state: "error"`) | Surfaces failures immediately so you recover fast instead of waiting on a dead run | `ERR` / `error` |
103
+ | `… <topic>` | **Starting Up** | Session `authenticating` or `initializing` | Clearly distinguishes startup/auth from truly finished idle tabs | *(startup)* / `auth`·`init` |
104
+ | `✓ <topic>` | **Truly Done** | Main agent & subagents idle (stays `✓` even if a background `TASK` server runs) | Safe signal to switch back and review results without false busy noise from dev servers | *(calm/`TASK N`)* / `idle` |
105
+
106
+ > **4 Key Advantages of `agy-bar` Tab Titles (`tabTitleSource: "auto"`)**:
107
+ > 1. **Zero-Token Initial Summaries (Even on Brand-New Chats)**: Resolves `customTitle` → AGY's live `conversation_title` → read-only fallback to local `conversation_summaries.db` `title` → `project (branch)`, so brand-new tabs auto-switch from directory names to task summaries after turn 1.
108
+ > 2. **100% Official Native `title` Hook**: Works cleanly on macOS, Linux, and native Windows Terminal with zero `/dev/tty` interleaving and zero `ps` subprocesses.
109
+ > 3. **PID-Accurate Multi-Tab Targeting**: `agy-bar title` matches the invoking terminal's host `agy` PID so concurrent tabs never overwrite each other.
110
+ > 4. **Dynamic Topic Tracking & `/rename` Friendly**: Add one line to `~/.gemini/AGENTS.md` to silently refresh concise topics on topic shifts (~10 tokens), while manual `/rename` in `agy` cleanly supersedes overrides.
46
111
 
47
112
  ---
48
113
 
49
114
  ## Feature Showcase
50
115
 
51
- ### 1. Crisp Segmented Gauges, 8 Bar Styles & 6 Themes
116
+ ### 1. Real Ghostty Terminal Capture
117
+
118
+ ![agy-bar live Ghostty terminal screenshot](https://raw.githubusercontent.com/xy-tuoren/agy-bar/main/assets/live-statusline.png)
119
+
120
+ <sub>Real Ghostty capture under heavy load: 10 running subagents (displayed as <code>SUB 10</code> in v1.0+), live Git diff (<code>+14.3K -803</code>), no-TUN proxy (<code>PX 7897</code>), 1.01B cumulative tokens, 99% prompt cache TTL, TTFT &amp; speed, live conversation spend, and 5h/7d quotas.</sub>
121
+
122
+ ### 2. 8 Segmented Gauge Styles, 6 Themes & 2 Color Modes
52
123
 
53
124
  Choose from **8 gauge styles** (`segments` default `▮▮▮▯▯▯`, `squares`, `pills`, `dots`, `smooth`, `blocks`, `line`, `ascii`), **6 themes** (`auto`, `slate-dark`, `slate-light`, `ocean`, `nord`, `mono`), and **2 color modes** (`health` unified green→amber→red, or `distinct` cyan CTX vs green quota). Every preference takes effect on the next refresh with zero restart.
54
125
 
55
126
  ![agy-bar 8 gauge styles and themes preview](https://raw.githubusercontent.com/xy-tuoren/agy-bar/main/assets/styles-preview.svg)
56
127
 
57
- ---
58
-
59
- ### 2. Full-History Token Dashboard & 52-Week Heatmap (`agy-bar stats`)
128
+ ### 3. Full-History Token Dashboard & 52-Week Heatmap (`agy-bar stats`)
60
129
 
61
130
  Incrementally scans local Antigravity CLI & Desktop conversation DBs in **read-only mode** (never reads prompt/reply text; `< 20ms` cached) to render an 80-col-safe 4-card overview (`All-Time / Today / Month / Year`), a **52-week terminal activity heatmap** (`purple` / `green` / `cyan` / `amber`, auto-adapted for dark & light themes), active streaks, CLI vs Desktop breakdown, per-model TTFT/speed table, and **estimated API cost + cache savings**.
62
131
 
63
132
  ![agy-bar 52-week terminal token heatmap preview](https://raw.githubusercontent.com/xy-tuoren/agy-bar/main/assets/stats-preview.svg)
64
133
 
65
- ---
66
-
67
- ### 3. Multi-CLI Live Monitor (`agy-bar monitor`)
134
+ ### 4. Multi-CLI Live Monitor (`agy-bar monitor`)
68
135
 
69
- Running 3–5 `agy` sessions across different repos? Open `agy-bar monitor` in a side pane to watch every active terminal live — working/idle status, workspace & branch, model, context bar, 5-min cache TTL, TTFT, decode speed, session spend, and global quotas.
136
+ Running 3–5 `agy` sessions across different repos? Open `agy-bar monitor` in a side pane to watch every active terminal live — 6-state status (`working`, `sub:3`, `? confirm`, `idle`), workspace & branch, model, context bar, 5-min cache TTL, TTFT, decode speed, session spend, and global quotas.
70
137
 
71
138
  ![agy-bar multi-CLI monitor preview](https://raw.githubusercontent.com/xy-tuoren/agy-bar/main/assets/monitor-preview.svg)
72
139
 
73
- ---
74
-
75
- ### 4. No-TUN Local Proxy Launcher & Live Pricing Cache (`agy-bar proxy` & `agy-bar pricing`)
140
+ ### 5. No-TUN Local Proxy Launcher & 3-Tier Dynamic Pricing (`agy-bar proxy` & `agy-bar pricing`)
76
141
 
77
- - **No-TUN Proxy (`agy` / `agy-bar run` / `agy-bar proxy`)**: Auto-detects macOS/Windows system proxies or local Clash Verge / Clash / Surge / v2ray ports (`7897`, `7890`, `6152`, `10809`, `1087`, ...) and injects standard `HTTP_PROXY`/`HTTPS_PROXY`/`ALL_PROXY` + loopback-safe `NO_PROXY` without enabling TUN mode or patching binaries. Opt into the reversible 7-line `agy()` shell hook during `install` (or anytime via `agy-bar proxy hook`) to just type plain `agy`.
142
+ - **No-TUN Proxy (`agy` / `agy-bar run` / `agy-bar proxy`)**: Auto-detects macOS/Windows system proxies or local Clash Verge / Clash / Surge / v2ray ports (`7897`, `7890`, `6152`, `10809`, `1087`, …) and injects standard `HTTP_PROXY`/`HTTPS_PROXY`/`ALL_PROXY` + loopback-safe `NO_PROXY` without enabling TUN mode or patching binaries. Opt into the reversible 7-line `agy()` shell hook during `install` (or anytime via `agy-bar proxy hook`) to just type plain `agy`.
78
143
  - **3-Tier Dynamic Pricing (`agy-bar pricing`)**: Resolves rates in `< 0.1ms` (`custom override` → `24h background SWR cache from models.dev / LiteLLM` → `built-in calibrated rates`). Proxy-aware, ETag `304`, zero auth, disable anytime with `agy-bar config set pricingAutoSync off`.
79
144
 
80
145
  ![agy-bar no-TUN proxy and dynamic pricing cache preview](https://raw.githubusercontent.com/xy-tuoren/agy-bar/main/assets/proxy-pricing-preview.svg)
81
146
 
82
- ---
83
-
84
- ### 5. Automatic Terminal Tab Titles (`●` / `● [N]` / `?` / `✓`) & Agent Summarization (`agy-bar title`)
147
+ ### 6. Automatic Terminal Tab Titles & Dynamic Topic Tracking (`agy-bar title`)
85
148
 
86
- Replaces identical `agy --dangerously-skip-permissions` tabs across Ghostty, iTerm2, Kitty, WezTerm, macOS Terminal, Windows Terminal, and VS Code using **Antigravity CLI's official `title` hook** (`settings.json` → `title`, with automatic OSC 0/2 fallback for older sessions) to show live activity state (`●` working, `● [N]` running subagents, `?` waiting for user input/confirmation, `✗` error, `✓` truly idle) + concise topic title (automatically picking up AGY's generated summary title even on brand-new conversations, zero extra tokens, full macOS / Linux / Windows support):
149
+ Replaces identical `agy --dangerously-skip-permissions` tabs across Ghostty, iTerm2, Kitty, WezTerm, macOS Terminal, Windows Terminal, and VS Code via Antigravity CLI's official `title` hook (`settings.json` → `title`, with automatic OSC 0/2 fallback):
87
150
 
88
151
  ![agy-bar live Ghostty tab titles comparison](https://raw.githubusercontent.com/xy-tuoren/agy-bar/main/assets/live-tab-titles.png)
89
152
 
90
- <sub>Real Ghostty tab bar: auto-synced tabs (`● agy-bar 开源状态栏`, `📊 agy-bar Token 热力图`) right next to an unmodified default `agy --dangerously-skip-per...` tab.</sub>
91
-
92
- > **Pro Tip — Auto-summarize tab titles on topic shifts (~10 tokens, zero extra API calls)**
93
- > Add this one line to your global `~/.gemini/AGENTS.md`:
94
- > ```text
153
+ > **Pro Tip — Auto-update tab titles whenever your topic changes (~10 tokens, zero extra API calls)**
154
+ > Add this one rule to Antigravity's official global rules file **`~/.gemini/AGENTS.md`**:
155
+ > ```markdown
95
156
  > In Antigravity CLI (`agy`) sessions, when starting a clear task or switching to a new topic in a long session, silently run `agy-bar title "<4-8 word concise topic>"` once to keep the terminal tab title up to date.
96
157
  > ```
97
158
  > *Ghostty tip*: prefer `agy-bar title "..."` over right-clicking **Change Title…** in Ghostty, which sets a manual `tabOverride` and blocks dynamic `●` / `✓` updates until cleared.
98
159
 
99
160
  ---
100
161
 
101
- ## Why `agy-bar`? (Safety, Privacy & Performance)
162
+ ## Safety, Privacy & Architecture Guarantees
102
163
 
103
164
  | Guarantee | How It Works |
104
165
  | --- | --- |
105
166
  | **100% Official `statusLine` + `title` Hooks** | Zero binary patching, zero Electron injection, zero Google/AGY private API calls, zero account credential access. Survives every AGY update cleanly. |
106
- | **Read-Only Local Telemetry** | SQLite scans (`Node >= 22.13`) open local AGY DBs in `readOnly: true` mode and extract **only numeric timestamps, token counts, subagent parent IDs, and the session's own `title` metadata** — never prompts or replies. |
107
- | **Transparent Network Policy** | Statusline rendering itself **never touches the network**. Only an optional 24-hour background sync fetches public unauthenticated pricing JSON (`models.dev` / `LiteLLM`); run `agy-bar config set pricingAutoSync off` for strict offline mode. |
108
- | **Zero-Dep Fast Hot Path** | `0` runtime dependencies, zero-subprocess idle refreshes (PID fast-path + 3s Git cache + SQLite `mtime` skip + 5-min Windows theme cache), and atomic file writes across concurrent terminals. |
167
+ | **Read-Only Local Metadata Only** | SQLite scans (`Node >= 22.13`) open local AGY DBs in `readOnly: true` mode and extract **only numeric timestamps, token counts, subagent parent IDs, and the active session's `title` metadata** — never prompts or replies. Opt out completely via `agy-bar config set dbTiming off`. |
168
+ | **Transparent Network Policy** | Statusline & tab-title rendering **never touch the network**. Only an optional 24-hour background sync fetches public unauthenticated pricing JSON (`models.dev` / `LiteLLM`); run `agy-bar config set pricingAutoSync off` for strict offline mode. |
169
+ | **Zero-Dep Fast Hot Path** | `0` runtime dependencies, zero-subprocess idle refreshes (PID fast-path + 3s Git cache + SQLite `.db`/`.db-wal` `mtime` skip + 5-min Windows theme cache), and atomic temp-file + rename writes across concurrent terminals. |
109
170
 
110
171
  ---
111
172
 
@@ -119,15 +180,15 @@ Requires **Node.js >= 20.0.0** and **Antigravity CLI (`agy`)**.
119
180
  npx -y agy-bar@latest install
120
181
  ```
121
182
 
122
- ### Option 2: Let `agy` install it for you
183
+ ### Option 2: Let your AI agent install it
123
184
 
124
- Paste this into an `agy` chat:
185
+ Paste into `agy`, Claude Code, or Codex:
125
186
 
126
187
  ```text
127
- Please follow https://github.com/xy-tuoren/agy-bar/blob/main/AGENTS.md to install agy-bar for me.
188
+ Please follow https://raw.githubusercontent.com/xy-tuoren/agy-bar/main/AGENTS.md to install agy-bar for me.
128
189
  ```
129
190
 
130
- ### Option 3: Manual install (GitHub)
191
+ ### Option 3: Manual install from GitHub
131
192
 
132
193
  ```sh
133
194
  git clone https://github.com/xy-tuoren/agy-bar.git ~/agy-bar
@@ -148,18 +209,28 @@ agy-bar proxy hook # Opt in so plain `agy` auto-uses local proxy (r
148
209
  agy-bar run -c # Launch `agy -c` through local proxy without modifying ~/.zshrc
149
210
  agy-bar proxy set 127.0.0.1:7897
150
211
 
212
+ # Browser-free multi-account vault & passive CLI quota management (opt-in, macOS/Linux/Windows)
213
+ agy-bar account save work # Snapshot current logged-in agy account into OS keyring (or 0600 fallback)
214
+ agy-bar account add alt1 # Preserve current slot, run one-time official `agy` OAuth, and capture new slot
215
+ agy-bar account import # Import existing accounts from Cockpit Tools (~/.cockpit_tools) or an exported JSON file
216
+ agy-bar account ls [--json] # Show all saved accounts, 5h/7d gauges, READY/LOW/LIMITED & reset timers
217
+ agy-bar switch [alias|next] # Instant browser-free switch (arrow-key picker when omitted; auto-pick best with `next`)
218
+ agy-bar switch next --family claude --handoff # Switch to best READY Claude account + launch `agy -i` with deep handoff (artifacts + git + transcript)
219
+ agy-bar config set autoSwitchOnLimit on autoHandoff on # Optional: auto-skip LIMITED accounts on launch & auto-resume on /exit after hitting 0%
220
+ agy-bar account backup vault.enc.json # AES-256-GCM encrypted backup (restore with `agy-bar account restore`)
221
+
151
222
  # Stats, pricing, monitor, tab title & debug
152
- agy-bar stats [today|7d|30d|all] [--palette purple|green|cyan|amber] [--source all|cli|desktop|ledger]
153
- agy-bar pricing show | sync | set <model> <in> <out> [cacheRead] | reset
223
+ agy-bar stats [today|7d|30d|all] [--palette purple|green|cyan|amber] [--source all|cli|desktop|ledger] [--json]
224
+ agy-bar pricing show [--json] | sync | set <model> <in> <out> [cacheRead] | reset
154
225
  agy-bar monitor [--once]
155
- agy-bar title "short topic" # Or: agy-bar title --clear
226
+ agy-bar title ["short topic"] # Inspect active title, set custom topic, or: agy-bar title --clear
156
227
  agy-bar debug --capture # Capture a PII-redacted AGY payload snapshot
157
228
  agy-bar preview --scenario all
158
229
  agy-bar doctor
159
230
  ```
160
231
 
161
232
  <details>
162
- <summary><strong>Full Configuration Reference (presets, themes, bar styles, toggles & thresholds)</strong></summary>
233
+ <summary><strong>Full Configuration Reference (presets, themes, bar styles, toggles &amp; thresholds)</strong></summary>
163
234
 
164
235
  Changes apply immediately on the next statusline refresh — no restart needed:
165
236
 
@@ -179,7 +250,10 @@ agy-bar config set dirStyle short
179
250
  # Color mode: health (unified green->amber->red) | distinct (blue CTX vs green quota)
180
251
  agy-bar config set colorMode health
181
252
 
182
- # Toggle individual items:
253
+ # Tab title controls: tabTitle on|off, tabTitleSource auto|title|dir|title+dir, tabTitleMaxLen 10..60
254
+ agy-bar config set tabTitle on tabTitleSource auto tabTitleMaxLen 26
255
+
256
+ # Toggle any individual item on or off:
183
257
  # hint, vim, mode, subagents, turnTimer, proxy, dir, model, effort, git, gitDirty, gitDiff,
184
258
  # context, contextBar, contextDelta, compactHint, capacity, cache, cacheTtl, ttft, speed,
185
259
  # cost, todayCost, session, todayTokens, weekTokens, monthTokens, totalTokens,
@@ -187,9 +261,9 @@ agy-bar config set colorMode health
187
261
  agy-bar config enable session contextDelta
188
262
  agy-bar config disable turnTimer gitDiff
189
263
 
190
- # Per-model thresholds, cache TTL, timing & offline mode
264
+ # Per-model thresholds, cache TTL, timing & strict offline mode
191
265
  agy-bar config set modelThreshold.claude.warn 65 modelThreshold.claude.danger 85
192
- agy-bar config set cacheTtlSec 300 dbTiming on pricingAutoSync off
266
+ agy-bar config set cacheTtlSec 300 ttftWarnSec 8 ttftDangerSec 15 dbTiming on pricingAutoSync off
193
267
 
194
268
  # Inspect or reset all preferences
195
269
  agy-bar config show
@@ -200,6 +274,26 @@ agy-bar config reset
200
274
 
201
275
  ---
202
276
 
277
+ ## For AI Agents & Automation
278
+
279
+ Canonical plain-Markdown references (fetch directly with zero HTML overhead):
280
+ - **Structured Repo Index**: [`llms.txt`](https://raw.githubusercontent.com/xy-tuoren/agy-bar/main/llms.txt)
281
+ - **Step-by-Step Installer Runbook**: [`AGENTS.md`](https://raw.githubusercontent.com/xy-tuoren/agy-bar/main/AGENTS.md)
282
+ - **Installed Companion Skill (`/agy-bar`)**: [`skills/agy-bar/SKILL.md`](https://raw.githubusercontent.com/xy-tuoren/agy-bar/main/skills/agy-bar/SKILL.md)
283
+
284
+ | Agent Task | Deterministic Command | Notes |
285
+ | --- | --- | --- |
286
+ | Non-interactive install (no shell rc edit) | `npx -y agy-bar@latest install --yes && agy-bar doctor` | Requires Node.js `>= 20.0.0`; zero `npm install` |
287
+ | Install with plain `agy` no-TUN proxy hook | `npx -y agy-bar@latest install --proxy-hook && agy-bar doctor` | Ask user before modifying `~/.zshrc` / `~/.bashrc` / `config.fish` |
288
+ | Inspect config / proxy / pricing / stats (JSON) | `agy-bar config show` / `agy-bar proxy status --json` / `agy-bar pricing show --json` / `agy-bar stats 7d --json` | Machine-readable JSON output |
289
+ | Update current tab's topic title | `agy-bar title "<short topic>"` | Targets the invoking host `agy` PID in multi-tab setups |
290
+ | Inspect multi-session snapshot | `agy-bar monitor --once --plain` | Non-interactive single frame |
291
+ | Full uninstall + live shell cleanup | `eval "$(agy-bar uninstall --remove-skill --purge --print-cleanup)"` | Restores original `settings.json` `statusLine` & `title` |
292
+
293
+ **Agent Safety Invariants**: Never modify Antigravity binaries or unrelated `settings.json` keys; never kill/restart a running `agy` process; inform the user to restart `agy` after installation passes `agy-bar doctor`.
294
+
295
+ ---
296
+
203
297
  ## Terminal & OS Compatibility
204
298
 
205
299
  - **Truecolor & 256-Color Auto-Adaptation**: Emits 24-bit Truecolor in Ghostty, iTerm2, Kitty, WezTerm, Alacritty, Warp, VS Code, and Windows Terminal; automatically downscales to nearest xterm-256 colors in macOS `Terminal.app` (`Apple_Terminal`) and `tmux` / `screen` / SSH without `COLORTERM=truecolor`; honors `NO_COLOR` and `TERM=dumb`.
@@ -226,7 +320,7 @@ eval "$(agy-bar uninstall --remove-skill --purge --print-cleanup)"
226
320
  ## Development
227
321
 
228
322
  ```sh
229
- npm test # Cross-platform Node.js built-in test suite (88 tests)
323
+ npm test # Cross-platform Node.js built-in test suite (102 tests, 9-job CI matrix)
230
324
  npm run preview # Render live terminal preview
231
325
  npm run preview:svg # Regenerate all 5 showcase SVGs in assets/
232
326
  npm run stats # Show local usage stats
@@ -235,6 +329,6 @@ npm run monitor # Launch multi-CLI HUD
235
329
  npm run doctor # Verify local installation
236
330
  ```
237
331
 
238
- ## License
332
+ ## License & Community
239
333
 
240
- [MIT](./LICENSE) © [xy-tuoren](https://github.com/xy-tuoren)
334
+ [MIT](./LICENSE) © [xy-tuoren](https://github.com/xy-tuoren) · Community & Discussion: [LINUX DO](https://linux.do)