<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Wassim AZI</title>
    <description>The latest articles on DEV Community by Wassim AZI (@wassim-azi).</description>
    <link>https://dev.to/wassim-azi</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4192890%2F2a942e02-dafe-407c-bdc6-a106a2978a78.png</url>
      <title>DEV Community: Wassim AZI</title>
      <link>https://dev.to/wassim-azi</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/wassim-azi"/>
    <language>en</language>
    <item>
      <title>agy-powerline 2.0.0 发布：为 Google Antigravity CLI 打造的状态栏仪表盘</title>
      <dc:creator>Wassim AZI</dc:creator>
      <pubDate>Sun, 22 Nov 2026 22:32:11 +0000</pubDate>
      <link>https://dev.to/wassim-azi/agy-powerline-200-fa-bu-wei-google-antigravity-cli-da-zao-de-zhuang-tai-lan-yi-biao-pan-1bob</link>
      <guid>https://dev.to/wassim-azi/agy-powerline-200-fa-bu-wei-google-antigravity-cli-da-zao-de-zhuang-tai-lan-yi-biao-pan-1bob</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fraw.githubusercontent.com%2Fwassim-azi%2Fagy-powerline%2Fmain%2Fassets%2Fdemo.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fraw.githubusercontent.com%2Fwassim-azi%2Fagy-powerline%2Fmain%2Fassets%2Fdemo.gif" alt="agy-powerline 交互式编辑器演示" width="760" height="453"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;※ 我是 MIT 开源项目 &lt;code&gt;agy-powerline&lt;/code&gt; 的作者和维护者，今天刚刚发布了 2.0.0 版本。&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;在终端里使用 &lt;strong&gt;Google Antigravity CLI（&lt;code&gt;agy&lt;/code&gt;）&lt;/strong&gt; 进行智能体开发时，传统状态栏只看得到路径和 Git 分支，往往回答不了会话中最关键的几个问题：当前用的是哪个模型？5 小时或 7 天配额按现在节奏还能撑多久？上下文窗口离触发压缩还有多少空间？有没有子智能体在跑、或工具正在等待确认？最近 30 天总共用了多少 token？&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;agy-powerline 2.0.0&lt;/strong&gt; 会在 &lt;code&gt;agy&lt;/code&gt; 输入框下方呈现一条可自由定制的状态栏——&lt;strong&gt;零运行时依赖、无网络请求、无遥测&lt;/strong&gt;，这次也正式加入了 &lt;strong&gt;简体中文（&lt;code&gt;zh-CN&lt;/code&gt;）&lt;/strong&gt; 界面与中文主页。&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fvk78dgnc4igbmnzv0iit.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fvk78dgnc4igbmnzv0iit.png" alt="Windows Terminal 中 agy 输入框下方的 agy-powerline 2.0.0" width="800" height="98"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  1. 一条命令安装并打开 6 标签页实时编辑器
&lt;/h2&gt;

&lt;p&gt;从 2.0.0 开始，不再需要分步执行 &lt;code&gt;init&lt;/code&gt; 和 &lt;code&gt;configure&lt;/code&gt;（旧 &lt;code&gt;configure&lt;/code&gt; / &lt;code&gt;config&lt;/code&gt; 仍保留并会在 5 秒提示后打开编辑器；自动化脚本可继续使用 &lt;code&gt;npx agy-powerline init --yes&lt;/code&gt;）：&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx agy-powerline
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;在终端运行后会自动安装或更新脚本（保留已有的 1.x &lt;code&gt;statusline.config.json&lt;/code&gt; 配置，并在修改前备份 Antigravity 的 &lt;code&gt;settings.json&lt;/code&gt;），随后直接进入全新的 &lt;strong&gt;6 标签页 TUI 编辑器&lt;/strong&gt;（&lt;strong&gt;Widgets / Presets / Themes / Layout / Powerline / Settings&lt;/strong&gt;）：&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;按行分组管理组件，查看组件在多种状态下的预览效果&lt;/li&gt;
&lt;li&gt;按 &lt;code&gt;/&lt;/code&gt; 搜索主题和预设，按 &lt;code&gt;Space&lt;/code&gt; 循环切换选项，支持鼠标点击与滚轮，按 &lt;code&gt;?&lt;/code&gt; 查看全部快捷键&lt;/li&gt;
&lt;li&gt;不改写配置文件即可按 &lt;code&gt;,&lt;/code&gt; / &lt;code&gt;.&lt;/code&gt; 切换示例场景（Normal / Near limits / Agent &amp;amp; modes），按 &lt;code&gt;-&lt;/code&gt; / &lt;code&gt;+&lt;/code&gt; 模拟 60–120 列或全宽终端&lt;/li&gt;
&lt;li&gt;新增 &lt;strong&gt;Settings&lt;/strong&gt; 标签页收纳全部 &lt;strong&gt;16 项整栏全局设置&lt;/strong&gt;，同时与 &lt;a href="https://agy-powerline.com/configure/" rel="noopener noreferrer"&gt;网页配置器&lt;/a&gt; 和 &lt;a href="https://agy-powerline.com/settings/" rel="noopener noreferrer"&gt;设置预览页&lt;/a&gt; 完全同步&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;首次安装完成后重启一次 &lt;code&gt;agy&lt;/code&gt; 即可生效；之后的修改会在下次刷新时显示。&lt;/p&gt;

&lt;h2&gt;
  
  
  2. v2.0.0 核心新特性（51 个组件 &amp;amp; 7 套预设）
&lt;/h2&gt;

&lt;h3&gt;
  
  
  多模型配额节奏与耗尽预测（&lt;code&gt;forecast&lt;/code&gt;）
&lt;/h3&gt;

&lt;p&gt;支持 Google Gemini（&lt;code&gt;Hydrogen&lt;/code&gt;、&lt;code&gt;Neon&lt;/code&gt;、&lt;code&gt;Argon&lt;/code&gt;、&lt;code&gt;Carbon&lt;/code&gt;、&lt;code&gt;Flash&lt;/code&gt;）、Anthropic（&lt;code&gt;Claude&lt;/code&gt;、&lt;code&gt;Sonnet&lt;/code&gt;）以及 Argon 专属每周配额（&lt;code&gt;argonWeekly&lt;/code&gt;、&lt;code&gt;argonReset&lt;/code&gt;）：&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;节奏标记与 &lt;code&gt;paceDelta&lt;/code&gt;：&lt;/strong&gt; 对照当前 5h / 7d 窗口已过时间展示消耗节奏，并标出提前（&lt;code&gt;⇡&lt;/code&gt;）或低于（&lt;code&gt;⇣&lt;/code&gt;）均匀节奏的百分点。&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;耗尽预测（&lt;code&gt;forecast&lt;/code&gt;）：&lt;/strong&gt; 估算按当前速度配额何时会耗尽；若预计能撑到重置或处于窗口前 10 分钟内会自动隐藏。&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;更多全局控制：&lt;/strong&gt; &lt;code&gt;quotaMode&lt;/code&gt; 一键切换显示“剩余量”或“已用量”；&lt;code&gt;zeroFiveHourWhenWeeklyEmpty&lt;/code&gt; 在 7 天配额归零时同步将 5 小时条置零；&lt;code&gt;showDisabled&lt;/code&gt; 可保留显示被标记为禁用的第三方 5h 配额。&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  上下文“压缩上限”（&lt;code&gt;compactionLimit&lt;/code&gt;）
&lt;/h3&gt;

&lt;p&gt;如果实际会话会在低于模型标称上下文窗口时触发压缩，可以设置 &lt;code&gt;compactionLimit&lt;/code&gt;（例如 &lt;code&gt;256000&lt;/code&gt;），状态栏会按这个软上限来计算比例、进度条、分母和告警阈值。&lt;/p&gt;

&lt;h3&gt;
  
  
  30 天本地 Token 统计（&lt;code&gt;tokensMonth&lt;/code&gt;）与预估花费（&lt;code&gt;cost&lt;/code&gt;）
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;tokensToday&lt;/code&gt;、&lt;code&gt;tokensWeek&lt;/code&gt;、&lt;strong&gt;新增 &lt;code&gt;tokensMonth&lt;/code&gt;&lt;/strong&gt;：在 &lt;strong&gt;Node.js 22.13 及以上&lt;/strong&gt; 环境中，通过内置 &lt;code&gt;node:sqlite&lt;/code&gt; 以只读方式读取 Antigravity 本地 SQLite 数据库，汇总所有会话在今天、近 7 天和近 30 天的 token 用量，支持输入/输出拆分（&lt;code&gt;split&lt;/code&gt;）和 token 预算告警。&lt;em&gt;（状态栏基础运行仍支持 Node.js 20+。）&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;cost&lt;/code&gt;：读取会话 payload 中的预估美元花费（仅作会话估算，非账单依据），修复极小金额四舍五入显示为 0 的问题，支持单独拆分 &lt;code&gt;cost.subagent_usd&lt;/code&gt;（&lt;code&gt;split: true&lt;/code&gt;）以及美元 &lt;code&gt;budget&lt;/code&gt; 预算阈值告警（&lt;code&gt;warn&lt;/code&gt; / &lt;code&gt;crit&lt;/code&gt; / &lt;code&gt;blink&lt;/code&gt;）。&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  智能体、环境变量与可点击 Git 链接
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;agent&lt;/code&gt;、&lt;code&gt;agentState&lt;/code&gt;（含待确认工具提示）、&lt;code&gt;tasks&lt;/code&gt;（子智能体与后台任务）及 &lt;strong&gt;新增 &lt;code&gt;queue&lt;/code&gt;&lt;/strong&gt;（排队中的用户消息）。&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;新增 &lt;code&gt;env&lt;/code&gt;：&lt;/strong&gt; 不启动子进程即可读取环境变量（如 &lt;code&gt;AWS_PROFILE&lt;/code&gt;），并自动屏蔽疑似密钥或密码的变量名。&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;link&lt;/code&gt;（OSC 8 超链接）与 &lt;code&gt;fish&lt;/code&gt;：&lt;/strong&gt; 为 &lt;code&gt;cwd&lt;/code&gt;、&lt;code&gt;project&lt;/code&gt;、&lt;code&gt;git&lt;/code&gt;、&lt;code&gt;gitSha&lt;/code&gt; 添加可点击终端链接，直达本地目录（系统 / VS Code / Cursor / Zed）或远程分支与提交页；&lt;code&gt;fish: true&lt;/code&gt; 将长路径与分支名缩短为 &lt;code&gt;~/D/r/app&lt;/code&gt;、&lt;code&gt;f/a/oauth-login&lt;/code&gt;。&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;窄终端换行（&lt;code&gt;overflow&lt;/code&gt;）：&lt;/strong&gt; 默认 &lt;code&gt;fit&lt;/code&gt; 会缩减标签和次要组件；新增 &lt;code&gt;overflow: "wrap"&lt;/code&gt; 可自动换行保留全部组件。&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  3. 7 种语言、22 款主题与 9 种进度条样式
&lt;/h2&gt;

&lt;p&gt;2.0.0 新增 &lt;strong&gt;简体中文（&lt;code&gt;zh-CN&lt;/code&gt;）&lt;/strong&gt;、德语（&lt;code&gt;de&lt;/code&gt;）和韩语（&lt;code&gt;ko&lt;/code&gt;）状态栏界面与主页，使状态栏支持达到 &lt;strong&gt;7 种语言&lt;/strong&gt;（&lt;code&gt;docs/&lt;/code&gt; 详细技术文档仍以英文为主）。&lt;/p&gt;

&lt;p&gt;外观支持 3 种布局（&lt;code&gt;Pills&lt;/code&gt;、&lt;code&gt;Lines&lt;/code&gt;、采用 &lt;code&gt;┃&lt;/code&gt; 分隔符的 &lt;code&gt;Classic&lt;/code&gt;）、通过 WCAG AA 对比度验证的 22 款主题（含深色、浅色与色盲友好主题 + &lt;code&gt;custom&lt;/code&gt;）、8 种行渐变、9 种进度条样式（&lt;code&gt;pips&lt;/code&gt;、&lt;code&gt;cells&lt;/code&gt;、&lt;code&gt;dots&lt;/code&gt;、&lt;code&gt;blocks&lt;/code&gt;、&lt;code&gt;shade&lt;/code&gt;、&lt;code&gt;squares&lt;/code&gt;、&lt;code&gt;braille&lt;/code&gt;、&lt;code&gt;rings&lt;/code&gt;、&lt;code&gt;ramp&lt;/code&gt;；移除了旧的 &lt;code&gt;line&lt;/code&gt;、&lt;code&gt;geometric&lt;/code&gt;、&lt;code&gt;bars&lt;/code&gt;）以及兼容无 Nerd Font 终端的 ASCII 模式。&lt;/p&gt;

&lt;h2&gt;
  
  
  4. 本地优先与安全边界
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;零运行时依赖、无网络请求、无遥测&lt;/strong&gt;（唯一外部跳转是在交互式编辑器中按 &lt;code&gt;g&lt;/code&gt; 在浏览器打开 GitHub 仓库）。&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;强化本地防护：&lt;/strong&gt; 跳过存在风险配置的 Git 仓库、绝不发起 Git 网络请求，且在 Windows 上绝不执行工作区目录内的 &lt;code&gt;git&lt;/code&gt; 程序；&lt;code&gt;exec&lt;/code&gt; 仅从受信任的全局配置目录运行并在超时时终止整个子进程树；&lt;code&gt;AGY_POWERLINE_DEBUG=1&lt;/code&gt; 调试转储会自动打码分支名和会话标题。&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  相关链接
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;GitHub（MIT）：&lt;a href="https://github.com/wassim-azi/agy-powerline" rel="noopener noreferrer"&gt;https://github.com/wassim-azi/agy-powerline&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;简体中文主页：&lt;a href="https://agy-powerline.com/zh-cn/" rel="noopener noreferrer"&gt;https://agy-powerline.com/zh-cn/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;网页配置器 &amp;amp; 16 项设置预览：&lt;a href="https://agy-powerline.com/configure/" rel="noopener noreferrer"&gt;https://agy-powerline.com/configure/&lt;/a&gt; · &lt;a href="https://agy-powerline.com/settings/" rel="noopener noreferrer"&gt;https://agy-powerline.com/settings/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;组件与主题画廊：&lt;a href="https://agy-powerline.com/widgets/" rel="noopener noreferrer"&gt;https://agy-powerline.com/widgets/&lt;/a&gt; · &lt;a href="https://agy-powerline.com/themes/" rel="noopener noreferrer"&gt;https://agy-powerline.com/themes/&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>chinese</category>
      <category>cli</category>
      <category>node</category>
      <category>gemini</category>
    </item>
    <item>
      <title>agy-powerline 2.0: a more useful statusline for Antigravity CLI</title>
      <dc:creator>Wassim AZI</dc:creator>
      <pubDate>Sun, 22 Nov 2026 21:12:57 +0000</pubDate>
      <link>https://dev.to/wassim-azi/agy-powerline-20-a-more-useful-statusline-for-antigravity-cli-2o8p</link>
      <guid>https://dev.to/wassim-azi/agy-powerline-20-a-more-useful-statusline-for-antigravity-cli-2o8p</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fraw.githubusercontent.com%2Fwassim-azi%2Fagy-powerline%2Fmain%2Fassets%2Fdemo.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fraw.githubusercontent.com%2Fwassim-azi%2Fagy-powerline%2Fmain%2Fassets%2Fdemo.gif" alt="agy-powerline interactive editor demo" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A statusline should answer the questions you keep asking while you work: Which model am I using? How much quota is left, and will it last? Is the context window getting full? What is the agent doing? Did my Git branch change?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;agy-powerline 2.0.0&lt;/strong&gt; brings that information into one configurable bar beneath the input area of Google Antigravity CLI (&lt;code&gt;agy&lt;/code&gt;). It combines multi-provider quota pacing and run-out forecasts, context and token tracking, estimated spend, agent activity, Git details with clickable links, and a redesigned editor—without adding runtime dependencies or network calls.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fvk78dgnc4igbmnzv0iit.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fvk78dgnc4igbmnzv0iit.png" alt="agy-powerline under agy input box in Windows Terminal" width="800" height="98"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  See more than the model and the quota
&lt;/h2&gt;

&lt;p&gt;The statusline reads Antigravity CLI's session payload and supports Google Gemini quota buckets—including Hydrogen, Neon, Argon, Carbon, and Flash—alongside Anthropic (Claude, Sonnet) quotas and Argon's own weekly bucket. Pace markers compare quota consumption with elapsed time in the 5-hour or 7-day window, and optional &lt;code&gt;forecast&lt;/code&gt; labels estimate when a quota will run out at the current pace.&lt;/p&gt;

&lt;p&gt;Beyond quotas, 2.0 expands session visibility across 51 widgets:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Context &amp;amp; compaction:&lt;/strong&gt; measure context against the full window or a soft &lt;code&gt;compactionLimit&lt;/code&gt; ceiling (such as 256K).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tokens &amp;amp; spend:&lt;/strong&gt; track session tokens, prompt-cache hits, cross-conversation totals for today, 7 days, and 30 days (read locally on Node.js 22.13+), and estimated USD session &lt;code&gt;cost&lt;/code&gt; with optional subagent spend splitting and &lt;code&gt;budget&lt;/code&gt; alerts.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Agent &amp;amp; environment:&lt;/strong&gt; show the active agent, agent state including pending tool confirmations, running subagents and background tasks, queued user messages, approval/Vim modes, sandbox status, &lt;code&gt;env&lt;/code&gt; variables, and user-configured &lt;code&gt;exec&lt;/code&gt; commands.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Git &amp;amp; links:&lt;/strong&gt; display branch, ongoing git operations (&lt;code&gt;REBASE&lt;/code&gt;, &lt;code&gt;MERGING&lt;/code&gt;, etc.), changes, ahead/behind counts, worktrees, stashes, and commit IDs, with optional clickable OSC 8 terminal links and Fish-style shortening (&lt;code&gt;~/D/r/app&lt;/code&gt;, &lt;code&gt;f/a/oauth-login&lt;/code&gt;).&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Make the bar fit the way you work
&lt;/h2&gt;

&lt;p&gt;Run &lt;code&gt;npx agy-powerline&lt;/code&gt; to install or update the statusline while keeping any existing config, and open the redesigned terminal editor directly. Inside the editor you can preview widgets in multiple states, switch between sample scenarios (Normal, Near limits, Agent &amp;amp; modes) and simulated terminal widths (60 to 120 columns or full width), filter themes and presets with &lt;code&gt;/&lt;/code&gt;, use mouse click and scroll, and configure all 16 bar-wide settings in the dedicated &lt;strong&gt;Settings&lt;/strong&gt; tab.&lt;/p&gt;

&lt;p&gt;Prefer a browser? The web configurator at &lt;a href="https://agy-powerline.com/configure/" rel="noopener noreferrer"&gt;https://agy-powerline.com/configure/&lt;/a&gt; mirrors the editor with live previews and lets you download or import a config. Choose between three layouts (&lt;strong&gt;Pills&lt;/strong&gt;, &lt;strong&gt;Lines&lt;/strong&gt;, and &lt;strong&gt;Classic&lt;/strong&gt;), &lt;strong&gt;22 WCAG AA themes&lt;/strong&gt; (dark, light, and color-blind safe) plus custom colors, &lt;strong&gt;8 row gradients&lt;/strong&gt;, &lt;strong&gt;9 meter styles&lt;/strong&gt;, &lt;strong&gt;7 bar languages&lt;/strong&gt; (including newly added German, Korean, and Simplified Chinese), and ASCII mode.&lt;/p&gt;

&lt;h2&gt;
  
  
  Useful links
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Project: &lt;a href="https://github.com/wassim-azi/agy-powerline" rel="noopener noreferrer"&gt;https://github.com/wassim-azi/agy-powerline&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Install: &lt;a href="https://agy-powerline.com/install/" rel="noopener noreferrer"&gt;https://agy-powerline.com/install/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Browser configurator: &lt;a href="https://agy-powerline.com/configure/" rel="noopener noreferrer"&gt;https://agy-powerline.com/configure/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Widgets: &lt;a href="https://agy-powerline.com/widgets/" rel="noopener noreferrer"&gt;https://agy-powerline.com/widgets/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Settings: &lt;a href="https://agy-powerline.com/settings/" rel="noopener noreferrer"&gt;https://agy-powerline.com/settings/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Theme gallery: &lt;a href="https://agy-powerline.com/themes/" rel="noopener noreferrer"&gt;https://agy-powerline.com/themes/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Changelog: &lt;a href="https://agy-powerline.com/changelog/" rel="noopener noreferrer"&gt;https://agy-powerline.com/changelog/&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Install or upgrade from 1.x:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx agy-powerline
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Restart &lt;code&gt;agy&lt;/code&gt; once after the first installation; existing &lt;code&gt;statusline.config.json&lt;/code&gt; files from 1.x remain compatible, and later changes appear on the next refresh.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Compatibility:&lt;/strong&gt; Node.js 20+ for the statusline (&lt;code&gt;npx agy-powerline&lt;/code&gt;), Windows, macOS, Linux, and WSL; Node.js 22.13+ for cross-conversation token totals (&lt;code&gt;tokensToday&lt;/code&gt;, &lt;code&gt;tokensWeek&lt;/code&gt;, &lt;code&gt;tokensMonth&lt;/code&gt;).&lt;/p&gt;

</description>
      <category>showdev</category>
      <category>cli</category>
      <category>node</category>
      <category>gemini</category>
    </item>
    <item>
      <title>Zero runtime dependencies in 2026: Building an npx tool users can actually trust</title>
      <dc:creator>Wassim AZI</dc:creator>
      <pubDate>Tue, 03 Nov 2026 11:00:00 +0000</pubDate>
      <link>https://dev.to/wassim-azi/zero-runtime-dependencies-in-2026-building-an-npx-tool-users-can-actually-trust-5dpc</link>
      <guid>https://dev.to/wassim-azi/zero-runtime-dependencies-in-2026-building-an-npx-tool-users-can-actually-trust-5dpc</guid>
      <description>&lt;p&gt;When a project's installation instructions start with &lt;code&gt;npx some-tool init&lt;/code&gt;, what's your first instinct?&lt;/p&gt;

&lt;p&gt;If you've been in software for more than five minutes, it's skepticism. And for good reason: the npm ecosystem has suffered through supply-chain incidents, typo-squatting attacks, and deeply nested dependency trees where a single compromised sub-dependency in &lt;code&gt;node_modules&lt;/code&gt; can exfiltrate API tokens or compromise your environment.&lt;/p&gt;

&lt;p&gt;Some statusline setups put the package manager straight into the refresh loop:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="nl"&gt;"statusLine"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"command"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"command"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"npx -y untrusted-statusline@latest"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or worse: piped shell scripts (&lt;code&gt;curl -sL ... | bash&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;In Google's Antigravity CLI (&lt;code&gt;agy&lt;/code&gt;), the &lt;code&gt;statusLine&lt;/code&gt; command runs on &lt;strong&gt;every refresh&lt;/strong&gt;, many times an hour while you work. With an unpinned package or a download in that command, whatever version the registry or the server hands out next runs on your machine, with access to your files, your environment variables and your SSH keys.&lt;/p&gt;

&lt;p&gt;When I built &lt;a href="https://agy-powerline.com/" rel="noopener noreferrer"&gt;agy-powerline&lt;/a&gt;, a statusline for Google's Antigravity CLI (&lt;code&gt;agy&lt;/code&gt;), I knew users would run &lt;code&gt;npx agy-powerline init&lt;/code&gt; or install it as an agent plugin. That tool needs to inspect the current environment, read git states, and configure Antigravity's &lt;code&gt;settings.json&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Asking users to run an untrusted script with write access to their dev setup is a non-starter. So from commit one, the project was designed under a strict set of non-negotiable security constraints. Here is the threat model, the architectural rules we enforced, and how we test them in CI.&lt;/p&gt;




&lt;h2&gt;
  
  
  1. The hard rule: &lt;code&gt;dependencies: {}&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;In &lt;code&gt;package.json&lt;/code&gt;, runtime dependencies stay empty:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;"dependencies"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;CI explicitly fails if any runtime dependency is added. Everything &lt;code&gt;agy-powerline&lt;/code&gt; does—JSON parsing, formatting, Git inspection, terminal color detection, process launching, and the interactive TUI—is built with Node's standard library and raw ANSI escape codes.&lt;/p&gt;

&lt;p&gt;Dev tools (&lt;code&gt;eslint&lt;/code&gt;, &lt;code&gt;prettier&lt;/code&gt;, &lt;code&gt;fast-check&lt;/code&gt;) exist in &lt;code&gt;devDependencies&lt;/code&gt;, but they are pinned to exact versions and are never included in the published npm package or the runtime bundle.&lt;/p&gt;

&lt;p&gt;Zero dependencies means:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Zero transitive dependency drift:&lt;/strong&gt; What runs on your machine today runs tomorrow without an upstream maintainer slipping in analytics or an adware SDK.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Fast cold starts:&lt;/strong&gt; Nothing to resolve or unpack in &lt;code&gt;node_modules&lt;/code&gt;. Node opens the single bundled script directly.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Auditable:&lt;/strong&gt; The whole runtime is about 7,500 lines of plain JavaScript, with nothing pulled in from elsewhere. Anyone can read all of it before running it.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  2. Never trust the current working directory
&lt;/h2&gt;

&lt;p&gt;A subtle attack vector for CLI tools that take configuration from the local workspace: a cloned repository containing a malicious &lt;code&gt;.statusline.json&lt;/code&gt; could execute arbitrary shell commands when rendered.&lt;/p&gt;

&lt;p&gt;To prevent this, &lt;code&gt;agy-powerline&lt;/code&gt; &lt;strong&gt;never reads config from the current directory&lt;/strong&gt;. Configuration is resolved exclusively from &lt;code&gt;AGY_POWERLINE_HOME&lt;/code&gt; or your home directory (&lt;code&gt;~/.agy-powerline/&lt;/code&gt;). A cloned repo cannot inject or override statusline settings.&lt;/p&gt;

&lt;p&gt;Furthermore, the statusline includes an &lt;code&gt;exec&lt;/code&gt; widget that allows running custom shell commands. To protect users:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;exec&lt;/code&gt; widgets only run when the config sits in the install folder (&lt;code&gt;~/.agy-powerline&lt;/code&gt; or &lt;code&gt;AGY_POWERLINE_HOME&lt;/code&gt;), which &lt;code&gt;isTrustedInstallDir()&lt;/code&gt; checks.&lt;/li&gt;
&lt;li&gt;CLI previews (such as running &lt;code&gt;configure&lt;/code&gt; or previewing presets) &lt;strong&gt;never execute user commands&lt;/strong&gt;—they display a static &lt;code&gt;[cmd]&lt;/code&gt; placeholder instead.&lt;/li&gt;
&lt;li&gt;If an imported config contains new shell commands, &lt;code&gt;import&lt;/code&gt; demands explicit confirmation or &lt;code&gt;--allow-exec&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The full list of &lt;a href="https://agy-powerline.com/security/#guarantees-around-exec-widgets" rel="noopener noreferrer"&gt;guarantees around exec widgets&lt;/a&gt; is on the site.&lt;/p&gt;




&lt;h2&gt;
  
  
  3. Terminal injection: untrusted text is hostile
&lt;/h2&gt;

&lt;p&gt;A statusline displays text it didn't write: branch names, folder names, subagent roles, conversation titles and the output of shell commands. If one of them holds something like &lt;code&gt;\x1b[2J\x1b[;H...&lt;/code&gt;, printing it raw to your terminal can trigger terminal escape sequences, disguise shell prompts, or execute arbitrary terminal emulator actions (like OSC 8 hyperlink attacks or OSC 52 clipboard hijacking).&lt;/p&gt;

&lt;p&gt;Every string originating outside our own code passes through &lt;code&gt;stripControl&lt;/code&gt; and &lt;code&gt;sanitizeDeep&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;stripControl&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="nb"&gt;String&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt; &lt;span class="o"&gt;??&lt;/span&gt; &lt;span class="s2"&gt;""&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;replace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;\&lt;span class="n"&gt;x1b&lt;/span&gt;\&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="o"&gt;^&lt;/span&gt;\&lt;span class="n"&gt;x07&lt;/span&gt;\&lt;span class="n"&gt;x1b&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;?:&lt;/span&gt;\&lt;span class="n"&gt;x07&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;\&lt;span class="n"&gt;x1b&lt;/span&gt;\\&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;?/&lt;/span&gt;&lt;span class="n"&gt;g&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;""&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;replace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;\&lt;span class="n"&gt;x1b&lt;/span&gt;\&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;-?&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt; &lt;span class="o"&gt;-/&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;@&lt;span class="o"&gt;-~&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;g&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;""&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;replace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;\&lt;span class="n"&gt;x1b&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;@&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;_&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;?/&lt;/span&gt;&lt;span class="n"&gt;g&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;""&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;replace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;\&lt;span class="n"&gt;x00&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;\&lt;span class="n"&gt;x1f&lt;/span&gt;\&lt;span class="n"&gt;x7f&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;\&lt;span class="n"&gt;x9f&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;g&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;""&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="c1"&gt;// Line/paragraph separators split the bar into extra rows in some&lt;/span&gt;
      &lt;span class="c1"&gt;// terminals, and bidi overrides can make a branch name read as another.&lt;/span&gt;
      &lt;span class="c1"&gt;// Zero-width joiners and plain RTL marks stay: emoji and RTL text need them.&lt;/span&gt;
      &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;replace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;  ‪&lt;span class="o"&gt;-&lt;/span&gt;‮⁦&lt;span class="o"&gt;-&lt;/span&gt;⁩&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;g&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;""&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In order: OSC strings (hyperlinks, clipboard and title changes), CSI sequences (colors, cursor moves, screen clears), any other escape, then C0 and C1 control characters, then the Unicode characters that can split a line or reverse the reading order.&lt;/p&gt;

&lt;p&gt;Branch names, session payloads, and command outputs are sanitized before calculating column widths and before outputting to stdout.&lt;/p&gt;




&lt;h2&gt;
  
  
  4. Never lose or corrupt user settings
&lt;/h2&gt;

&lt;p&gt;Running &lt;code&gt;init&lt;/code&gt; touches Google Antigravity's &lt;code&gt;settings.json&lt;/code&gt;. Touching another application's config file requires extreme care:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Strict JSON parsing:&lt;/strong&gt; If &lt;code&gt;settings.json&lt;/code&gt; contains comments, syntax errors, or trailing commas that &lt;code&gt;JSON.parse&lt;/code&gt; cannot safely round-trip, &lt;code&gt;init&lt;/code&gt; refuses to modify it and prints instructions on what to add manually.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Permanent first backup:&lt;/strong&gt; Before touching anything, the installer creates &lt;code&gt;settings.json.agy-powerline.original.bak&lt;/code&gt;. This file is &lt;strong&gt;never overwritten&lt;/strong&gt; on subsequent runs or upgrades. You can always roll back to your pre-install state.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Symlink preservation:&lt;/strong&gt; Many developers manage dotfiles with &lt;code&gt;stow&lt;/code&gt;, &lt;code&gt;chezmoi&lt;/code&gt;, or &lt;code&gt;yadm&lt;/code&gt;. Naive file writes replace symlinks with regular files, severing the link to the dotfile repo. &lt;code&gt;agy-powerline&lt;/code&gt; resolves the symlink target and writes safely to the destination file.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Targeted keys only:&lt;/strong&gt; The installer touches only the &lt;code&gt;"statusLine"&lt;/code&gt; key, leaving every other setting intact.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Uninstall bounds:&lt;/strong&gt; &lt;code&gt;uninstall --delete&lt;/code&gt; only removes files listed in a hardcoded manifest (&lt;code&gt;INSTALLED_FILES&lt;/code&gt;). It never runs recursive deletes on user-derived directory paths.&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  5. Signed build provenance and offline archives
&lt;/h2&gt;

&lt;p&gt;Publishing to npm shouldn't rely on long-lived personal API tokens stored on someone's laptop.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;npm Trusted Publishing:&lt;/strong&gt; Releases are published exclusively from GitHub Actions using OpenID Connect (OIDC) tokens with zero stored secrets.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;npm provenance:&lt;/strong&gt; Every version on npm carries a provenance statement that links it to the GitHub workflow run and commit that built it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Signed release files:&lt;/strong&gt; Since 1.4.0, each GitHub release also attaches the npm tarball with its signed build attestation, so you can check a download yourself:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;  gh attestation verify agy-powerline-1.4.0.tgz -R wassim-azi/agy-powerline
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Where npm is blocked:&lt;/strong&gt; Each release since 1.4.0 also attaches plugin archives (&lt;code&gt;.zip&lt;/code&gt; and &lt;code&gt;.tar.gz&lt;/code&gt;) for &lt;code&gt;agy plugin install&lt;/code&gt;, with the same signed attestation. The install page explains &lt;a href="https://agy-powerline.com/install/#install-without-npm" rel="noopener noreferrer"&gt;installing without npm&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  6. Property-based fuzzing and static analysis
&lt;/h2&gt;

&lt;p&gt;How do you guarantee a zero-dependency statusline never crashes your terminal session?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Property-based tests with &lt;code&gt;fast-check&lt;/code&gt;:&lt;/strong&gt; with a fixed seed and 300 runs per property, random and malformed payloads (wrong types, nulls, huge numbers, odd Unicode) go through the renderer. It must never throw, print no control characters besides its own colors, keep every row within widths from 40 to 240 columns, and never run an &lt;code&gt;exec&lt;/code&gt; command in a preview. Random input piped into the runtime script must end in exit code 0, without a stack trace.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CodeQL &amp;amp; zizmor:&lt;/strong&gt; CodeQL runs static code analysis on every push and pull request, and once a week. GitHub Actions workflows are audited with &lt;code&gt;zizmor&lt;/code&gt; (detecting credential leaks, runner compromises, or script injection) and &lt;code&gt;actionlint&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;OpenSSF Scorecard:&lt;/strong&gt; The project continuously tracks OpenSSF security best practices.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  The takeaway: a local file, not a download
&lt;/h2&gt;

&lt;p&gt;Instead of fetching code on every refresh, &lt;code&gt;agy-powerline&lt;/code&gt; joins its CommonJS runtime into a single local script at &lt;code&gt;~/.agy-powerline/statusline.js&lt;/code&gt;. Antigravity's &lt;code&gt;settings.json&lt;/code&gt; points directly to your machine's local &lt;code&gt;node&lt;/code&gt; binary and that local file. &lt;/p&gt;

&lt;p&gt;On refresh:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Zero network requests.&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Zero dynamic dependency resolutions.&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Zero execution of remote code.&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Building CLI tools with zero runtime dependencies takes more upfront effort than pulling in five convenience packages from npm. But the payoff is immense: sub-second startup speed, zero supply-chain anxiety, and software you can run on your production workstation with confidence.&lt;/p&gt;

&lt;p&gt;To inspect the build and install safely:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx agy-powerline init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;🤖 &lt;strong&gt;One-shot install via your Antigravity agent:&lt;/strong&gt;&lt;/p&gt;


&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Hey agy, please install agy-powerline by running `npx agy-powerline init --yes`, then tell me to restart agy.
&lt;/code&gt;&lt;/pre&gt;

&lt;/blockquote&gt;

&lt;p&gt;The docs are on &lt;a href="https://agy-powerline.com/" rel="noopener noreferrer"&gt;agy-powerline.com&lt;/a&gt;, and the code is MIT on GitHub: &lt;a href="https://github.com/wassim-azi/agy-powerline" rel="noopener noreferrer"&gt;wassim-azi/agy-powerline&lt;/a&gt;. The &lt;a href="https://agy-powerline.com/security/" rel="noopener noreferrer"&gt;security page&lt;/a&gt; lists what the bar does on your machine: the files it reads and writes, the processes it starts and how to report a vulnerability. The full policy and threat model are in &lt;a href="https://github.com/wassim-azi/agy-powerline/blob/main/SECURITY.md" rel="noopener noreferrer"&gt;&lt;code&gt;SECURITY.md&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>node</category>
      <category>security</category>
      <category>devops</category>
      <category>opensource</category>
    </item>
    <item>
      <title>A live-preview terminal UI in plain Node.js, with zero dependencies</title>
      <dc:creator>Wassim AZI</dc:creator>
      <pubDate>Fri, 30 Oct 2026 11:00:00 +0000</pubDate>
      <link>https://dev.to/wassim-azi/a-live-preview-terminal-ui-in-plain-nodejs-with-zero-dependencies-2pi8</link>
      <guid>https://dev.to/wassim-azi/a-live-preview-terminal-ui-in-plain-nodejs-with-zero-dependencies-2pi8</guid>
      <description>&lt;p&gt;In Google's Antigravity CLI (&lt;code&gt;agy&lt;/code&gt;), the &lt;code&gt;/statusline&lt;/code&gt; command turns the status bar on or off, and that's it. People &lt;a href="https://discuss.ai.google.dev/t/antigravitys-spaghetti-code-for-statusline/171395" rel="noopener noreferrer"&gt;expect more&lt;/a&gt;: a way to change what the bar shows without writing a custom shell script. Configuring a statusline by hand usually means wrestling with an undocumented JSON schema. You edit a property, save, switch windows, inspect the bar, and go back to edit again.&lt;/p&gt;

&lt;p&gt;When building &lt;a href="https://agy-powerline.com/" rel="noopener noreferrer"&gt;agy-powerline&lt;/a&gt;, I wanted the terminal customization experience to feel like &lt;strong&gt;Powerlevel10k for Google Antigravity&lt;/strong&gt;: one command that opens an interactive configurator with a live preview of your bar, where you browse presets, toggle widgets, and audition themes with arrow keys, with the preview following every change.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fraw.githubusercontent.com%2Fwassim-azi%2Fagy-powerline%2Fmain%2Fassets%2Fdemo.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fraw.githubusercontent.com%2Fwassim-azi%2Fagy-powerline%2Fmain%2Fassets%2Fdemo.gif" alt="The configure editor: widgets, presets, themes and layouts, with the live preview following the cursor" width="760" height="453"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The project has a hard rule: &lt;strong&gt;zero runtime dependencies&lt;/strong&gt;. No Ink, no blessed, no chalk. Partly for supply-chain reasons (people run it with &lt;code&gt;npx&lt;/code&gt;, and it touches their dev configuration), partly because every module it doesn't load is start-up time it doesn't pay. So the interactive TUI is built on Node's standard library and a handful of raw ANSI escape codes. Here's how it works, and what I'd do the same way again.&lt;/p&gt;

&lt;h2&gt;
  
  
  The primitives: raw mode, keypresses, the alternate screen
&lt;/h2&gt;

&lt;p&gt;Everything starts with four calls:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;readline&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"readline"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="n"&gt;readline&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;emitKeypressEvents&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;stdin&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nb"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;stdin&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setRawMode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nb"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;stdin&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;resume&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nb"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;stdin&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;on&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"keypress"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;onKey&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;emitKeypressEvents&lt;/code&gt; parses the raw bytes into events like &lt;code&gt;{ name: "up" }&lt;/code&gt; or &lt;code&gt;{ name: "c", ctrl: true }&lt;/code&gt;, so arrow keys, Enter, Escape and letters all arrive in one handler.&lt;/p&gt;

&lt;p&gt;Then the editor switches to the terminal's alternate screen and hides the cursor, so it doesn't scroll away your shell history:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="no"&gt;CSI&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"\x1b["&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nb"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;stdout&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;write&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sb"&gt;`${CSI}?1049h${CSI}?25l`&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// alternate screen, hide cursor&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The most important part is the way out. In raw mode, Ctrl+C is just a key, so the key handler treats it as quit. &lt;code&gt;SIGINT&lt;/code&gt; and &lt;code&gt;SIGTERM&lt;/code&gt; get the same handler. Quitting always does the same three things: save, leave raw mode, and restore the screen.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;quit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;exiting&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="n"&gt;exiting&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nf"&gt;persist&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nb"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;stdin&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;setRawMode&lt;/span&gt;&lt;span class="o"&gt;?&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nb"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;stdout&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;write&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sb"&gt;`${CSI}?25h${CSI}?1049l`&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// show cursor, main screen&lt;/span&gt;
  &lt;span class="nb"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;exit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A TUI that leaves your terminal in raw mode with no cursor is a TUI people uninstall.&lt;/p&gt;

&lt;h2&gt;
  
  
  Redraw everything, every time
&lt;/h2&gt;

&lt;p&gt;There's no diffing and no virtual DOM. On every keypress, the editor builds the whole frame as an array of strings, moves the cursor home, clears to the end of the screen, and writes the frame:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;draw&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nb"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;stdout&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;write&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sb"&gt;`${CSI}H${CSI}J`&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nf"&gt;frameLines&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"\n"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s2"&gt;"\n"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nb"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;stdout&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;on&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"resize"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;draw&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For an editor that only redraws when you press a key, this is fast enough, and it's very simple to reason about: there's no previous state to get out of sync with. If it ever becomes a problem, writing only the lines that changed would be the next step.&lt;/p&gt;

&lt;h2&gt;
  
  
  The frame is a pure function, so it's testable
&lt;/h2&gt;

&lt;p&gt;Because &lt;code&gt;draw()&lt;/code&gt; only writes what &lt;code&gt;frameLines()&lt;/code&gt; returns, the interesting part is a function of state and window size. The module exports a &lt;code&gt;renderFrame()&lt;/code&gt; for tests that sets the state, pins the size and the color depth, and returns the frame as a string:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;frame&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;renderFrame&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;config&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;defaultConfig&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;screen&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"layout"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;cursor&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;columns&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That makes a terminal UI testable like any other output. One test, for example, checks that each layout's description in the details panel is exactly three lines under 90 columns, separated by blank lines. Another draws every screen at seven window sizes, from 60×16 to 220×50, in Unicode and ASCII mode, and checks that no frame is wider or taller than its window. No pseudo-terminal, no screenshots, no timing.&lt;/p&gt;

&lt;h2&gt;
  
  
  The preview is the real renderer
&lt;/h2&gt;

&lt;p&gt;The live preview isn't a mock of the bar. It calls the same &lt;code&gt;renderStatusline()&lt;/code&gt; function the installed statusline runs on every refresh in &lt;code&gt;agy&lt;/code&gt;, with sample session data and a terminal width set to the preview panel's width:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="n"&gt;previewData&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;terminal_width&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;width&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;rendered&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;renderStatusline&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;previewData&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;previewConfig&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;getActiveDepth&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So the preview fits, drops widgets and cuts lines exactly the way the real bar will in a terminal that wide. If it looks right in the editor, it looks right in &lt;code&gt;agy&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;With no dependencies, the same modules also run in a browser. The &lt;a href="https://agy-powerline.com/configure/" rel="noopener noreferrer"&gt;web configurator&lt;/a&gt; bundles the runtime's own CommonJS modules into the page, so its preview comes from the same renderer as the bar in your terminal.&lt;/p&gt;

&lt;p&gt;Hovering is a preview, not a change. Moving the cursor over a theme, a preset or a layout redraws the preview with it, and the preview's title says so (&lt;code&gt;preview, enter to apply&lt;/code&gt;). Enter applies it; moving away leaves your setup as it was.&lt;/p&gt;

&lt;p&gt;One safety detail: the bar has an &lt;code&gt;exec&lt;/code&gt; widget that runs a shell command you configure. The preview never runs it, and shows &lt;code&gt;[cmd]&lt;/code&gt; instead. Scrolling through your config shouldn't execute anything.&lt;/p&gt;

&lt;h2&gt;
  
  
  Responsive, in a terminal
&lt;/h2&gt;

&lt;p&gt;A terminal can be 80 columns or 200, and 20 rows or 60. The editor changes shape at two widths:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;From 80 columns, the descriptions line up in their own column.&lt;/li&gt;
&lt;li&gt;From 140 columns, the list gets a details panel next to it: the selected widget drawn on its own with its options, a preset's rows, or a theme's colors.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Height is handled the other way around. When the window is short, the editor gives things up one step at a time: first the tagline, then the blank lines between panels, then the notes, then the preview's toggles. That way the list keeps at least six rows. A list longer than its panel scrolls, and the scroll position is kept between frames, so the list only moves when the cursor leaves the visible part.&lt;/p&gt;

&lt;h2&gt;
  
  
  Counting columns is harder than it looks
&lt;/h2&gt;

&lt;p&gt;Every box, panel and padding depends on one function: how many columns a string takes on screen. &lt;code&gt;string.length&lt;/code&gt; is wrong in several ways:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Escape sequences (colors, hyperlinks) take no columns, so strip them first.&lt;/li&gt;
&lt;li&gt;Most emoji and CJK characters take two.&lt;/li&gt;
&lt;li&gt;Combining marks, zero-width joiners, variation selectors and skin-tone modifiers take none.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And terminals don't always agree. When I recorded the demo GIF with VHS, one emoji (🪙) was drawn one column wide, while the width count says two. Everything after it on that row moved over by one column. There's no perfect answer: you pick the width most terminals use and accept the odd exception.&lt;/p&gt;

&lt;h2&gt;
  
  
  Colors for every terminal
&lt;/h2&gt;

&lt;p&gt;The editor and the bar detect the color depth: truecolor, 256 colors, or none (&lt;code&gt;NO_COLOR&lt;/code&gt; is respected). In 256-color mode each color maps to the nearest one in the terminal's palette. Getting that right needed care: an early version turned near-black text into navy blue. There's also an ASCII mode for terminals without a Nerd Font, and a test checks that every screen draws in plain ASCII when it's on.&lt;/p&gt;

&lt;p&gt;Every theme is also checked in the test suite: WCAG AA contrast (4.5:1 minimum ratio) for text on each pill and for each color on the terminal background. For the &lt;code&gt;colorblind-*&lt;/code&gt; themes, the tests simulate protanopia, deuteranopia and tritanopia to mathematically guarantee that caution and danger states remain distinguishable. The &lt;a href="https://agy-powerline.com/themes/" rel="noopener noreferrer"&gt;themes page&lt;/a&gt; shows every theme on a dark and a light terminal.&lt;/p&gt;

&lt;h2&gt;
  
  
  Recording the demo
&lt;/h2&gt;

&lt;p&gt;The GIF at the top is recorded from a script with &lt;a href="https://github.com/charmbracelet/vhs" rel="noopener noreferrer"&gt;VHS&lt;/a&gt;, so it can be re-recorded after each change. The tape starts the editor with a demo config in a temporary folder, so recording it never touches my real settings, and drives it with keypresses: add a widget by typing its name, browse a few presets, themes and layouts, open the last tab.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I'd do differently
&lt;/h2&gt;

&lt;p&gt;The editor is one file of about 2,100 lines. That was fine while the design was moving, but it's time to split it into one module per screen. Everything else (raw mode, full redraws, a pure frame function, the real renderer as the preview) I'd do the same way again.&lt;/p&gt;

&lt;p&gt;If you're building a small CLI and think you need a heavy TUI framework, try &lt;code&gt;readline&lt;/code&gt; and a few escape codes first. You may not need anything else.&lt;/p&gt;

&lt;p&gt;To test the editor yourself:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx agy-powerline configure
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or test all 23 themes, 3 layouts, and custom meter styles right in your browser with the &lt;a href="https://agy-powerline.com/configure/" rel="noopener noreferrer"&gt;web configurator&lt;/a&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;🤖 &lt;strong&gt;One-shot install with Antigravity:&lt;/strong&gt;&lt;/p&gt;


&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Hey agy, please install agy-powerline by running `npx agy-powerline init --yes`, then tell me to restart agy.
&lt;/code&gt;&lt;/pre&gt;

&lt;/blockquote&gt;

&lt;p&gt;The docs are on &lt;a href="https://agy-powerline.com/" rel="noopener noreferrer"&gt;agy-powerline.com&lt;/a&gt;, with every widget on the &lt;a href="https://agy-powerline.com/widgets/" rel="noopener noreferrer"&gt;widgets page&lt;/a&gt;. The code is MIT: &lt;a href="https://github.com/wassim-azi/agy-powerline" rel="noopener noreferrer"&gt;wassim-azi/agy-powerline&lt;/a&gt;, in &lt;code&gt;src/cli/configure.js&lt;/code&gt; and &lt;code&gt;src/cli/tui-style.js&lt;/code&gt;. Questions and suggestions are welcome in the comments.&lt;/p&gt;

</description>
      <category>node</category>
      <category>javascript</category>
      <category>cli</category>
      <category>showdev</category>
    </item>
    <item>
      <title>Building a statusline for Google's Antigravity CLI that doesn't break on Windows</title>
      <dc:creator>Wassim AZI</dc:creator>
      <pubDate>Wed, 28 Oct 2026 11:00:00 +0000</pubDate>
      <link>https://dev.to/wassim-azi/building-a-statusline-for-googles-antigravity-cli-that-doesnt-break-on-windows-3k7n</link>
      <guid>https://dev.to/wassim-azi/building-a-statusline-for-googles-antigravity-cli-that-doesnt-break-on-windows-3k7n</guid>
      <description>&lt;p&gt;A statusline sounds like a weekend project. Read some JSON, print one colored line, done.&lt;/p&gt;

&lt;p&gt;Then you run it on Windows.&lt;/p&gt;

&lt;p&gt;I built &lt;a href="https://agy-powerline.com/" rel="noopener noreferrer"&gt;agy-powerline&lt;/a&gt;, a statusline for Google's Antigravity CLI (&lt;code&gt;agy&lt;/code&gt;). It's plain Node with no dependencies, and it runs on Windows, macOS, Linux and WSL. Most of the work wasn't drawing the bar. It was making sure the bar starts, every time, on every machine, and never takes the session down with it. Here's what I ran into.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fvk78dgnc4igbmnzv0iit.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fvk78dgnc4igbmnzv0iit.png" alt="agy-powerline under agy's input box in Windows Terminal: a short conversation above, the three-row bar below" width="800" height="98"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  How agy runs a statusline
&lt;/h2&gt;

&lt;p&gt;You give &lt;code&gt;agy&lt;/code&gt; a command in its &lt;code&gt;settings.json&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;"statusLine"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"command"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nl"&gt;"command"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"C:/Users/you/.agy-powerline/statusline.cmd"&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Whenever its state changes, &lt;code&gt;agy&lt;/code&gt; starts that command, writes a JSON payload to its stdin (model, quotas, context window, terminal width and more), and shows what it prints.&lt;/p&gt;

&lt;p&gt;The &lt;a href="https://antigravity.google/docs/cli/statusline/" rel="noopener noreferrer"&gt;official docs&lt;/a&gt; explain the payload and show a bash script you &lt;code&gt;chmod +x&lt;/code&gt;. They don't say how the command is started on each OS, how long it may take, or what happens when it fails. Everything below I found by testing. (If you only need the basic setup, see &lt;a href="https://agy-powerline.com/guides/add-statusline-to-antigravity-cli/" rel="noopener noreferrer"&gt;how to add a status line to Antigravity CLI&lt;/a&gt;.)&lt;/p&gt;

&lt;p&gt;Two details matter a lot:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;On Windows, &lt;code&gt;agy&lt;/code&gt; runs the command through &lt;code&gt;cmd /c&lt;/code&gt;. On macOS and Linux, through &lt;code&gt;sh -c&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;It runs &lt;strong&gt;all the time&lt;/strong&gt;. Anything slow, fragile or noisy shows up right away.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Trap 1: quotes that cmd doesn't understand
&lt;/h2&gt;

&lt;p&gt;The obvious Windows command is &lt;code&gt;"C:\Program Files\nodejs\node.exe" "C:\Users\you\...\statusline.js"&lt;/code&gt;. It doesn't work.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;agy&lt;/code&gt; is written in Go, and Go's &lt;code&gt;os/exec&lt;/code&gt; escapes embedded double quotes as &lt;code&gt;\"&lt;/code&gt; when it builds the Windows command line. That's the C runtime's convention, but &lt;code&gt;cmd&lt;/code&gt; doesn't follow it: it keeps the backslash and the quote as part of the program name, and can't find &lt;code&gt;node.exe&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;So the setting holds no quotes at all. It points at a small launcher, written with forward slashes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight batchfile"&gt;&lt;code&gt;&lt;span class="nd"&gt;@echo&lt;/span&gt; &lt;span class="n"&gt;off&lt;/span&gt;
&lt;span class="k"&gt;setlocal&lt;/span&gt; &lt;span class="nc"&gt;DisableDelayedExpansion&lt;/span&gt;
&lt;span class="s2"&gt;"C:\Program Files\nodejs\node.exe"&lt;/span&gt; &lt;span class="s2"&gt;"%~dp0statusline.js"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The quoting now happens inside the batch file, where &lt;code&gt;cmd&lt;/code&gt; handles it the normal way. A few details:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;%~dp0&lt;/code&gt; is the launcher's own folder, so the script path is never written twice.&lt;/li&gt;
&lt;li&gt;A &lt;code&gt;%&lt;/code&gt; in the Node path is written as &lt;code&gt;%%&lt;/code&gt;, or &lt;code&gt;cmd&lt;/code&gt; would read it as a variable.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;DisableDelayedExpansion&lt;/code&gt; keeps a &lt;code&gt;!&lt;/code&gt; in a path from being expanded.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;cmd&lt;/code&gt; also splits a command line at &lt;code&gt;&amp;amp;&lt;/code&gt;, &lt;code&gt;(&lt;/code&gt;, &lt;code&gt;^&lt;/code&gt;, &lt;code&gt;,&lt;/code&gt;, &lt;code&gt;;&lt;/code&gt; and &lt;code&gt;=&lt;/code&gt;. A launcher in a folder whose path contains one of them never starts, so &lt;code&gt;init&lt;/code&gt; refuses such a folder and says how to pick another (&lt;code&gt;AGY_POWERLINE_HOME&lt;/code&gt;). An error at install time beats a bar that silently never appears.&lt;/p&gt;

&lt;h2&gt;
  
  
  Trap 2: the right Node, the right shell quoting
&lt;/h2&gt;

&lt;p&gt;On macOS and Linux the command is &lt;code&gt;sh -c&lt;/code&gt;, so the paths are single-quoted, which keeps spaces and &lt;code&gt;$&lt;/code&gt; intact:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;'/opt/homebrew/bin/node' '/Users/you/.agy-powerline/statusline.js'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The Node path is &lt;code&gt;process.execPath&lt;/code&gt;, the binary that ran &lt;code&gt;init&lt;/code&gt;, not &lt;code&gt;node&lt;/code&gt; from the &lt;code&gt;PATH&lt;/code&gt;. &lt;code&gt;agy&lt;/code&gt; may not start with your shell's &lt;code&gt;PATH&lt;/code&gt; (with nvm, for example), so a bare &lt;code&gt;node&lt;/code&gt; can resolve to nothing, or to an old system Node.&lt;/p&gt;

&lt;p&gt;WSL had its own version of this. Windows' &lt;code&gt;npx&lt;/code&gt; is often on the WSL &lt;code&gt;PATH&lt;/code&gt; through &lt;code&gt;/mnt/c/...&lt;/code&gt;, and running &lt;code&gt;init&lt;/code&gt; with it would write a Windows Node path into Linux settings. &lt;code&gt;init&lt;/code&gt; and &lt;code&gt;doctor&lt;/code&gt; detect a Windows Node under WSL and refuse to continue.&lt;/p&gt;

&lt;h2&gt;
  
  
  Trap 3: the invisible BOM
&lt;/h2&gt;

&lt;p&gt;Windows PowerShell 5.1 writes UTF-8 files with a byte order mark when you ask for UTF-8 (&lt;code&gt;Set-Content -Encoding UTF8&lt;/code&gt;, &lt;code&gt;Out-File&lt;/code&gt;). &lt;code&gt;JSON.parse&lt;/code&gt; doesn't skip it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nb"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;parse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"\uFEFF{}"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// SyntaxError&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So anything that reads JSON strips it first: agy's &lt;code&gt;settings.json&lt;/code&gt;, the bar's config, imported configs, and the payload on stdin.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;text&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;fs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;readFileSync&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;file&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"utf8"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;replace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;/^&lt;/span&gt;\&lt;span class="n"&gt;uFEFF&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;""&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;One line, but missing it means a config the user edited in the wrong editor breaks the bar for no visible reason.&lt;/p&gt;

&lt;h2&gt;
  
  
  Trap 4: a stdin that never closes
&lt;/h2&gt;

&lt;p&gt;This one took a while to find. Sometimes &lt;code&gt;agy&lt;/code&gt; starts the statusline and keeps its stdin open without writing anything (at the time of writing it's open as &lt;a href="https://github.com/google-antigravity/antigravity-cli/issues/698" rel="noopener noreferrer"&gt;google-antigravity/antigravity-cli#698&lt;/a&gt;). A script that does a blocking read of stdin waits until &lt;code&gt;agy&lt;/code&gt; kills it. After a few kills in a row, &lt;code&gt;agy&lt;/code&gt; turns the custom statusline off.&lt;/p&gt;

&lt;p&gt;The fix on the script side: read stdin asynchronously, with a deadline.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;readStdin&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;timeoutMs&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;resolve&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;chunks&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;done&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;finish&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;complete&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;done&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="n"&gt;done&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="nf"&gt;clearTimeout&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;timer&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="c1"&gt;// An open stdin would keep the process alive after the bar is printed.&lt;/span&gt;
      &lt;span class="nb"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;stdin&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;destroy&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="nf"&gt;resolve&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;Buffer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;concat&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;chunks&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toString&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"utf8"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;complete&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;timer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;setTimeout&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;finish&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;timeoutMs&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nb"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;stdin&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;on&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"data"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;chunk&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;chunks&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;chunk&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nb"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;stdin&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;on&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"end"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;finish&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nb"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;stdin&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;on&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"error"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;finish&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With a 1-second deadline: if stdin closed, render it. If it didn't and nothing arrived, exit 0 with no output. The script is never killed, so it's never counted as a failure.&lt;/p&gt;

&lt;h2&gt;
  
  
  Trap 5: never crash where the bar goes
&lt;/h2&gt;

&lt;p&gt;Whatever the statusline prints ends up in the status bar. A stack trace there is ugly at best, and can quote payload text at worst. So the runtime has a few hard rules:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;An uncaught error prints a short fixed marker (&lt;code&gt;[agy-powerline: error, see agy-powerline.log]&lt;/code&gt;), writes the details to a local log, and exits 0.&lt;/li&gt;
&lt;li&gt;Invalid JSON prints &lt;code&gt;[agy-powerline: invalid JSON]&lt;/code&gt; and says where it broke, without quoting the input.&lt;/li&gt;
&lt;li&gt;When &lt;code&gt;agy&lt;/code&gt; closes the pipe before the bar is written (&lt;code&gt;EPIPE&lt;/code&gt;), that's a normal shutdown, not a crash: exit quietly.&lt;/li&gt;
&lt;li&gt;Text that isn't ours (branch names, the conversation title, command output) is stripped of terminal escape sequences before it's printed.&lt;/li&gt;
&lt;li&gt;The payload holds personal data: your email address, the conversation ID and the path to the transcript. None of it is printed, logged or written to the debug dumps users attach to bug reports.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Start-up time is most of the cost
&lt;/h2&gt;

&lt;p&gt;A statusline is a new process on every refresh, so start-up time matters more than the rendering. On a Windows 11 laptop, agy-powerline's own work is about 0.1 s per refresh. Starting &lt;code&gt;cmd&lt;/code&gt; and Node adds about 0.1 to 0.25 s, depending on how busy the machine is.&lt;/p&gt;

&lt;p&gt;Two things made a measurable difference:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;One file instead of eighteen.&lt;/strong&gt; On Windows, Node spent more time opening the 18 small module files than running them. &lt;code&gt;init&lt;/code&gt; now joins the runtime into a single &lt;code&gt;statusline.js&lt;/code&gt; (each file still gets its own scope, the way Node wraps modules). That cut agy-powerline's share of each refresh by about a third.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No &lt;code&gt;git&lt;/code&gt; process unless needed.&lt;/strong&gt; The branch and dirty state come from reading &lt;code&gt;.git&lt;/code&gt; directly. The ahead/behind counts need &lt;code&gt;git rev-list&lt;/code&gt; (about 60 ms on Windows), so they're cached per pair of commits and recomputed only when the branch or its upstream moves, with a 150 ms timeout.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Fitting any terminal width
&lt;/h2&gt;

&lt;p&gt;The payload includes &lt;code&gt;terminal_width&lt;/code&gt;, and the bar has to fit it. When a row is too wide, it shrinks in steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Widgets drop their labels and keep only their values, then the model name and the meters get shorter.&lt;/li&gt;
&lt;li&gt;Widgets drop out by priority (a custom badge goes before the conversation title, the title before the quotas, the model last).&lt;/li&gt;
&lt;li&gt;As a last resort, the row is cut with &lt;code&gt;…&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Measuring "too wide" is its own small problem. You strip escape sequences first, then count columns: emoji are two wide, combining marks and variation selectors are zero. And terminals don't always agree with each other on emoji width, so a little slack helps.&lt;/p&gt;

&lt;h2&gt;
  
  
  Never lose the user's settings
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;init&lt;/code&gt; edits a file that belongs to another program, so it's careful about it:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It refuses to touch a &lt;code&gt;settings.json&lt;/code&gt; that isn't plain JSON (comments, trailing commas), and tells you what to add by hand.&lt;/li&gt;
&lt;li&gt;It backs up the file before every change, and keeps the very first version in a separate backup that's never replaced (&lt;code&gt;settings.json.agy-powerline.original.bak&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;It only changes the &lt;code&gt;statusLine&lt;/code&gt; key.&lt;/li&gt;
&lt;li&gt;A &lt;code&gt;settings.json&lt;/code&gt; symlinked by a dotfile manager (stow, chezmoi, yadm) stays a link: the change goes into the file it points to.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;uninstall&lt;/code&gt; backs the file up too and removes only the &lt;code&gt;statusLine&lt;/code&gt; key. &lt;code&gt;uninstall --delete&lt;/code&gt; also deletes agy-powerline's files, but only the ones in a fixed list (&lt;code&gt;INSTALLED_FILES&lt;/code&gt;), never a whole folder.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The &lt;a href="https://agy-powerline.com/security/" rel="noopener noreferrer"&gt;security page&lt;/a&gt; lists every file the bar reads and writes and every process it starts.&lt;/p&gt;

&lt;h2&gt;
  
  
  How it's tested
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;CI runs on Windows, macOS and Linux, across Node 20, 22 and 24.&lt;/li&gt;
&lt;li&gt;On the Windows runner, a smoke test runs &lt;code&gt;init&lt;/code&gt; in a home folder with a space in its path, then starts the command it wrote through a real &lt;code&gt;cmd.exe /d /c&lt;/code&gt;, the way agy does. It fails on a non-zero exit code, on anything written to stderr, or if the bar didn't render.&lt;/li&gt;
&lt;li&gt;Snapshot tests pin the rendered bar for each layout and fixture payload, with the clock, time zone and terminal width frozen.&lt;/li&gt;
&lt;li&gt;Property-based tests with &lt;code&gt;fast-check&lt;/code&gt; (a fixed seed, 300 runs per property) throw random and malformed payloads at the renderer: it must never throw, print no control characters besides its own colors, and fit every row into widths from 40 to 240 columns. Another one pipes random input into the runtime script, which must exit 0 without a stack trace.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What I'd tell someone writing a statusline
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Test on Windows on day one. Most of these traps don't exist on macOS.&lt;/li&gt;
&lt;li&gt;Read stdin with a deadline.&lt;/li&gt;
&lt;li&gt;Exit 0, always. Print nothing rather than an error.&lt;/li&gt;
&lt;li&gt;Measure start-up, not just rendering.&lt;/li&gt;
&lt;li&gt;Kill what you start. A timeout that stops waiting for a child process doesn't always stop the process: on Windows, a command run through &lt;code&gt;cmd&lt;/code&gt; can outlive its timeout. Kill the whole process tree. (That one is still on my own list, for the bar's shell-command widget.)&lt;/li&gt;
&lt;li&gt;Treat the payload as untrusted text, and keep its personal fields out of your logs.&lt;/li&gt;
&lt;li&gt;Never start &lt;code&gt;agy&lt;/code&gt; itself, or anything slow, from the statusline. One user on Google's forum &lt;a href="https://discuss.ai.google.dev/t/antigravitys-spaghetti-code-for-statusline/171395" rel="noopener noreferrer"&gt;pointed it at &lt;code&gt;agy&lt;/code&gt;&lt;/a&gt; and ended up with about 1,000 &lt;code&gt;agy.exe&lt;/code&gt; processes.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The docs are on &lt;a href="https://agy-powerline.com/" rel="noopener noreferrer"&gt;agy-powerline.com&lt;/a&gt;, and the code is MIT on GitHub: &lt;a href="https://github.com/wassim-azi/agy-powerline" rel="noopener noreferrer"&gt;wassim-azi/agy-powerline&lt;/a&gt;. If you want to try it out on Windows, macOS, or Linux, the &lt;a href="https://agy-powerline.com/install/" rel="noopener noreferrer"&gt;install page&lt;/a&gt; has every option, or you can run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx agy-powerline init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or have your agent install it directly in an open &lt;code&gt;agy&lt;/code&gt; session:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Hey agy, please install agy-powerline by running &lt;code&gt;npx agy-powerline init --yes&lt;/code&gt;, then tell me to restart agy."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If the bar doesn't show up on your machine, the &lt;a href="https://agy-powerline.com/troubleshooting/" rel="noopener noreferrer"&gt;troubleshooting page&lt;/a&gt; starts with &lt;code&gt;npx agy-powerline doctor&lt;/code&gt;. And if you've hit other Windows traps with Node CLIs, I'd like to hear about them in the comments.&lt;/p&gt;

</description>
      <category>node</category>
      <category>windows</category>
      <category>cli</category>
      <category>showdev</category>
    </item>
    <item>
      <title>What Antigravity CLI actually sends to your statusline script (field by field)</title>
      <dc:creator>Wassim AZI</dc:creator>
      <pubDate>Tue, 27 Oct 2026 12:00:00 +0000</pubDate>
      <link>https://dev.to/wassim-azi/what-antigravity-cli-actually-sends-to-your-statusline-script-field-by-field-5a48</link>
      <guid>https://dev.to/wassim-azi/what-antigravity-cli-actually-sends-to-your-statusline-script-field-by-field-5a48</guid>
      <description>&lt;p&gt;If you write your own statusline for Google's Antigravity CLI (&lt;code&gt;agy&lt;/code&gt;), you start from the &lt;a href="https://antigravity.google/docs/cli/statusline/" rel="noopener noreferrer"&gt;official docs&lt;/a&gt;: &lt;code&gt;agy&lt;/code&gt; runs your command when its state changes, pipes a JSON payload to its stdin, and shows what the command prints.&lt;/p&gt;

&lt;p&gt;The docs list the payload's fields. But when I captured real payloads for &lt;a href="https://agy-powerline.com/" rel="noopener noreferrer"&gt;agy-powerline&lt;/a&gt;, they didn't quite match: some documented fields never showed up, a few useful ones arrived without being documented, and the quota buckets, the part most people want, aren't listed at all.&lt;/p&gt;

&lt;p&gt;This is the payload as it actually arrived, captured from &lt;code&gt;agy&lt;/code&gt; 1.3.0 to 1.4.0 on a Google AI Pro account, in October 2026. Your plan, version and OS may differ: treat every field as optional. The full field list is also on the site, as the &lt;a href="https://agy-powerline.com/docs/payload/" rel="noopener noreferrer"&gt;payload reference&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fh61ouw9oygpkw1lc2u0t.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fh61ouw9oygpkw1lc2u0t.jpg" alt="agy starts your statusline script on every refresh and sends it JSON on stdin (model, context_window, quota with 5 buckets, subagents, vcs with only its type, terminal_width); the text the script prints on stdout becomes the bar under the input box" width="800" height="447"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  A real payload
&lt;/h2&gt;

&lt;p&gt;Trimmed, with personal values replaced:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;"cwd"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"/home/user/project"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"session_id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"00000000-0000-0000-0000-000000000000"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"conversation_id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"00000000-0000-0000-0000-000000000000"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"conversation_title"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"hello"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"transcript_path"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"/home/user/.gemini/antigravity-cli/conversations/…"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"model"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Gemini 3.8 Flash (High)"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nl"&gt;"display_name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Gemini 3.8 Flash (High)"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nl"&gt;"effort"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"high"&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"workspace"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;"current_dir"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"/home/user/project"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"project_dir"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"/home/user/project"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"version"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"1.3.3"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"context_window"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;"total_input_tokens"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;33129&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nl"&gt;"total_output_tokens"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;10161&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nl"&gt;"context_window_size"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1048576&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nl"&gt;"used_percentage"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;3.159&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nl"&gt;"remaining_percentage"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;96.841&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nl"&gt;"current_usage"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nl"&gt;"input_tokens"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;3353&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="nl"&gt;"output_tokens"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;187&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="nl"&gt;"cache_creation_input_tokens"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="nl"&gt;"cache_read_input_tokens"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;24680&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"exceeds_200k_tokens"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"product"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"antigravity"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"quota"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;"gemini-5h"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;"remaining_fraction"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;0.987&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"reset_time"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"2026-10-13T00:36:57Z"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"reset_in_seconds"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;15752&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"agent_state"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"idle"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"vcs"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"git"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"cycle_mode"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"accept-edits"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"sandbox"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;"enabled"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"subagents"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"research"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"role"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"List the files in the project folder."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"status"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"completed"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"plan_tier"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Google AI Pro"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"email"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"user@example.com"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"terminal_width"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;198&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"vim"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;"mode"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"NORMAL"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  The quota buckets
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;quota&lt;/code&gt; is an object keyed by bucket. The docs' example shows only &lt;code&gt;gemini-weekly&lt;/code&gt;. Here's every bucket I've seen:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Bucket&lt;/th&gt;
&lt;th&gt;What it is&lt;/th&gt;
&lt;th&gt;Window&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;gemini-5h&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Gemini models&lt;/td&gt;
&lt;td&gt;5 hours&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;gemini-weekly&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Gemini models&lt;/td&gt;
&lt;td&gt;7 days&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;3p-5h&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Third-party models (Claude, GPT)&lt;/td&gt;
&lt;td&gt;5 hours&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;3p-weekly&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Third-party models&lt;/td&gt;
&lt;td&gt;7 days&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;gemini-argon-wtu-weekly&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Gemini 4 Argon's own quota, on Google AI Pro (since mid-October 2026)&lt;/td&gt;
&lt;td&gt;7 days&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Each bucket has:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;remaining_fraction&lt;/code&gt;: from 0 to 1. Multiply by 100 for "percent left".&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;reset_time&lt;/code&gt;: an ISO timestamp. Both &lt;code&gt;…T00:36:57Z&lt;/code&gt; and &lt;code&gt;…T00:36:57.000Z&lt;/code&gt; show up, depending on the version, so parse it with &lt;code&gt;Date.parse()&lt;/code&gt; rather than a regex.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;reset_in_seconds&lt;/code&gt;: optional according to the docs. If it's missing, compute it from &lt;code&gt;reset_time&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Sometimes &lt;code&gt;"disabled": true&lt;/code&gt;. I skip those buckets.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A few things worth knowing:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The Argon bucket arrives whatever model you're using&lt;/strong&gt;, not only when Argon is selected. To show "the quota that matters right now", pick the bucket group from &lt;code&gt;model.id&lt;/code&gt;: Argon models → the Argon bucket, other Gemini models → &lt;code&gt;gemini-*&lt;/code&gt;, everything else → &lt;code&gt;3p-*&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;How far into the window you are&lt;/strong&gt; needs no extra field: &lt;code&gt;1 - reset_in_seconds / window_length&lt;/code&gt;, with 18,000 s for 5-hour buckets and 604,800 s for 7-day ones. Compare it with the share you've used, and you know if you're ahead of or behind pace. The &lt;a href="https://agy-powerline.com/quota-calculator/" rel="noopener noreferrer"&gt;quota calculator&lt;/a&gt; does this math for you.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The values come from &lt;code&gt;agy&lt;/code&gt;&lt;/strong&gt;, as of its last refresh. A statusline can't be more up to date than the payload.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Fields that arrive but aren't documented
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Field&lt;/th&gt;
&lt;th&gt;Seen as&lt;/th&gt;
&lt;th&gt;Notes&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;cycle_mode&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;"accept-edits"&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;The approval mode. Missing from some captures, so treat "absent" as the default mode. The docs list &lt;code&gt;execution_mode&lt;/code&gt; instead, which I've never seen.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;subagents&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;[{ name, role, status }]&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;status&lt;/code&gt; was &lt;code&gt;"running"&lt;/code&gt; or &lt;code&gt;"completed"&lt;/code&gt;. &lt;code&gt;role&lt;/code&gt; is a whole sentence (the task you gave it), so cut it before printing.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;conversation_title&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;"hello"&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Appears once the conversation has a title.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;model.effort&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;"high"&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;The reasoning effort.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Fields that are documented but never showed up
&lt;/h2&gt;

&lt;p&gt;On my machine, with a Google AI Pro account, these never appeared:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;execution_mode&lt;/code&gt; (see &lt;code&gt;cycle_mode&lt;/code&gt; above).&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;pending_input_count&lt;/code&gt;, even with a prompt queued.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;tool_confirmation_pending&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;vcs.branch&lt;/code&gt;, &lt;code&gt;vcs.client&lt;/code&gt; and &lt;code&gt;vcs.dirty&lt;/code&gt;: &lt;code&gt;vcs&lt;/code&gt; only ever held &lt;code&gt;type&lt;/code&gt; (see &lt;a href="https://github.com/google-antigravity/antigravity-cli/issues/739" rel="noopener noreferrer"&gt;antigravity-cli#739&lt;/a&gt;). Starting &lt;code&gt;git&lt;/code&gt; on every refresh is slow on Windows (an ahead/behind count alone took about 60 ms), so read the branch from &lt;code&gt;.git/HEAD&lt;/code&gt; yourself and cache anything that needs &lt;code&gt;git&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;sandbox.allow_network&lt;/code&gt;: only &lt;code&gt;enabled&lt;/code&gt; arrived.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If your script depends on one of these, give it a fallback.&lt;/p&gt;

&lt;h2&gt;
  
  
  Gotchas
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;model.id&lt;/code&gt; isn't an API id.&lt;/strong&gt; It held the same text as &lt;code&gt;display_name&lt;/code&gt;, effort included: &lt;code&gt;"Gemini 3.8 Flash (High)"&lt;/code&gt;. Match on substrings (&lt;code&gt;includes("argon")&lt;/code&gt;), not on exact ids.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;used_percentage&lt;/code&gt; counts input, not output.&lt;/strong&gt; In every real capture it equals &lt;code&gt;total_input_tokens / context_window_size&lt;/code&gt; (33,129 / 1,048,576 = 3.159% above). &lt;code&gt;total_output_tokens&lt;/code&gt; isn't in it. If you add output tokens to your token count, the count stops matching &lt;code&gt;agy&lt;/code&gt;'s own percentage, so show the input count, or work the count out from the percentage.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;exceeds_200k_tokens&lt;/code&gt; can be &lt;code&gt;null&lt;/code&gt;&lt;/strong&gt; before the first request, according to the docs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;agent_state&lt;/code&gt;&lt;/strong&gt; takes &lt;code&gt;idle&lt;/code&gt;, &lt;code&gt;thinking&lt;/code&gt;, &lt;code&gt;working&lt;/code&gt;, &lt;code&gt;tool_use&lt;/code&gt; or &lt;code&gt;initializing&lt;/code&gt;, per the docs. I've seen &lt;code&gt;idle&lt;/code&gt;, &lt;code&gt;working&lt;/code&gt; and &lt;code&gt;tool_use&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;terminal_width&lt;/code&gt; is the live width.&lt;/strong&gt; Use it to fit your output: a line wider than the terminal wraps and pushes the bar out of place.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;vim&lt;/code&gt; appears only with Vim mode on&lt;/strong&gt;, with &lt;code&gt;mode&lt;/code&gt; set to &lt;code&gt;NORMAL&lt;/code&gt;, &lt;code&gt;INSERT&lt;/code&gt; and so on.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The cache numbers
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;context_window&lt;/code&gt; holds totals for the whole session, and &lt;code&gt;current_usage&lt;/code&gt; the numbers for the latest request:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="nl"&gt;"current_usage"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;"input_tokens"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;3353&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"output_tokens"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;187&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"cache_creation_input_tokens"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"cache_read_input_tokens"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;24680&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;From those you can work out how much of the latest prompt was read from the prompt cache:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cache_hit_pct = cache_read_input_tokens / (input_tokens + cache_read_input_tokens) * 100
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the payload above, &lt;code&gt;24,680 / (3,353 + 24,680) * 100 = 88%&lt;/code&gt;: most of the prompt came from the cache. When &lt;code&gt;cache_read_input_tokens&lt;/code&gt; is 0 and &lt;code&gt;cache_creation_input_tokens&lt;/code&gt; isn't, nothing was read from the cache and the prompt was written to it: a cold start.&lt;/p&gt;

&lt;h2&gt;
  
  
  Subagents
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;subagents&lt;/code&gt; lists the child tasks of the conversation, with &lt;code&gt;status&lt;/code&gt; set to &lt;code&gt;"running"&lt;/code&gt; or &lt;code&gt;"completed"&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="nl"&gt;"subagents"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"research"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"role"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"List the files in the project folder."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"status"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"completed"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;role&lt;/code&gt; is the whole instruction the subagent got, so cut it short before you print it, or it wraps the line.&lt;/p&gt;

&lt;h2&gt;
  
  
  Personal data in the payload
&lt;/h2&gt;

&lt;p&gt;The payload holds your &lt;code&gt;email&lt;/code&gt;, &lt;code&gt;session_id&lt;/code&gt; and &lt;code&gt;conversation_id&lt;/code&gt;, and the full &lt;code&gt;transcript_path&lt;/code&gt;. Your script receives them on every refresh, so be careful with them:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Don't print them, and don't write them to a log.&lt;/li&gt;
&lt;li&gt;If you save payloads to debug, strip those fields first, and replace paths before you share a file in an issue.&lt;/li&gt;
&lt;li&gt;Treat every string (&lt;code&gt;cwd&lt;/code&gt;, &lt;code&gt;conversation_title&lt;/code&gt;, subagent roles) as untrusted text: strip terminal escape sequences before printing, or a crafted value can change your terminal's state.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Reading stdin safely
&lt;/h2&gt;

&lt;p&gt;One more thing the docs don't mention: &lt;code&gt;agy&lt;/code&gt; can start the command and keep stdin open without writing anything (&lt;a href="https://github.com/google-antigravity/antigravity-cli/issues/698" rel="noopener noreferrer"&gt;antigravity-cli#698&lt;/a&gt;). A blocking read then waits until &lt;code&gt;agy&lt;/code&gt; kills the script, and after a few kills &lt;code&gt;agy&lt;/code&gt; turns the statusline off. Read stdin with a deadline (one second works), and exit 0 with no output if nothing arrived. Also strip a leading byte order mark (&lt;code&gt;\uFEFF&lt;/code&gt;) before &lt;code&gt;JSON.parse&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Capture your own
&lt;/h2&gt;

&lt;p&gt;To see exactly what your &lt;code&gt;agy&lt;/code&gt; sends, point the statusline at a script that saves stdin to a file before rendering (&lt;a href="https://agy-powerline.com/guides/add-statusline-to-antigravity-cli/" rel="noopener noreferrer"&gt;how to add a status line to Antigravity CLI&lt;/a&gt; shows how to set one up). With agy-powerline installed, set &lt;code&gt;AGY_POWERLINE_DEBUG=1&lt;/code&gt; before starting &lt;code&gt;agy&lt;/code&gt;: each refresh saves the payload to &lt;code&gt;~/.agy-powerline/last-payload.json&lt;/code&gt;, with the email and IDs removed and paths replaced, so it's safe to share.&lt;/p&gt;

&lt;p&gt;If you see a field or a bucket that isn't listed here (a &lt;code&gt;cost&lt;/code&gt; object, another quota bucket, &lt;code&gt;execution_mode&lt;/code&gt; in plan mode), I'd like to hear about it: comment below or &lt;a href="https://github.com/wassim-azi/agy-powerline/issues" rel="noopener noreferrer"&gt;open an issue&lt;/a&gt; with your dump. I'll update this list.&lt;/p&gt;

&lt;p&gt;To install &lt;code&gt;agy-powerline&lt;/code&gt; and start rendering these wire payloads right away:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx agy-powerline init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;a href="https://agy-powerline.com/install/" rel="noopener noreferrer"&gt;install page&lt;/a&gt; covers what &lt;code&gt;init&lt;/code&gt; changes, the agy plugin route, WSL and removing it.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;🤖 &lt;strong&gt;One-shot install with Antigravity:&lt;/strong&gt;&lt;/p&gt;


&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Hey agy, please install agy-powerline by running `npx agy-powerline init --yes`, then tell me to restart agy.
&lt;/code&gt;&lt;/pre&gt;

&lt;/blockquote&gt;

</description>
      <category>gemini</category>
      <category>cli</category>
      <category>json</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>See your Antigravity CLI quotas without typing /usage (Gemini 5h/7d, Claude and Argon)</title>
      <dc:creator>Wassim AZI</dc:creator>
      <pubDate>Tue, 20 Oct 2026 19:21:53 +0000</pubDate>
      <link>https://dev.to/wassim-azi/see-your-antigravity-cli-quotas-without-typing-usage-gemini-5h7d-claudegpt-and-argon-19fc</link>
      <guid>https://dev.to/wassim-azi/see-your-antigravity-cli-quotas-without-typing-usage-gemini-5h7d-claudegpt-and-argon-19fc</guid>
      <description>&lt;p&gt;Think of it as &lt;strong&gt;&lt;code&gt;htop&lt;/code&gt; for Google Antigravity CLI&lt;/strong&gt;: an always-on display of your quotas, your context window and how fast you're using them.&lt;/p&gt;

&lt;p&gt;If you've ever hit your Google AI Pro limit in the middle of an intense coding session, you know the feeling of &lt;strong&gt;context window blindness&lt;/strong&gt;: one moment the agent is cruising through file edits, the next it grinds to a halt, and you discover your 5-hour quota ran out twenty minutes ago.&lt;/p&gt;

&lt;p&gt;The traditional workaround is typing &lt;code&gt;/usage&lt;/code&gt;, squinting at the numbers, and going back to work. A few prompt turns later, you find yourself typing &lt;code&gt;/usage&lt;/code&gt; again.&lt;/p&gt;

&lt;p&gt;Since mid-October 2026, there is even more to keep track of. On Google AI Pro, Gemini 4 Argon has its own weekly quota pool, completely separate from the standard Gemini bucket. So developers now balance three distinct quota pools:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Gemini&lt;/strong&gt;: a 5-hour window and a 7-day window, each with its own reset time.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Third-party models&lt;/strong&gt; (Claude, GPT): their own 5-hour and 7-day windows.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Gemini 4 Argon&lt;/strong&gt;: an independent weekly quota on Google AI Pro.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I wanted all of that on screen, all the time, without asking for it or breaking flow state. This post explains which quota metrics &lt;code&gt;agy&lt;/code&gt; exposes to its statusline wire format, and how to display them persistently using &lt;a href="https://agy-powerline.com/" rel="noopener noreferrer"&gt;agy-powerline&lt;/a&gt;, a zero-dependency statusline engine.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ffiah38nzjqfbl5ogsnmc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ffiah38nzjqfbl5ogsnmc.png" alt="agy-powerline in agy's status bar, three rows: model, context and git; Gemini 5h and 7d quotas with pace markers and resets; Claude/GPT and Argon weekly quotas" width="800" height="88"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The quota buckets agy sends
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;agy&lt;/code&gt; has a &lt;code&gt;statusLine&lt;/code&gt; setting: it runs a command of your choice and pipes it a JSON payload, as described in the &lt;a href="https://antigravity.google/docs/cli/statusline/" rel="noopener noreferrer"&gt;official docs&lt;/a&gt;. The docs' example payload shows a single quota bucket. In practice, &lt;code&gt;agy&lt;/code&gt; sends up to five:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Bucket&lt;/th&gt;
&lt;th&gt;What it is&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;gemini-5h&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Gemini, 5-hour window&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;gemini-weekly&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Gemini, 7-day window&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;3p-5h&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Third-party models (Claude, GPT), 5-hour window&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;3p-weekly&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Third-party models, 7-day window&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;gemini-argon-wtu-weekly&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Gemini 4 Argon's own weekly quota, on Google AI Pro&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Each one looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="nl"&gt;"gemini-5h"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;"remaining_fraction"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;0.979&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"reset_time"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"2026-10-16T23:59:02.000Z"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"reset_in_seconds"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;17042&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;remaining_fraction&lt;/code&gt; goes from 0 to 1. A bucket can also come with &lt;code&gt;"disabled": true&lt;/code&gt;, and is best ignored then. The Argon bucket is sent whatever model you're using, so you can keep an eye on it before you switch to Argon.&lt;/p&gt;

&lt;p&gt;So the data is there. A statusline only has to read it and draw it. For a shorter walkthrough of the quota windows and how to read the meters, see the &lt;a href="https://agy-powerline.com/guides/antigravity-quota/" rel="noopener noreferrer"&gt;Antigravity quota guide&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Install
&lt;/h2&gt;

&lt;p&gt;You need Node.js 20 or newer. Then run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx agy-powerline init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;init&lt;/code&gt; installs the runtime as one file in &lt;code&gt;~/.agy-powerline&lt;/code&gt;, backs up agy's &lt;code&gt;settings.json&lt;/code&gt;, and sets its &lt;code&gt;statusLine&lt;/code&gt; command. On a first install it asks you for a preset, a layout and a theme, with a live terminal preview of each. Restart &lt;code&gt;agy&lt;/code&gt; once and the bar is live.&lt;/p&gt;

&lt;p&gt;The setting points at the exact Node binary that ran &lt;code&gt;init&lt;/code&gt;, so the bar doesn't depend on &lt;code&gt;agy&lt;/code&gt; finding &lt;code&gt;node&lt;/code&gt; on its &lt;code&gt;PATH&lt;/code&gt;. That matters with nvm, or when &lt;code&gt;agy&lt;/code&gt; is started from somewhere other than your shell.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;🤖 &lt;strong&gt;Vibe-coding? Have your agent install it for you:&lt;/strong&gt;&lt;br&gt;
If you already have an &lt;code&gt;agy&lt;/code&gt; session open, paste this prompt into your conversation:&lt;/p&gt;


&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Hey agy, please install agy-powerline by running `npx agy-powerline init --yes --preset quotas`, then tell me to restart agy.
&lt;/code&gt;&lt;/pre&gt;

&lt;/blockquote&gt;

&lt;p&gt;If you'd rather stay inside &lt;code&gt;agy&lt;/code&gt; using native extensions, it's also an agy plugin:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;agy plugin install https://github.com/wassim-azi/agy-powerline
/agy-powerline-setup
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It works natively on Windows (cmd and PowerShell), macOS, Linux and WSL. On Windows it doesn't need bash or &lt;code&gt;jq&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Quota watch preset
&lt;/h2&gt;

&lt;p&gt;The default bar shows the model, context, git and your Gemini quotas. If quotas are what you care about most, switch to the preset made for them:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx agy-powerline preset quotas
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It draws three rows:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Your plan and the model in use.&lt;/li&gt;
&lt;li&gt;Gemini 5h and 7d side by side, each with its reset timer.&lt;/li&gt;
&lt;li&gt;Third-party 5h and 7d, then Argon's weekly quota and its reset.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;A widget with nothing to show hides itself: without the Argon bucket in the payload, the Argon widgets simply don't appear.&lt;/p&gt;

&lt;h2&gt;
  
  
  Reading the pace marker
&lt;/h2&gt;

&lt;p&gt;A percentage alone doesn't tell you much. "40% left" is fine if the window resets in 20 minutes, and bad news if it resets in 4 days.&lt;/p&gt;

&lt;p&gt;So each quota meter carries a pace marker: a mark at the point the time window has reached. Here are two meters from the demo data (in the terminal, the colors make the fill stand out):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;⏳ •••••●••••••  72.0% rem   🔄 Reset: 2hr 47m
📅 •••••••••●••  21.0% rem   🔄 Reset: 1d 17h
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The meter fills from the left as you use quota. The marker (&lt;code&gt;●&lt;/code&gt;) shows how far into the window you are.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;5h quota&lt;/strong&gt;: it resets in 2h 47m, so 2h 13m of the 5 hours have passed, about 44%. You've used 28%. The fill is behind the marker: you're using quota slower than time passes, so you can relax.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;7d quota&lt;/strong&gt;: it resets in 1d 17h, so about 76% of the week has passed. You've used 79%. The fill is just past the marker: at this rate, you'll run out shortly before the reset.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The marker needs no extra data: it comes from &lt;code&gt;reset_in_seconds&lt;/code&gt; and the fixed 5-hour and 7-day window lengths. If you find it noisy, press &lt;code&gt;r&lt;/code&gt; in &lt;code&gt;configure&lt;/code&gt; to turn it off. To try the math with your own numbers, the &lt;a href="https://agy-powerline.com/quota-calculator/" rel="noopener noreferrer"&gt;quota calculator&lt;/a&gt; tells you whether a quota will last until it resets.&lt;/p&gt;

&lt;p&gt;Prefer to see &lt;em&gt;when&lt;/em&gt; a quota resets rather than how long until it does? Set the reset widget's format to a clock time:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"fiveHourReset"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"format"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"time"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  One meter for "the quota that matters right now"
&lt;/h2&gt;

&lt;p&gt;If you want something smaller, the &lt;code&gt;quota&lt;/code&gt; widget shows only the bucket closest to running out, for the model you're using:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the Argon bucket when Argon is the model,&lt;/li&gt;
&lt;li&gt;the other Gemini buckets for other Gemini models,&lt;/li&gt;
&lt;li&gt;the third-party buckets for Claude and GPT.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The &lt;code&gt;compact&lt;/code&gt; preset uses it to fit everything on one line:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx agy-powerline preset compact
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Still too wide for a small terminal? Minimalist mode (&lt;code&gt;m&lt;/code&gt; in &lt;code&gt;configure&lt;/code&gt;) drops every label and keeps the values. And on any width, the bar drops labels and shortens meters first, then the least important widgets, so it never wraps. Here's the bar from the top of this post in a window under 80 columns:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fjfoufej4axbyq6ypve8y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fjfoufej4axbyq6ypve8y.png" alt="The same three-row bar in a window under 80 columns: the gaps between widgets shrink and every widget still fits" width="797" height="135"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Tracking daily and weekly token spend without API calls
&lt;/h2&gt;

&lt;p&gt;Quota windows (5-hour and 7-day resets) tell you how fast you're running right now, but they don't answer another common question: &lt;em&gt;How many total tokens did I burn today across all my conversations?&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The statusline payload sends context for the active session, but doesn't track historical usage. To solve that, &lt;code&gt;agy-powerline&lt;/code&gt; includes &lt;code&gt;tokensToday&lt;/code&gt; and &lt;code&gt;tokensWeek&lt;/code&gt; widgets. They read Antigravity's local conversation files in &lt;code&gt;~/.gemini/antigravity-cli/conversations/&lt;/code&gt; directly: no API keys, no network calls, no telemetry. They need Node 22.13 or newer, which has SQLite built in; on older Node they stay hidden, and &lt;code&gt;npx agy-powerline doctor&lt;/code&gt; says why.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;tokens&lt;/code&gt; preset puts them on the bar:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx agy-powerline preset tokens
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It shows the context tokens, the session's tokens in and out and the cache hit rate, with today's and the last 7 days' totals on a second row.&lt;/p&gt;

&lt;h2&gt;
  
  
  Make it warn you
&lt;/h2&gt;

&lt;p&gt;Quota and context meters switch to a caution color, then a danger color, as they run low. You can pick the levels per widget, and make a widget blink when it crosses the danger level:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx agy-powerline configure
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Select a widget, press Enter, and change its caution and danger levels. The live preview at the bottom of the screen follows every change, and &lt;code&gt;q&lt;/code&gt; saves and quits. A running &lt;code&gt;agy&lt;/code&gt; picks up the change on its next refresh.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fraw.githubusercontent.com%2Fwassim-azi%2Fagy-powerline%2Fmain%2Fassets%2Fdemo.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fraw.githubusercontent.com%2Fwassim-azi%2Fagy-powerline%2Fmain%2Fassets%2Fdemo.gif" alt="agy-powerline's configure editor: adding Argon's weekly quota, then browsing presets, themes and layouts with a live preview" width="760" height="453"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;While you're in &lt;code&gt;configure&lt;/code&gt;, the tabs at the top let you try the presets, &lt;a href="https://agy-powerline.com/themes/" rel="noopener noreferrer"&gt;23 themes&lt;/a&gt; (two of them color-blind safe), three layouts (Powerline pills, plain colored lines, or a classic text bar with block meters) and pill shapes. You can also customize how meters render: classic &lt;code&gt;blocks&lt;/code&gt;, minimalist &lt;code&gt;line&lt;/code&gt;, geometric &lt;code&gt;rings&lt;/code&gt; (&lt;code&gt;●●●○○○&lt;/code&gt;), or a &lt;code&gt;ramp&lt;/code&gt; where each filled cell is shaded from the theme's ok color through caution to danger.&lt;/p&gt;

&lt;p&gt;Prefer a browser? The same options are in the &lt;a href="https://agy-powerline.com/configure/" rel="noopener noreferrer"&gt;web configurator&lt;/a&gt;, which exports a config file you can import.&lt;/p&gt;

&lt;h2&gt;
  
  
  How fresh are the numbers?
&lt;/h2&gt;

&lt;p&gt;The bar shows exactly what &lt;code&gt;agy&lt;/code&gt; sends, as of its last refresh: &lt;code&gt;agy&lt;/code&gt; runs the statusline when its state changes, and the quota values come from &lt;code&gt;agy&lt;/code&gt; itself. agy-powerline makes no network calls of its own, so it can't be more up to date than &lt;code&gt;agy&lt;/code&gt;, but it also can't disagree with it.&lt;/p&gt;

&lt;h2&gt;
  
  
  What else it won't do
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;No telemetry, no runtime dependencies.&lt;/strong&gt; Everything comes from the payload, from your &lt;code&gt;.git&lt;/code&gt; folder and from your OS.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Your settings are safe.&lt;/strong&gt; &lt;code&gt;init&lt;/code&gt; refuses to edit a &lt;code&gt;settings.json&lt;/code&gt; it can't parse, and keeps a backup of the original.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Want agy's own line too?&lt;/strong&gt; &lt;code&gt;npx agy-powerline init --stack&lt;/code&gt; draws the bar below the built-in one instead of replacing it.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To remove it: &lt;code&gt;npx agy-powerline uninstall&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Feedback welcome
&lt;/h2&gt;

&lt;p&gt;The docs are on &lt;a href="https://agy-powerline.com/" rel="noopener noreferrer"&gt;agy-powerline.com&lt;/a&gt; and the code is on &lt;a href="https://github.com/wassim-azi/agy-powerline" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;. If a quota or a field you care about is missing, open an issue: I build widgets from what &lt;code&gt;agy&lt;/code&gt; actually sends, so a payload from your setup helps a lot. &lt;code&gt;npx agy-powerline report&lt;/code&gt; writes a privacy-safe bug report, and the &lt;a href="https://agy-powerline.com/troubleshooting/#capturing-the-payload" rel="noopener noreferrer"&gt;troubleshooting page&lt;/a&gt; shows how to capture a payload.&lt;/p&gt;

&lt;p&gt;What do you keep checking with &lt;code&gt;/usage&lt;/code&gt; that you'd rather see all the time?&lt;/p&gt;

</description>
      <category>showdev</category>
      <category>gemini</category>
      <category>cli</category>
      <category>productivity</category>
    </item>
  </channel>
</rss>
