From 15c2fe64d7b10eba37e11a647895def3aa5509f1 Mon Sep 17 00:00:00 2001 From: Amolith Date: Tue, 2 Dec 2025 16:31:31 -0700 Subject: [PATCH] refactor(synu): show usage percentage in quota Display 'Usage: N% (X/Y remaining)' instead of 'Remaining: X/Y requests' Assisted-by: Claude Opus 4.5 via Crush --- functions/synu.fish | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/functions/synu.fish b/functions/synu.fish index 89034354d5482a89d7b08888ed70c25b873eaec3..dbb3fe142d14d3cafa43113d9d6bfb948b3995b5 100644 --- a/functions/synu.fish +++ b/functions/synu.fish @@ -14,7 +14,7 @@ function synu --description "Universal agent wrapper with Synthetic API quota tr set -l limit (echo "$quota" | cut -d' ' -f2) set -l remaining (math "$limit - $requests") set -l percent_used (math "$requests * 100 / $limit") - printf "Remaining: " + printf "Usage: " if test $percent_used -lt 33 set_color green else if test $percent_used -lt 67 @@ -22,9 +22,9 @@ function synu --description "Universal agent wrapper with Synthetic API quota tr else set_color red end - printf "%s/%s" $remaining $limit + printf "%s%%" $percent_used set_color normal - printf " requests\n" + printf " (%s/%s remaining)\n" $remaining $limit return 0 end @@ -163,7 +163,7 @@ function synu --description "Universal agent wrapper with Synthetic API quota tr # Force a newline first for proper separation from agent output printf "\n" printf "Session usage: %s requests\n" $session_usage - printf "Remaining: " + printf "Usage: " # Determine color based on usage percentage # Green: <33%, Yellow: 33-66%, Red: >66% @@ -174,9 +174,9 @@ function synu --description "Universal agent wrapper with Synthetic API quota tr else set_color red end - printf "%s/%s" $remaining $limit + printf "%s%%" $percent_used set_color normal - printf " requests\n" + printf " (%s/%s remaining)\n" $remaining $limit return $exit_status end