Repository navigation
Add agent-usage extension - #25049
Conversation
- Update README.md - chore: update extension icon and minor fixes - docs: update README and CHANGELOG for initial release - refactor: prioritize Refresh action over Copy in ActionPanel - feat: add copy usage details to clipboard action - feat(amp): add display mode preference for amount or percentage - feat: add agent list reorder with LocalStorage persistence - style(assets): refine codex icon with thinner strokes and add dark variant - feat: add dark mode support for droid icon - feat(preferences): add per-agent visibility toggles - feat(gemini): add Google Gemini CLI usage support - feat: show amp replenishes time - feat(droid): add Factory AI Droid usage support - docs: update agent architecture notes - refactor(agent-usage): centralize usage state and settings links - feat(codex): show 5h limit in accessory - refactor(agents): add shared types and ui helpers - feat: integrate Codex support into Agent Usage command - feat: implement Codex usage tracking module - chore: add Codex icon asset - refactor: enhance Amp error handling and fetcher logic - feat: add custom Amp icon - feat: support Amp usage tracking - init: Raycast Agent Usage extension setup
|
Congratulations on your new Raycast extension! 🚀 We're currently experiencing a high volume of incoming requests. As a result, the initial review may take up to 10-15 business days. Once the PR is approved and merged, the extension will be available on our Store. |
Greptile SummaryAdds a new Agent Usage extension that tracks usage across 7 AI coding agents (Amp, Codex, Droid, Gemini, Kimi, Antigravity, z.ai) with a unified interface for monitoring quotas and usage limits. Key features:
Implementation highlights:
Issues found:
Confidence Score: 4/5
Important Files Changed
Last reviewed commit: 8787041 |
- docs(package): improve extension description and subtitle - feat(gemini): add re-authenticate action when OAuth token expires
- chore(settings): mark codex token as optional - fix(kimi): guard percentage rendering for zero limits - fix(gemini): make oauth refresh fallback resilient - refactor(kimi): show rate and weekly limits as percentages - feat(codex): add zero-config auth fallback strategy - fix(kimi): use POST request with scope body - feat(kimi): add Kimi agent support
- refactor(gemini): extract binary resolution into dedicated module - refactor(gemini): replace Terminal-based reauth with inline execSync - feat: add Antigravity provider and improve Gemini re-authentication - docs: update extension description to include Kimi agent
commented
Feb 16, 2026
|
@greptileai, could you please do a fresh review of this PR? |
| export async function launchGeminiReauth(): Promise<void> { | ||
| execFileSync(getGeminiReauthCommand(), [], { timeout: 120000 }); | ||
| } |
There was a problem hiding this comment.
execFileSync blocks the UI thread
launchGeminiReauth is declared async but uses execFileSync, which blocks the Node.js event loop synchronously. Since the gemini CLI login flow is interactive (it opens a browser for Google OAuth and waits for the user to complete it), this will freeze the entire Raycast UI for up to 120 seconds.
This function is invoked from a toast action button in agent-usage.tsx, so users will experience a completely unresponsive UI until the command finishes or times out.
Use execFile (the async version, already imported in probe.ts via promisify) instead:
| export async function launchGeminiReauth(): Promise<void> { | |
| execFileSync(getGeminiReauthCommand(), [], { timeout: 120000 }); | |
| } | |
| export async function launchGeminiReauth(): Promise<void> { | |
| const { execFile } = await import("node:child_process"); | |
| const { promisify } = await import("node:util"); | |
| const execFileAsync = promisify(execFile); | |
| await execFileAsync(getGeminiReauthCommand(), [], { timeout: 120000 }); | |
| } |
| content={getAgentCopyText(agent, { | ||
| amp: ampState, | ||
| codex: codexState, | ||
| droid: droidState, |
There was a problem hiding this comment.
Inconsistent title casing
"Move up" uses a lowercase "u" while the corresponding "Move Down" on line 362 uses an uppercase "D". Action titles should use consistent title case.
| droid: droidState, | |
| title="Move Up" |
Context Used: Rule from dashboard - What: Use title case for titles in package.json.
Why: Title case improves readability and maintai... (source)
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
| interface AmpPreferences { | ||
| ampDisplayMode?: "amount" | "percentage"; | ||
| } |
There was a problem hiding this comment.
Manual AmpPreferences interface is redundant
This defines a manual AmpPreferences interface for getPreferenceValues, but Raycast auto-generates Preferences.AgentUsage in raycast-env.d.ts from package.json. Other files in this extension (e.g., codex/fetcher.ts, droid/fetcher.ts) already use the generated type via type Preferences = Preferences.AgentUsage. This manual definition can drift out of sync with the actual preference schema.
| interface AmpPreferences { | |
| ampDisplayMode?: "amount" | "percentage"; | |
| } | |
| type Preferences = Preferences.AgentUsage; |
And update line 125 to:
const { ampDisplayMode = "amount" } = getPreferenceValues<Preferences>();Context Used: Rule from dashboard - What: Don't manually define Preferences for getPreferenceValues() or commends Argument interfa... (source)
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
commented
Feb 16, 2026
|
Hi 👋 Thanks for your contribution 💪 Could you look into the suggestions from Greptile I'm looking forward to reviewing this extension again 🔥 I converted this PR into a draft until it's ready for the review, please press the button Feel free to contact me here or at Slack if you have any questions. |
- fix(agent-usage): avoid blocking binary detection - fix: normalize preferences typing and async gemini reauth - fix(zai): remove used suffix from usage display - feat(zai): add z.ai (GLM) usage tracking provider
| console.log("fetchTier response not ok:", response.status, await response.text()); | ||
| return { tier: "Unknown" }; |
There was a problem hiding this comment.
remove debug console.log statements before production
| console.log("fetchTier response not ok:", response.status, await response.text()); | |
| return { tier: "Unknown" }; | |
| if (!response.ok) { | |
| return { tier: "Unknown" }; |
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
|
|
||
| return { tier, projectId }; | ||
| } catch (e) { | ||
| console.log("fetchTier error:", e); |
There was a problem hiding this comment.
remove debug console.log statement
| console.log("fetchTier error:", e); | |
| return { tier: "Unknown" }; |
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
| - Track usage for Amp, Codex, Droid, and Gemini CLI | ||
| - View remaining quotas and detailed usage breakdown | ||
| - Refresh data and copy usage details to clipboard | ||
| - Customize visible agents and display order | ||
| - Amp display mode: amount or percentage No newline at end of file |
There was a problem hiding this comment.
changelog should list all 7 supported agents (Kimi, Antigravity, and z.ai are missing)
- chore: refresh extension branding assets - fix(gemini): remove debug logs and update changelog
commented
Feb 20, 2026
|
@0xdhrv Could you help me review it one more time? I feel like the review process is a bit too long. |
commented
Feb 20, 2026
|
Published to the Raycast Store: |
commented
Feb 20, 2026
|
🎉 🎉 🎉 We've rewarded your Raycast account with some credits. You will soon be able to exchange them for some swag. |
Description
Adds Agent Usage extension - track usage across multiple AI coding agents in one place.
Supported agents:
Amp Code - reads from local SQLite database (no setup required)
Codex (OpenAI) - requires authorization token
Droid (Factory AI) - requires authorization token
Gemini CLI - reads from local state file (no setup required)
Features:
Quick overview of remaining quotas and usage
Detailed breakdown for each agent
Refresh data and copy usage to clipboard
Show/hide agents and reorder list via preferences
Screencast
screencast-raycast-ext-agent-usage.mp4
Checklist
npm run buildand tested this distribution build in Raycastassetsfolder are used by the extension itselfREADMEare placed outside of themetadatafolder