refactor(synu): show usage percentage in quota

Amolith created

Display 'Usage: N% (X/Y remaining)' instead of 'Remaining: X/Y requests'

Assisted-by: Claude Opus 4.5 via Crush

Change summary

functions/synu.fish | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

Detailed changes

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