Personal Knowledge Management Tool to fetch and format data from several resources.
PKM Tool aggregates data from multiple sources into a unified daily report:
- π Apple Calendar - Agenda and events (macOS only)
- π GitHub - Activities including commits, PRs, issues, and reviews (via gh CLI or API)
- π’ Atlassian - Jira issues and Confluence pages
- β Things - Completed tasks from logbook (macOS only)
- β±οΈ Wakatime - Coding activity per project
- π Google Docs - Recently opened documents
- πͺ Whoop - Recovery, sleep, and workout data
- π Date Ranges - Generate reports for multiple days with
--fromand--toflags - ποΈ Smart File Updates - Intelligently merge PKM sections with existing notes while preserving manual content
- π Configurable Filenames - Template-based naming (default:
2025-11-22 (Fri).md) - π« Weekend Exclusion - Skip weekends globally or per-source with
--exclude-weekends
Using uv (recommended):
# Clone the repository
git clone https://github.com/kakkoyun/pkm-tool.git
cd pkm-tool
# Install with uv
uv sync
# Optional: Install server extras for FastAPI web server
uv sync --extra server
# Optional: Install MCP extras for Model Context Protocol server
uv sync --extra mcp
# Run the CLI
uv run pkmOr install directly:
uv pip install -e .
# Or with extras
uv pip install -e ".[server,mcp]"pkm --helpUsage: cli [OPTIONS] COMMAND [ARGS]...
Personal Knowledge Management Tool.
Fetches and formats data from various sources including: - Apple Calendar
Agenda - GitHub - Atlassian (Jira/Confluence) - Things Logbook - Wakatime -
Google Docs - Whoop
Use subcommands to aggregate all sources or fetch from individual sources:
pkm aggregate --date yesterday Aggregate all sources
pkm calendar --date yesterday Fetch Apple Calendar events only
pkm github --date yesterday Fetch GitHub activities only
pkm atlassian --date yesterday Fetch Atlassian (Jira/Confluence) items only
pkm things --date yesterday Fetch Things tasks only
pkm wakatime --date yesterday Fetch Wakatime coding activities only
pkm google-docs --date yesterday Fetch Google Docs only
pkm whoop --date yesterday Fetch Whoop health data only
pkm server Start FastAPI web server
pkm mcp Run as MCP (Model Context Protocol) server
Options:
--help Show this message and exit.
Commands:
aggregate Aggregate data from all configured sources (default behavior).
atlassian Fetch Atlassian (Jira/Confluence) items only.
auth Manage authentication credentials.
calendar Fetch Apple Calendar events only.
github Fetch GitHub activities only.
google-docs Fetch Google Docs only.
mcp Run PKM Tool as an MCP (Model Context Protocol) server.
server Start the PKM Tool web server.
things Fetch Things tasks only.
wakatime Fetch Wakatime coding activities only.
whoop Fetch Whoop health data only.
PKM Tool can run as an MCP (Model Context Protocol) server, allowing AI assistants like Claude to access your personal data securely:
# Run as MCP server (stdio mode)
pkm mcpIntegration with Claude Desktop:
Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):
{
"mcpServers": {
"pkm-tool": {
"command": "pkm",
"args": ["mcp"],
"env": {}
}
}
}Available MCP Tools:
fetch_aggregated_data- Get data from all configured sourcesfetch_calendar_events- Get Apple Calendar eventsfetch_github_activities- Get GitHub activitiesfetch_atlassian_items- Get Atlassian (Jira/Confluence) itemsfetch_things_tasks- Get Things tasksfetch_wakatime_activities- Get Wakatime coding activitiesfetch_google_docs- Get Google Docsfetch_whoop_data- Get Whoop health data
Once configured, Claude can fetch and analyze your daily data on demand.
--help: Show this message and exit.
PKM Tool can run as a web server providing a REST API for fetching data. This is useful for:
- Testing and troubleshooting data sources
- Integrating with other tools and services
- Building custom UIs or dashboards
# Start server on default port (8000)
pkm server
# Start on custom port with auto-reload
pkm server --port 8080 --reload
# Start with verbose logging
pkm server --verboseThe server will be accessible at http://127.0.0.1:8000 by default.
--host TEXT- Host to bind the server to (default: 127.0.0.1)--port INTEGER- Port to bind the server to (default: 8000)--reload- Enable auto-reload on code changes (development mode)-c, --config PATH- Path to configuration file-v, --verbose- Enable verbose (DEBUG) logging--log-format [human|json]- Log output format (default: human)
Once the server is running, you can access:
- Interactive API docs:
http://127.0.0.1:8000/docs - ReDoc documentation:
http://127.0.0.1:8000/redoc
Available Endpoints:
-
GET /health- Health check endpointcurl http://127.0.0.1:8000/health
-
GET /api/sources- List all available data sourcescurl http://127.0.0.1:8000/api/sources
-
GET /api/config- Get configuration informationcurl http://127.0.0.1:8000/api/config
-
GET /api/data- Fetch aggregated data for a specific date# Get today's data in markdown format curl "http://127.0.0.1:8000/api/data" # Get specific date in JSON format curl "http://127.0.0.1:8000/api/data?date=2025-12-02&format=json" # Get data from specific sources only curl "http://127.0.0.1:8000/api/data?date=2025-12-02&sources=github,wakatime"
Query Parameters:
date- Date to fetch (YYYY-MM-DD format, default: today)format- Output format (markdownorjson, default: markdown)sources- Comma-separated list of sources to fetch (default: all enabled sources)
The server requires additional dependencies that are installed as an optional extra:
# Install server dependencies
uv sync --extra server
# Or with pip
pip install -e ".[server]"The tool includes comprehensive structured logging for troubleshooting:
# Enable verbose logging to see detailed debug information
pkm --verbose
# Use JSON logging format for production/log aggregation
pkm --verbose --log-format json
# Standard (INFO) logging is enabled by default
pkmLog levels:
- INFO (default): Start/end of operations, source status, config loading
- DEBUG (with
--verbose): Detailed API calls, authentication, data parsing, file paths
Log formats:
- human (default): Colored, human-readable console output for development
- json: Structured JSON logs for production and log aggregation systems
Copy the example configuration file:
cp config.example.yaml ~/.config/pkm-tool/config.yamlEdit the configuration file to enable/disable sources and add credentials:
# Output settings (Phase 2)
output_filename_template: "{date} ({day_abbr}).{format}" # Default: "2025-11-22 (Fri).md"
output_directory: "./daily-notes" # Where to write files
github:
enabled: true
exclude_weekends: false # Set to true to skip GitHub on weekends
config:
use_gh_cli: true # Uses gh CLI for authentication
wakatime:
enabled: true
exclude_weekends: true # Example: skip coding activity tracking on weekends
config:
api_key: waka_your_api_key_here
atlassian:
enabled: true
config:
base_url: https://your-domain.atlassian.net
username: your.email@example.com
api_token: your_api_token_here
google_docs:
enabled: true
config:
client_id: your_google_client_id.apps.googleusercontent.com
client_secret: your_google_client_secret
scopes:
- https://www.googleapis.com/auth/drive.readonly
# Optional legacy fallback (not recommended)
# access_token: your_access_token_here
whoop:
enabled: true
config:
# Preferred: store tokens via `pkm auth login whoop`
# access_token: your_whoop_access_token_hereThe output_filename_template supports the following variables:
{date}- Full date in YYYY-MM-DD format (e.g., "2025-11-22"){year}- Four-digit year (e.g., "2025"){month}- Two-digit month (e.g., "11"){day}- Two-digit day (e.g., "22"){day_abbr}- Abbreviated day name (e.g., "Mon", "Fri"){format}- Output format extension ("md" for markdown, "json" for json)
Examples:
"{date} ({day_abbr}).{format}"β2025-11-22 (Fri).md"{year}/{month}/{day}.{format}"β2025/11/22.md"daily-note-{date}.{format}"βdaily-note-2025-11-22.md
# Daily Report - 2025-11-21
## π
Calendar Events
- **10:00 - 11:00** Team Standup
- Location: Conference Room A
## π GitHub Activities
- π **09:30** [owner/repo](https://github.com/owner/repo) - Pushed 3 commits
## β
Things - Completed Tasks
- **14:30** Review PR #123 (Work)
## β±οΈ Wakatime - Coding Activity
**Total Time:** 6.5 hours
- pkm-tool (Python): 4.2h
- my-project (Go): 2.3h{
"date": "2025-11-21",
"calendar_events": [...],
"github_activities": [...],
"atlassian_items": [...],
"things_tasks": [...],
"wakatime_activities": [...],
"google_docs": [...],
"metadata": {}
}Want to contribute? See CONTRIBUTING.md for detailed development instructions.
# Install with dev dependencies
make install
# Install pre-commit hooks
make install-hooks
# Run all checks (format, lint, typecheck, test)
make allpkm-tool/
βββ src/pkm_tool/
β βββ cli.py # CLI entry point
β βββ config.py # Configuration management
β βββ models.py # Pydantic data models
β βββ aggregator.py # Data aggregation logic
β βββ formatters.py # Output formatters
β βββ auth/ # Authentication system
β βββ sources/ # Data source integrations
β βββ server/ # FastAPI web server
β βββ mcp_server/ # MCP server
βββ tests/ # Comprehensive test suite (88% coverage)
βββ .github/ # CI/CD workflows
The project has comprehensive test coverage (88%) with unit tests, integration tests, and snapshot tests.
# Run all tests
make test
# Run with coverage report
make test/coverageSee CONTRIBUTING.md for detailed testing documentation.
Requires macOS. Uses AppleScript to query Calendar.app.
Two authentication methods:
- gh CLI (recommended): Uses the installed
ghCLI tool - Personal Access Token: Set
GITHUB_TOKENandGITHUB_USERNAMEenvironment variables
Requires:
- Atlassian Cloud instance URL
- Email address
- API token (create at https://id.atlassian.com/manage-profile/security/api-tokens)
Requires macOS. Reads from Things' SQLite database located at:
~/Library/Group Containers/JLMPQHK86H.com.culturedcode.ThingsMac/Things Database.thingsdatabase/main.sqlite
Requires Wakatime API key. Get it from https://wakatime.com/settings/account
Requires OAuth2 access token. See Google Drive API documentation for setup.
The PKM tool can be used as an LLM tool/function. See the JSON output format for structured data that can be consumed by LLMs.
Example tool definition:
{
"name": "get_daily_report",
"description": "Get aggregated daily report from multiple knowledge sources",
"parameters": {
"type": "object",
"properties": {
"date": {
"type": "string",
"description": "Date to fetch report for (YYYY-MM-DD or natural language)"
}
}
}
}See LICENSE file.