Last active
July 3, 2026 14:39
-
-
Save ABIvan-Tech/1c979e29a378a67b88a313dfaee18464 to your computer and use it in GitHub Desktop.
Antigravity CLI custom status bar
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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}%" |
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
Uh oh!
There was an error while loading. Please reload this page.