Skip to content

Instantly share code, notes, and snippets.

@ABIvan-Tech
Last active July 3, 2026 14:39
Show Gist options
  • Select an option

  • Save ABIvan-Tech/1c979e29a378a67b88a313dfaee18464 to your computer and use it in GitHub Desktop.

Select an option

Save ABIvan-Tech/1c979e29a378a67b88a313dfaee18464 to your computer and use it in GitHub Desktop.
Antigravity CLI custom status bar
#!/bin/bash
# Read JSON payload from stdin
payload=$(cat)
# Extract basic model information
model=$(echo "$payload" | jq -r '.model.display_name // "N/A"')
# Extract token usage data
input=$(echo "$payload" | jq -r '.context_window.total_input_tokens // 0')
output=$(echo "$payload" | jq -r '.context_window.total_output_tokens // 0')
used_pct=$(echo "$payload" | jq -r '.context_window.used_percentage // 0 | round')
# Extract remaining quotas for Gemini, convert to percentages, and round
gem_5h=$(echo "$payload" | jq -r '.quota["gemini-5h"].remaining_fraction // 0 | (. * 100) | round')
gem_wk=$(echo "$payload" | jq -r '.quota["gemini-weekly"].remaining_fraction // 0 | (. * 100) | round')
# Extract remaining quotas for Claude/GPT (3p), convert to percentages, and round
p3_5h=$(echo "$payload" | jq -r '.quota["3p-5h"].remaining_fraction // 0 | (. * 100) | round')
p3_wk=$(echo "$payload" | jq -r '.quota["3p-weekly"].remaining_fraction // 0 | (. * 100) | round')
# Build the final status bar string showing all limits
echo "πŸ€– ${model} | Context ↓ ${input} (${used_pct}%) | Output ↑ ${output} | Quota(5h/wk) Gemini: ${gem_5h}%/${gem_wk}% | Claude & GPT: ${p3_5h}%/${p3_wk}%"
@ABIvan-Tech

ABIvan-Tech commented Jun 3, 2026

Copy link
Copy Markdown
Author
image //----// image

@abalesk

abalesk commented Jun 15, 2026

Copy link
Copy Markdown

a bit streamlined version joined into one command

#!/bin/bash

# Script to format the agy status line.
# config: ~/.gemini/antigravity-cli/settings.json
# type: "command", command: "bash <path_to_this_script>"

# How it works:
# 1. Metrics are read from standard input (stdin).
# 2. jq parses them into variables using statements of the form "(<expression>) as <variable>".
# 3. The statusline string is formatted and output as the last line.

jq -r '
  (.model.display_name // "N/A") as $m |
  (.context_window.total_input_tokens // 0) as $in |
  (.context_window.total_output_tokens // 0) as $out |
  (.context_window.used_percentage // 0 | round) as $up |
  ((.quota["gemini-5h"].remaining_fraction // 0) * 100 | round) as $g5h |
  ((.quota["gemini-weekly"].remaining_fraction // 0) * 100 | round) as $gwk |
  ((.quota["3p-5h"].remaining_fraction // 0) * 100 | round) as $p5h |
  ((.quota["3p-weekly"].remaining_fraction // 0) * 100 | round) as $pwk |
  "πŸ€– \($m) | Context ↓ \($in) (\($up)%) | Output ↑ \($out) | Quota(5h/wk) Gemini: \($g5h)%/\($gwk)% | Claude: \($p5h)%/\($pwk)%"
'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment