This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
This is a Python CLI application that summarizes work activity across multiple platforms (Webex and GitHub) for daily reporting. It uses uv for dependency management and typer for CLI interface.
# Install dependencies
uv sync
# Install with development dependencies
uv sync --all-extrasOption 1: OAuth 2.0 (Recommended)
# Set up OAuth credentials
export USER_EMAIL=you@example.com
export WEBEX_OAUTH_CLIENT_ID=your_client_id
export WEBEX_OAUTH_CLIENT_SECRET=your_client_secret
# Authenticate once (opens browser)
uv run summarizer webex login
# Check authentication status
uv run summarizer webex status
# Run summarizer (uses stored OAuth tokens)
uv run summarizer --target-date=2024-06-01Option 2: Manual Token (Legacy)
# Using manual token (expires in 12 hours)
export USER_EMAIL=you@example.com
export WEBEX_TOKEN=your_manual_token
uv run summarizer --target-date=2024-06-01export GITHUB_TOKEN=your_github_token# Show help
uv run summarizer --help
# Run with both platforms
uv run summarizer --target-date=2024-06-01
# Run with specific platforms disabled
uv run summarizer --no-github --target-date=2024-06-01
uv run summarizer --no-webex --target-date=2024-06-01# Authenticate with Webex OAuth
uv run summarizer webex login
# Check authentication status and refresh tokens
uv run summarizer webex status
# Logout (remove stored credentials)
uv run summarizer webex logout# Run tests
uv run pytest
# Run tests with coverage
uv run pytest --cov=summarizer# Run linting and formatting
uv run ruff check .
uv run ruff format .
# Run complexity analysis
uv run xenon --max-absolute=B --max-modules=B --max-average=B summarizer/
# Run security checks
uv run bandit -r summarizer/
# Install and run pre-commit hooks
uv run pre-commit install
uv run pre-commit run --all-files- CLI Layer (
summarizer/cli.py): Typer-based CLI with unified Webex + GitHub support - Platform Modules: Each platform (webex/, github/) has config, client, and runner components
- Common Module (
summarizer/common/): Shared models, configuration base classes, logging, and UI utilities
BaseConfig: Abstract base for platform-agnostic configurationWebexConfig: Webex-specific settings (OAuth/manual tokens, email, context windows)GithubConfig: GitHub-specific settings (tokens, API URLs, org/repo filters)
- Webex OAuth 2.0: PKCE-secured authorization flow with automatic token refresh
- Access tokens: 14-day expiration
- Refresh tokens: 90-day expiration
- Secure credential storage in
~/.config/summarizer/
- Webex Manual Token: Legacy 12-hour token support (fallback)
- GitHub: Personal access token authentication
- Webex:
User,Message,Conversation,Threadmodels for chat data - GitHub:
Changemodel withChangeTypeenum (commits, issues, PRs, comments, reviews) - Common:
SpaceTypeenum for conversation types
Each platform follows the same pattern:
- Config: Platform-specific configuration container
- Client: API interaction layer (REST/GraphQL)
- Runner: Orchestration and business logic layer
- Supports both single dates (
--target-date) and date ranges (--start-date/--end-date) - Uses datetime objects internally with YYYY-MM-DD CLI format
- Mutually exclusive validation between single date and range modes
- Platform activation based on credential presence and explicit disable flags
- Unified CLI with platform-specific sections
- CSV parsing for organization and repository filters
- Change type filtering with include/exclude options
- Core:
typer,pydantic-settings,requests,rich - Webex:
webexpythonsdk - Dev:
ruff,pytest,bandit,xenon,pre-commit
- Uses Ruff for linting with comprehensive rule set (pycodestyle, flake8-bugbear, pep8-naming, etc.)
- Google-style docstrings enforced via pydocstyle
- Complexity limits enforced via xenon (max B-grade)
- Security scanning via bandit
- Type hints required (flake8-annotations)
- Tests located in
tests/directory - Async test support configured via pytest-asyncio
- Mock HTTP responses using
responseslibrary - Platform-specific test modules mirror source structure