@tokentop/agent-gemini
v1.0.0
Published
Gemini session tracking for tokentop — supports Gemini CLI, Antigravity, and all tools built on gemini-cli-core
Downloads
227
Maintainers
Readme
@tokentop/agent-gemini
tokentop agent plugin for Gemini — the canonical plugin for all tools built on Google's gemini-cli-core session format, including Gemini CLI and Antigravity.
Capabilities
| Capability | Status | |-----------|--------| | Session parsing | Yes | | Credential reading | Yes | | Real-time tracking | Yes | | Multi-provider | No |
What This Plugin Does
- Parses Gemini sessions from
~/.gemini/tmp/<project-hash>/chats/*.json - Extracts token usage (input, output, cached, thoughts) per message
- Watches for real-time activity via filesystem watchers with dirty-path optimization
- Reads credentials from both
~/.gemini/oauth_creds.json(Gemini CLI) and~/.config/opencode/antigravity-accounts.json(Antigravity) - Two-layer caching — TTL-based result cache + per-session LRU aggregate cache
Supported Tools
This plugin covers any tool that writes the ConversationRecord JSON format to ~/.gemini/tmp/:
| Tool | Detected |
|------|----------|
| Gemini CLI | Yes |
| Antigravity IDE | Yes |
| Any gemini-cli-core consumer | Yes |
Install
This plugin is bundled with tokentop — no separate install needed. If you need it standalone:
bun add @tokentop/agent-geminiRequirements
- Gemini CLI or Antigravity installed
- Bun >= 1.0.0
@tokentop/plugin-sdk^1.0.0 (peer dependency)
Permissions
| Type | Access | Paths |
|------|--------|-------|
| Filesystem | Read | ~/.gemini |
Replaces
This plugin supersedes both @tokentop/agent-gemini-cli and @tokentop/agent-antigravity. Both read from the same ~/.gemini/tmp directory with identical session formats — there is no way to distinguish which tool created a given session file.
Development
bun install
bun run build
bun test
bun run typecheckContributing
See the Contributing Guide. Issues for this plugin should be filed on the main tokentop repo.
License
MIT
