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.
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file time_buddy-1.0.1.tar.gz.
File metadata
- Download URL: time_buddy-1.0.1.tar.gz
- Upload date:
- Size: 8.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fdb699b308c40ed2c3a41dc8bf0548dd31be9baaad667d201670c23270642f6d
|
|
| MD5 |
ba28911348e97c9a5113a66e68f64857
|
|
| BLAKE2b-256 |
50a8de31d02befaf17bd53b94fd1c17b9e6f58e1f68a15727ff807b37d7a7ec8
|
Provenance
The following attestation bundles were made for time_buddy-1.0.1.tar.gz:
Publisher:
release.yml on alen-z/time-buddy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
time_buddy-1.0.1.tar.gz -
Subject digest:
fdb699b308c40ed2c3a41dc8bf0548dd31be9baaad667d201670c23270642f6d - Sigstore transparency entry: 777896666
- Sigstore integration time:
-
Permalink:
alen-z/time-buddy@7f3d7040b6c7edd78fc7d2d1172ae7eb8b9dab20 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/alen-z
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@7f3d7040b6c7edd78fc7d2d1172ae7eb8b9dab20 -
Trigger Event:
push
-
Statement type:
File details
Details for the file time_buddy-1.0.1-py3-none-any.whl.
File metadata
- Download URL: time_buddy-1.0.1-py3-none-any.whl
- Upload date:
- Size: 9.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7d1886f0e757a227774dbbabb5013d2a30be82228bb13a86964a0c554c4d3ca8
|
|
| MD5 |
747532bc4a069f290b75b28426f7f75d
|
|
| BLAKE2b-256 |
31cb7f3f1161e38f58dbb6de722a9cff53c4144a7caa95c9f852640bed9a8658
|
Provenance
The following attestation bundles were made for time_buddy-1.0.1-py3-none-any.whl:
Publisher:
release.yml on alen-z/time-buddy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
time_buddy-1.0.1-py3-none-any.whl -
Subject digest:
7d1886f0e757a227774dbbabb5013d2a30be82228bb13a86964a0c554c4d3ca8 - Sigstore transparency entry: 777896673
- Sigstore integration time:
-
Permalink:
alen-z/time-buddy@7f3d7040b6c7edd78fc7d2d1172ae7eb8b9dab20 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/alen-z
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@7f3d7040b6c7edd78fc7d2d1172ae7eb8b9dab20 -
Trigger Event:
push
-
Statement type: