Skip to content

tokentopapp/agent-gemini

@tokentop/agent-gemini

npm CI License: MIT

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-gemini

Requirements

  • 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 typecheck

Contributing

See the Contributing Guide. Issues for this plugin should be filed on the main tokentop repo.

License

MIT

About

tokentop agent plugin for Gemini — session parsing, credential discovery, and real-time cost tracking for Gemini CLI, Antigravity, and all gemini-cli-core tools

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors