Skip to main content

CLI for Productive.io time tracking with calendar sync, team hours review, and local LLM support

Project description

๐Ÿฆ™ TimeLlama

CLI for Productive.io time tracking with calendar sync, team hours review, and local LLM support.

TimeLlama helps you manage time tracking in Productive.ioโ€”sync calendar events to time entries, review team hours for invoicing, and get AI-powered work summaries. Uses a local LLM (Ollama) so all your data stays on your machine.

Features

  • Calendar Sync: Automatically create/update Productive time entries from your calendar
  • Team Hours Review: Check employee hours for billing periods with AI-generated summaries
  • Invoice Approval: Interactive workflow to review and approve team hours
  • Interactive Chat: REPL mode for managing time entries with LLM suggestions
  • Cron-Ready: One-shot sync command for automation
  • Local LLM: Uses Ollama for formattingโ€”all data stays on your machine

Installation

Prerequisites

  1. Ollama (for LLM features):

    # macOS
    brew install ollama
    
    # Start Ollama server
    ollama serve
    
    # Pull the model
    ollama pull llama3.2:3b
    
  2. Productive.io API access with your API token

  3. Calendar ICS file (exported from Google Calendar, Outlook, etc.)

Install TimeLlama

# Via pipx (recommended - isolated environment)
pipx install timellama

# Or via pip
pip install timellama

# Or install from source
git clone https://github.com/achrabaszcz/timellama.git
cd timellama
pip install -e .

Configuration

Create a .env file or set environment variables:

# Required: Productive.io API credentials
PRODUCTIVE_API_TOKEN=your_api_token
PRODUCTIVE_ORG_ID=your_org_id
PRODUCTIVE_USER_ID=your_user_id

# Optional: Calendar ICS URL (for calendar sync)
ICS_CALENDAR_URL=https://outlook.office365.com/owa/calendar/.../calendar.ics

# Optional: Billing period cutoff day (default: 10)
PRODUCTIVE_BILLING_CUTOFF_DAY=10

# Optional: Ollama settings
OLLAMA_MODEL=llama3.2:3b
OLLAMA_HOST=http://localhost:11434

Getting Your Productive Credentials

  1. API Token: Go to Productive โ†’ Settings โ†’ API tokens
  2. Organization ID: Found in your Productive URL: app.productive.io/org-ID/...
  3. User ID: Use the Productive API or check your profile settings

Setting Up Your Calendar

TimeLlama fetches calendar data from an ICS URL. Most calendar providers offer a shareable ICS link:

Outlook/Office 365:

  1. Go to Outlook Calendar โ†’ Settings โ†’ Shared calendars
  2. Publish your calendar and copy the ICS link
  3. Set ICS_CALENDAR_URL to the link

Google Calendar:

  1. Go to Google Calendar โ†’ Settings โ†’ Settings for my calendars
  2. Select your calendar โ†’ Integrate calendar
  3. Copy the "Secret address in iCal format"
  4. Set ICS_CALENDAR_URL to the link

Usage

Check Configuration

timellama doctor

Show Today's Status

timellama status

Sync Calendar to Productive

# Sync today's calendar events
timellama sync

# Dry run - see what would happen
timellama sync --dry-run

# Include LLM suggestions for additional items
timellama sync --suggestions

Interactive Chat Mode

timellama chat

Commands in chat mode:

  • sync - Sync calendar to Productive
  • show - Show current status
  • add <item> - Add item to today's log
  • help - Show help
  • quit - Exit

Add Item to Today's Log

timellama add Code review for PR 123
timellama add Debugging authentication issue

Employee Hours

# Get employee hours for billing period
timellama hours "John Doe"

# Current calendar month
timellama hours "John" --period current

# Previous month
timellama hours "Jane" --period previous

# Custom date range
timellama hours "John" --after 2026-01-01 --before 2026-01-31

# With AI summary
timellama hours "John" --summary

Interactive Approval Workflow

timellama approve

Cron Setup

For automated daily sync:

# Edit crontab
crontab -e

# Add line (sync at 6 PM every weekday)
0 18 * * 1-5 /path/to/timellama sync >> /var/log/timellama.log 2>&1

Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                        timellama CLI                        โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚  Commands:                                                  โ”‚
โ”‚  - timellama chat           (interactive mode)              โ”‚
โ”‚  - timellama sync           (automated sync for cron)       โ”‚
โ”‚  - timellama status         (show today's log)              โ”‚
โ”‚  - timellama hours <name>   (employee work summary)         โ”‚
โ”‚  - timellama approve        (review team hours)             โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
         โ”‚                    โ”‚                    โ”‚
         โ–ผ                    โ–ผ                    โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”      โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”      โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚   Ollama    โ”‚      โ”‚ ics-calendarโ”‚      โ”‚ productive- โ”‚
โ”‚  (local)    โ”‚      โ”‚    MCP      โ”‚      โ”‚  time MCP   โ”‚
โ”‚ llama3.2:3b โ”‚      โ”‚ (bundled)   โ”‚      โ”‚  (bundled)  โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜      โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜      โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Bundled MCP Servers: The productive-time-mcp and ics-calendar-mcp servers are installed as dependencies. TimeLlama spawns them automaticallyโ€”no separate setup needed.

Privacy

  • All data stays local
  • Ollama runs on localhost:11434
  • MCP servers run locally (stdio)
  • Only Productive API calls go external (required for time tracking)
  • No calendar data sent to cloud LLMs

Development

# Clone repo
git clone https://github.com/achrabaszcz/timellama.git
cd timellama

# Install with dev dependencies
pip install -e ".[dev]"

# Run tests
pytest

# Lint
ruff check src/

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

timellama-0.2.3.tar.gz (31.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

timellama-0.2.3-py3-none-any.whl (34.3 kB view details)

Uploaded Python 3

File details

Details for the file timellama-0.2.3.tar.gz.

File metadata

  • Download URL: timellama-0.2.3.tar.gz
  • Upload date:
  • Size: 31.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.27 {"installer":{"name":"uv","version":"0.9.27","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for timellama-0.2.3.tar.gz
Algorithm Hash digest
SHA256 800fec9a88c68426b3cdbd49d194333a581ed98f5a6638c8fd4ae27874bbc59e
MD5 057806103042e385e7103611426cf71e
BLAKE2b-256 d3bf0ca49fb6331a65a3942a1b06d35fbbfefed7d0739e1e329ca973aabd1f46

See more details on using hashes here.

File details

Details for the file timellama-0.2.3-py3-none-any.whl.

File metadata

  • Download URL: timellama-0.2.3-py3-none-any.whl
  • Upload date:
  • Size: 34.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.27 {"installer":{"name":"uv","version":"0.9.27","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for timellama-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 cf8373941b0b6f22ade78141dcdd1d1b098476bff3a75a3e44a2b64a4843a59b
MD5 7aa58e97345f9060d56a5bd8c7eadf65
BLAKE2b-256 8db22e10f025be85d39f8a66bfed602b5f960b4100ded5155635838ceb651d2c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page