Skip to content
Projects

weby-homelab/antigravity-cli-statusline

View on GitHub

About

An advanced, responsive, and high-information statusline plugin for Antigravity CLI

Developer Tools

How these counts are measured

Measured star growth

in 24h
0
in 7 days
+9
in 15 days
+20
in 1 month
+30

Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.

README.md

Original

Antigravity CLI Statusline

Latest release Platforms

Add an adaptive statusline to Antigravity CLI. The Bash renderer supports Linux and macOS; the PowerShell renderer supports Windows. Both read the CLI’s JSON payload from standard input and supplement it with local Git and host data when available.

Antigravity CLI Statusline in a medium terminal

[!NOTE] The Weby Homelab community fork configures this statusline during installation. These installers target ~/.gemini/antigravity-cli/settings.json. On Windows, they use %USERPROFILE%\.gemini\antigravity-cli\settings.json. If your CLI build reads settings elsewhere, add the statusLine block to its settings file manually. See the official status line customization guide for the payload schema.

What the statusline shows

The renderers combine Antigravity CLI payload data with local Git and operating-system checks. Available fields include:

  • Agent and Vim state: idle, thinking, working, and tool_use map to READY, THINKING, WORKING, and TOOL. Other agent states appear in uppercase. Vim mode appears when the payload contains vim.mode.
  • Model and session: model ID or display name, CLI version, and the first eight characters of the conversation ID. The conversation ID has an 80-column minimum; CLI version has a 120-column minimum.
  • Account: plan tier and account identifier from plan_tier and email (truncated to 25 characters). These fields have a 130-column minimum.
  • Workspace: shortened working directory and branch/dirty state. Payload-supplied VCS values are used when present. If the payload has no branch, the local Git fallback checks tracked working-tree changes; its git status --porcelain -uno command ignores untracked files.
  • Context and tokens: context usage bar, percentage, used-token count, and context limit when available. If both context_window.used_percentage and context_window.context_window_size are positive, the used-token count is round(context_window.used_percentage × context_window.context_window_size / 100). Otherwise, the renderer uses a positive context_window.total_tokens, then a positive context_window.total_input_tokens, and finally the sum of context_window.total_input_tokens and context_window.total_output_tokens. Both renderers can derive a missing context limit from positive used-token count and percentage; PowerShell can also derive a missing percentage from positive used count and limit. When used tokens are positive, the renderers show total input/output tokens and current-turn token counts (turn: requires at least 100 columns in PowerShell).
  • Cost: session spend in US dollars from cost.total_usd (with cost.total_cost_usd fallback), formatted as <$0.0001, four decimals below $0.00995, or two decimals at $0.00995 and above, prefixed with ~ when cost.estimated is true, and | sub: breakdown when cost.subagent_usd is positive.
  • Quota: model-aware selection between Gemini and third-party quota buckets, remaining-use bars, and reset countdowns when the payload includes them. The renderer uses available buckets as a fallback when the preferred bucket is missing. Bash classifies third-party models by model ID; PowerShell checks both model ID and display name.
  • Execution: sandbox network state, artifact count for the conversation, subagent count (omitted at 0 in Bash; always shown in PowerShell unless --no-subagents / -NoSubagents is set), and running background-task count.
  • Host: hostname, Tailscale IPv4 address when detectable (truncated to 20 characters in Bash, 25 in PowerShell; CLI version truncated to 10 characters in Bash, 16 in PowerShell), and power or battery state when detectable. Host diagnostics in the header have a 110-column minimum. If no battery or AC status is detected on a desktop/server, the renderer may assume AC power. Linux also reports one-minute load average and RAM usage from /proc.

Width thresholds are minimum eligibility gates, not guarantees that a field will be shown: the payload must contain the value, and the header must have enough remaining room for it.

The renderers set a one-second deadline for reading standard input. Empty or stalled input falls back to an idle payload instead of waiting indefinitely. They do not upload the CLI JSON payload to a remote service.

Choose a display mode

The default mode uses 256-color ANSI styling and Nerd Fonts 3 glyphs. The renderer packs badges into box-drawn rows. Bar lengths and optional first-row fields change with the effective layout width. PowerShell uses terminal_width from the CLI payload; Bash prefers a positive COLUMNS environment value over the payload width unless a fixed-width flag is set.

Terminal width Context bar Quota bar Behavior
235 columns or wider 20 segments 15 segments Widest labels and optional account, host, and token fields.
180–234 columns 10 segments 8 segments More room for model, branch, account, and host fields.
130–179 columns 10 segments 8 segments Account fields can appear when the payload includes them.
100–129 columns 10 segments 8 segments Shorter first-row labels; host fields require 110 columns and version requires 120, subject to available room.
60–99 columns 10 segments 8 segments Shorter labels and more packed rows.

Both implementations use the same bar-length thresholds and greedy badge-packing approach, but their fields and options differ. Row count depends on the payload. Packing counts characters after removing ANSI codes, so terminals can wrap wide glyphs differently.

📸 Visual Screenshot Gallery Across All Terminal Widths

1. Ultra-wide example: single row at 235 columns or wider

This example uses a 20-segment context bar and a 15-segment quota bar.

Ultra-Wide single-row statusline

2. Ultra-wide example: multiple packed rows

This example shows Linux host metrics, power state, subagent count, and token deltas.

Ultra-Wide multi-row statusline dashboard

3. Wide example at 180–234 columns

This example shows account details, a dirty Git branch, and session token totals.

Maximized wide terminal statusline

4. Medium-wide example packed into two rows

This screenshot shows one payload that fits in two boxed rows; other payloads can use more rows.

Medium-wide 2-row statusline layout

5. Medium-width examples at 100–129 columns

The screenshots show two badge groupings at medium widths.

Medium statusline layout standard

Medium statusline layout alternative grouping

6. Narrow examples at 60–99 columns

These examples use shortened labels and additional rows. Row count depends on the payload.

Compact statusline layout

High-density minimal statusline layout

Use Classic mode if your terminal lacks Nerd Font glyphs. It uses text labels, Unicode block characters, and 16-color ANSI output; it is not ASCII-only. The powerline header and boxed-row descriptions below apply to the default styled mode; Classic mode prints unboxed rows.

Supported platforms

Install the implementation for your operating system:

Platform Renderer Requirements Optional integrations
Linux statusline.sh Bash and jq Git; /proc load and memory data; /sys/class/power_supply; ip with tailscale0
macOS statusline.sh Bash and jq Git; pmset power data
Windows statusline.ps1 Windows PowerShell 5.1 or newer Git; Tailscale CLI; Windows power status APIs

GNU timeout is optional; the Bash renderer includes a bounded fallback. The Bash renderer checks Linux Tailscale addresses through ip and tailscale0; PowerShell runs tailscale ip -4 when the CLI is available.

Git is optional. Without it, the renderer cannot query branch or working-tree state locally, but it can show VCS values from the Antigravity CLI payload.

Install or upgrade

The installers copy the renderer and uninstaller to ~/.antigravity or %USERPROFILE%\.antigravity by default, then configure statusLine.type = "command" in Antigravity CLI settings. They stage managed scripts through temporary files and save the original statusLine value in statusline_installed_state.json beside the settings file. Windows also stores a snapshot copy beside the installed scripts.

Set AGY_STATUSLINE_INSTALL_DIR to use another directory. The installers normalize and record that path so uninstallers can verify it. They refuse filesystem roots and Git working trees. They also refuse symlinked renderer or uninstaller files and existing targets not referenced by the active statusline setting.

[!WARNING] Run the installer as your normal account. Do not use sudo: the installer writes to your home directory.

[!TIP] Review install.sh or install.ps1 before executing a remote script.

Linux and macOS

Install jq, then run the installer with either curl or wget.

To choose a custom install directory, set the environment variable before running either command. Relative paths are resolved from the current directory; ~ and ~/... are expanded under your home directory.

export AGY_STATUSLINE_INSTALL_DIR="$HOME/.local/share/antigravity-statusline"
installer_url="https://raw.githubusercontent.com/"\
"weby-homelab/antigravity-cli-statusline/main/install.sh"
curl -fsSL "$installer_url" | bash

The equivalent wget command is:

installer_url="https://raw.githubusercontent.com/"\
"weby-homelab/antigravity-cli-statusline/main/install.sh"
wget -qO- "$installer_url" | bash

Windows PowerShell

Run the default installer from PowerShell:

$base = "https://raw.githubusercontent.com/"
$installerPath = "weby-homelab/antigravity-cli-statusline/main/install.ps1"
Invoke-Expression (Invoke-RestMethod "$base$installerPath")

To choose a custom install directory, set the environment variable beforehand:

$env:AGY_STATUSLINE_INSTALL_DIR = Join-Path $HOME "Apps\Antigravity Statusline"
$base = "https://raw.githubusercontent.com/"
$installerPath = "weby-homelab/antigravity-cli-statusline/main/install.ps1"
Invoke-Expression (Invoke-RestMethod "$base$installerPath")

Restart Antigravity CLI after installation. Rerun the same installer to upgrade the statusline. Run the uninstaller from the selected install directory. It checks that its own location matches both the saved install path and the active settings.json command before removing files; if AGY_STATUSLINE_INSTALL_DIR is set, it must resolve to that same directory.

Configure the statusline

The installers write the statusLine command to one of these files:

  • Linux and macOS: ~/.gemini/antigravity-cli/settings.json
  • Windows: %USERPROFILE%\.gemini\antigravity-cli\settings.json

If your CLI build uses another settings path, add the same statusLine block to that file manually.

A Linux configuration has this shape:

{
  "statusLine": {
    "type": "command",
    "command": "/home/your_username/.antigravity/statusline.sh",
    "enabled": true
  }
}

On macOS, replace /home/your_username with /Users/your_username. The Windows installer writes a command like powershell.exe -NoProfile -ExecutionPolicy Bypass -File C:/Users/your_username/.antigravity/statusline.ps1. Replace this example path with the installed script path. If you edit the setting manually, quote the -File path when it contains spaces and escape those quotes in JSON.

Use classic mode

Append --classic (or -Classic on Windows) to the configured command:

{
  "statusLine": {
    "type": "command",
    "command": "/home/your_username/.antigravity/statusline.sh --classic",
    "enabled": true
  }
}

The Bash renderer also accepts --no-nerdfont and --compatibility; PowerShell accepts -Classic, -c, --classic, --no-nerdfont, -NoNerdFont, --compatibility, and -Compatibility.

Override the layout width

These width overrides are available in Bash only. Without one of these flags, Bash prefers a positive COLUMNS environment value over terminal_width from the Antigravity CLI payload. PowerShell uses the payload width.

Bash flag Effective width Result
--compact 89 columns Compact output
--medium 120 columns Medium output
--medium-wide 150 columns Medium-wide output

Append one Bash flag to the command value in settings.json to test a fixed width.

Customize telemetry segments

All implemented telemetry segments and badges are enabled by default whenever the corresponding data is present. Customization uses exclusion-only Suppression Flags (--no-* in Bash, --no-* or -No* in PowerShell). Currently, only --no-sys / -NoSys in PowerShell has no rendered component to suppress.

Visual structure & terminology

In the default styled mode, the statusline is organized into two primary telemetry layers:

  • Header Segments (Line 1): Positioned in the top Powerline header row with directional dividers (), indicating core session context.
  • Pill Badges (Lines 2+): Self-contained metrics packed into secondary boxed rows beneath the header by the dynamic Packer.
  • Header Collapse: If all Header Segments are suppressed or empty, the primary header line collapses completely, and the Packer adjusts outer box borders (╭─ on the first badge row) to frame the remaining Pill Badges without rendering an empty top frame.

Flag reference

Header Segments (Line 1)
Telemetry component Bash flag PowerShell switch Description
Agent State --no-state -NoState Suppresses READY, THINKING, WORKING, TOOL.
Vim Mode --no-vim (--no-vim-mode) -NoVim (-NoVimMode) Suppresses Vim mode (NORMAL, INSERT, VISUAL).
Git / VCS Branch --no-branch (--no-git) -NoBranch (-NoGit) Suppresses branch name and dirty tree mark (*).
Model --no-model -NoModel Suppresses active LLM model display name or ID.
Working Directory --no-dir (--no-cwd) -NoDir (-NoCwd) Suppresses shortened working directory path.
Conversation ID --no-conv (--no-conversation) -NoConv (-NoConversation) Suppresses the 8-character conversation prefix.
Account & Plan --no-account (--no-user, --no-plan) -NoAccount (-NoUser, -NoPlan) Suppresses subscription plan tier and user email.
Host Diagnostics --no-host -NoHost Suppresses hostname and Tailscale IP address.
CLI Version --no-version -NoVersion Suppresses CLI version badge (vX.Y.Z).
Pill Badges (Lines 2+)
Telemetry indicator Bash flag PowerShell switch Description
Context Usage Bar --no-context-usage (--no-context) -NoContextUsage (-NoContext) Suppresses context progress bar, percentage, and token counts.
Token Totals --no-tokens-usage (--no-tokens) -NoTokensUsage (-NoTokens) Suppresses total session input/output and turn token deltas.
Cost --no-cost -NoCost Suppresses session spend in USD (cost.total_usd) and subagent spend breakdown (cost.subagent_usd).
System Resources --no-sys (--no-system, --no-resources) -NoSys (-NoSystem, -NoResources; no effect) Suppresses CPU load average and RAM utilization in the Linux Bash renderer. PowerShell currently renders no system-resource badge.
Artifacts --no-artifacts -NoArtifacts Suppresses generated artifacts counter.
Subagents --no-subagents -NoSubagents Suppresses spawned subagents counter.
Background Tasks --no-tasks -NoTasks Suppresses running background tasks counter.
Sandbox State --no-sandbox -NoSandbox Suppresses sandbox mode and network state (net-on, net-off, host in Bash; ON (net), ON (no-net), OFF / sandbox off in PowerShell).
Quota Bars --no-quota -NoQuota Suppresses 5-hour and 7-day model quota remaining bars and reset timers.
Power / Battery --no-power -NoPower Suppresses AC mains and battery charge percentage.

Configuration examples

Suppression flags can be specified directly in the statusLine.command string within settings.json or forwarded during installation:

  • Linux / macOS installer: pass arguments after bash -s -- (e.g. curl -fsSL "$installer_url" | bash -s -- --no-host --no-conv) or directly to local install.sh.

  • Windows PowerShell installer: pass arguments via scriptblock execution (e.g. & ([scriptblock]::Create((Invoke-RestMethod "$base$installerPath"))) -NoHost -NoConv) or directly to local install.ps1.

  • Minimalist Statusline:

    --no-host --no-conv --no-account --no-version --no-sys --no-power --no-tokens-usage
    
  • Privacy & Screen-Sharing Mode (hides sensitive directory paths, accounts, and network IPs):

    --no-account --no-host --no-dir --no-conv
    
  • Badges-Only Layout (Header Collapse) (suppresses all Line 1 segments to render only secondary Pill Badges):

    --no-state --no-vim --no-branch --no-model --no-dir --no-conv --no-account --no-host --no-version
    

This README is the current reference for the available configuration flags. See CHANGELOG.md for release-specific behavior changes.

Verify the installation

Check the installed version and print the icon legend. Replace the default path if you chose a custom install directory.

Linux and macOS

~/.antigravity/statusline.sh --version
~/.antigravity/statusline.sh --legend

The short forms are -v and -l.

Windows PowerShell

$script = "$HOME\.antigravity\statusline.ps1"
powershell -NoProfile -ExecutionPolicy Bypass -File $script -Version
powershell -NoProfile -ExecutionPolicy Bypass -File $script -Legend

The Windows renderer also accepts --version, -v, --legend, and -l.

View the graphical telemetry legend

Antigravity CLI Statusline telemetry legend

Run automated tests

Run the Bash & cross-platform test runner on Linux or macOS:

bash tests/run_all.sh

It runs renderer, stdin-timeout, subagent-state, and installer suites, plus the Python compatibility checks (tests/test_windows.py) when python3 is available.

Run the PowerShell renderer and Python checks on Windows:

powershell.exe -NoProfile -ExecutionPolicy Bypass `
  -File .\tests\test_powershell_renderer.ps1
python tests\test_windows.py

CI runs bash -n, shellcheck, and tests/run_all.sh on Ubuntu and macOS, plus tests/test_powershell_renderer.ps1 and tests/test_windows.py on Windows PowerShell 5.1 and PowerShell Core.

Understand installed files

The installers keep renderer scripts separate from Antigravity CLI settings. The default files are:

~/.antigravity/
├── statusline.sh
└── uninstall.sh

~/.gemini/antigravity-cli/
├── settings.json
├── statusline_installed_state.json  # Original value and install path
└── settings.json.bak                # Created if needed

On Windows, the renderer and uninstaller are under %USERPROFILE%\.antigravity. The state snapshot also has a copy beside those scripts. Settings and the primary snapshot are under %USERPROFILE%\.gemini\antigravity-cli.

The PowerShell renderer (statusline.ps1) starts with a UTF-8 byte-order mark (BOM). Keep it if you edit the file; Windows PowerShell 5.1 uses it to read the non-ASCII source correctly. In contrast, install.ps1 and uninstall.ps1 are pure ASCII without a BOM so web one-liner execution via Invoke-Expression succeeds without parser errors.

Uninstall

The uninstaller checks its location against the recorded install path and active settings command before removing scripts. It restores the original statusLine value or removes that key if none existed before installation. Other settings remain in place.

[!WARNING] The current uninstaller removes settings.json.bak during cleanup. If that file existed before installation, save a copy elsewhere before uninstalling.

Run the Linux or macOS uninstaller:

~/.antigravity/uninstall.sh

Run the Windows uninstaller:

$uninstaller = "$HOME\.antigravity\uninstall.ps1"
powershell.exe -NoProfile -ExecutionPolicy Bypass -File $uninstaller

Troubleshoot common problems

Use these checks when the statusline does not render as expected:

  • Icons appear as boxes: select a Nerd Font, or add --classic to the Bash command or -Classic to the PowerShell command.
  • No statusline appears: confirm that statusLine.enabled is true, check the command path, and restart Antigravity CLI.
  • The Bash renderer exits: run jq --version; Bash requires jq.
  • Live Git data is missing: install Git and run Antigravity CLI inside a Git working tree. The renderer can still use VCS values from the payload.
  • Windows reports an illegal path: when editing settings.json manually, quote the -File path only when it contains spaces. The installer adds these quotes when needed, automatically trims surrounding quotes from custom install paths, and normalizes path separators.
  • PowerShell 5.1 shows garbled characters: preserve the UTF-8 BOM at the start of statusline.ps1. Use Classic mode if your terminal font lacks Nerd Font glyphs.
  • Windows installer fails with '#' is not recognized: rerun the installer from main (v0.3.3 or newer); install.ps1 has been stripped of UTF-8 BOM to ensure clean Invoke-Expression execution.
  • Context tokens or quota percentages mismatch in Windows PowerShell 5.1: update to v0.3.2 or newer; parsing under comma-decimal locales was fixed in v0.3.1, and active context window token counts were harmonized with used percentages in v0.3.2.
  • A narrow terminal adds rows: this is expected when the available badges do not fit. Bash width overrides are documented above; PowerShell uses the width from the CLI payload.
  • Host fields are missing: the renderer omits diagnostics that the operating system or local tools do not expose.

Release history

See CHANGELOG.md for versioned changes and GitHub Releases for downloadable release records.

Built in Ukraine under air raid sirens and blackouts ⚡
© 2026 Weby Homelab

Explore related projects

Loading…