The easiest way to contribute is adding support for a new AI tool.
- Create
src/agenttop/collectors/your_tool.py - Subclass
BaseCollector:
from agenttop.collectors.base import BaseCollector
from agenttop.models import Event, Session, ToolName, ToolStats
class YourToolCollector(BaseCollector):
@property
def tool_name(self) -> ToolName:
return ToolName.YOUR_TOOL # Add to the enum first
def is_available(self) -> bool:
# Check if the tool's data directory exists
return Path("~/.your-tool").expanduser().exists()
def collect_events(self) -> list[Event]:
# Parse local data files into Event objects
...
def collect_sessions(self) -> list[Session]:
# Aggregate events into sessions
...
def get_stats(self) -> ToolStats:
# Return today's aggregated stats for the dashboard
...- Add the tool to
ToolNameenum inmodels.py - Register in
tui/app.py_init_collectors() - Add tests in
tests/test_collectors.py
git clone https://github.com/vicarious11/agenttop
cd agenttop
pip install -e ".[dev]"
pytest
ruff check src/ tests/- Keep collectors read-only — never modify the tool's data files
- All data stays local — never send raw prompts to external services
- Estimate tokens conservatively when exact counts aren't available
- Add tests for your collector with mock data