Skip to main content

A simple to use time tracking CLI for macOS.

Project description

Time Buddy

A simple to use time tracking CLI for macOS.

Track your screen time based on macOS system logs to calculate how many hours you've worked each day.

Time Buddy Preview

Features

  • 📊 Track screen time based on macOS unlock/lock events
  • 📅 Calculate time spent per day with hourly breakdown visualization
  • 💾 Smart caching for faster subsequent runs
  • 🎨 Colorful terminal output with progress indicators

Requirements

  • macOS (uses macOS system logs)
  • Python 3.7+ (for development)

Setup (Required)

Before using Time Buddy, you must enable persistent logging for screen lock/unlock events:

sudo log config --subsystem com.apple.loginwindow --mode "persist:info"

This command configures macOS to persistently store login window events. Without this, the system may not retain the screen lock/unlock logs needed for accurate time tracking.

Note: You only need to run this once. The setting persists across reboots.

Installation

pip (Recommended)

pip install time-buddy

Standalone Binary

If you don't have Python installed:

curl -fsSL https://raw.githubusercontent.com/alen-z/time-buddy/main/install.sh | bash

Or build from source:

git clone https://github.com/alen-z/time-buddy.git
cd time-buddy
make install
make install-binary

Usage

# Show version
time-buddy --version

# Show screen time for the last 7 days (default)
time-buddy

# Show screen time for the last 30 days
time-buddy --days 30

# Show detailed session information
time-buddy --verbose

# Force refresh (ignore cache)
time-buddy --no-cache

# Include weekends in expected hours calculation
time-buddy --include-weekends

# Clear the cache
time-buddy --clear-cache

Development

# Install dependencies
make install

# Install locally for testing (editable mode)
pip install -e .

# Run the application
make run

# Create standalone binary
make create-binary

# Test the binary
make test-binary

# Clean build artifacts
make clean

How It Works

Time Buddy reads macOS system logs for screen lock/unlock events and calculates:

  • Raw time: Actual screen-on time between unlock and lock events
  • Block time: Time span from first to last activity (your "work block")

The output shows a 24-hour visualization where each block represents an hour, colored by activity intensity.

License

MIT License

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

time_buddy-1.0.5.tar.gz (8.8 kB view details)

Uploaded Source

Built Distribution

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

time_buddy-1.0.5-py3-none-any.whl (9.2 kB view details)

Uploaded Python 3

File details

Details for the file time_buddy-1.0.5.tar.gz.

File metadata

  • Download URL: time_buddy-1.0.5.tar.gz
  • Upload date:
  • Size: 8.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for time_buddy-1.0.5.tar.gz
Algorithm Hash digest
SHA256 fa4e911099602369b406f7c84e265d75fac5a2c3e3aae9e5b08fc4a6028fe6ce
MD5 ed21a6b9391359230c58cbf9e4d5df1e
BLAKE2b-256 3e7475bef39600fbd3b1ab3cb1ecbbed9d57ed28870613cdd78a2e0395d91e47

See more details on using hashes here.

Provenance

The following attestation bundles were made for time_buddy-1.0.5.tar.gz:

Publisher: release.yml on alen-z/time-buddy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file time_buddy-1.0.5-py3-none-any.whl.

File metadata

  • Download URL: time_buddy-1.0.5-py3-none-any.whl
  • Upload date:
  • Size: 9.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for time_buddy-1.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 bd00b89896b30f6abbd331a1cf689ca3467d8d649c57f51dc4e1c9947b20b0d0
MD5 95898c69c1651a80d8eea52b8fce11ac
BLAKE2b-256 494e2e395ca4f3ffa7d2f4e63fc90654f7e48e1a34430094d9867e7c3cad0d0f

See more details on using hashes here.

Provenance

The following attestation bundles were made for time_buddy-1.0.5-py3-none-any.whl:

Publisher: release.yml on alen-z/time-buddy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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