-
Notifications
You must be signed in to change notification settings - Fork 38
Open
Description
Summary
Add Google Gemini CLI (@google/gemini-cli) as a third provider alongside Claude and Codex. This lets nightshift utilize unused Gemini token budgets for overnight task execution.
Motivation
Gemini CLI supports headless execution (gemini -p <prompt> -y --output-format json), model selection (-m), and stores session data with token usage locally at ~/.gemini/tmp/. This maps cleanly onto nightshift's two-layer provider architecture (provider for budget tracking, agent for task execution).
Proposed Changes
Provider layer (internal/providers/gemini.go):
- Parse Gemini CLI session files to calculate daily/weekly token usage
- Implement
GetUsedPercent,GetTodayUsage,GetWeeklyUsagefollowing the existing provider pattern
Agent layer (internal/agents/gemini.go):
- Spawn
gemini -p <prompt> -m <model> -y --output-format jsonfor headless task execution - Support configurable model (e.g.,
gemini-3-pro-preview) - Auto-approve flag support via
-y
Config (internal/config/config.go):
- Add
geminitoProvidersConfigwithenabled,data_path, andmodelfields
Budget (internal/budget/budget.go):
- Integrate
GeminiUsageProviderinto the budget manager
Commands:
- Wire gemini into
run,daemon,budget,preview,doctor,task, andsnapshotsubcommands - Add "gemini" to provider preference and candidate selection
Testing
- 10 provider tests (session parsing, token summing, usage percent, edge cases)
- 8 agent tests (defaults, options, execution, timeout, file context, errors)
Notes
- Snapshot collector integration left as follow-up
- Requires
geminiCLI binary in PATH (installable vianpm i -g @google/gemini-clior homebrew)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels