๐ A powerful work time tracking tool for the command line
Project description
Drudge CLI - Professional Work Time Tracking Tool
A comprehensive, professionally architected command-line tool for tracking work time on tasks with organized daily logs. Built with modern Python package structure, Typer CLI framework, Rich formatting, type hints, dataclasses, and enterprise-level architectural patterns.
๐ฏ Version 2.1.1 - Enhanced CLI: Native help system, enhanced end command with --all flag, and powerful clean command for worklog management.
โจ Key Features
๐ Task Management
- Smart task tracking: Start, end, pause, and resume tasks
- Anonymous work sessions: Start working without naming the task
- Single-task mode: Auto-ends previous tasks (default behavior)
- Parallel mode: Work on multiple tasks simultaneously with
--parallelflag - Custom timestamps: Backdate entries with
--time HH:MM - Pause/Resume: Interrupt work and continue later
๐ Reporting & Views
- Unified list command: See active, paused, and completed tasks at a glance
- Recent tasks: View detailed recent work history
- Daily summaries: Time totals and task breakdown by day
- Flexible filtering: By date, task name, or custom limits
๐๏ธ NEW in v2.1.0: Clean Command
- Clean by date: Remove all entries for a specific date
- Clean by task: Remove all entries for a task across all dates
- Selective cleaning: Clean task entries for specific date only
- Clean all: Reset entire worklog with confirmation
- Automatic backups: Safety first - backups before deletion
๐ ENHANCED in v2.1.0: End Command
- Default:
drudge end- Ends only active tasks - New --all flag:
drudge end --all- Ends active AND paused tasks
โ IMPROVED in v2.1.0: Help System
- Native Typer
--helpintegration - Command-specific help:
drudge COMMAND --help - Consistent with standard CLI conventions
๐ฆ Installation
Prerequisites
- Python 3.8+ (tested with Python 3.10 and 3.13)
- Required packages:
typer[all]andrich
Install from PyPI
pip install drudge-cli
Install from Source
# Clone the repository
git clone https://github.com/Trik16/drudge.git
cd drudge
# Install in development mode
pip install -e .
Setup Shell Alias
# Run the setup script
./setup_drudge_alias.sh
# Or add manually to your shell config
echo 'alias drudge="python3 -m src.worklog"' >> ~/.zshrc
source ~/.zshrc
๐ Quick Start
# Start your workday
drudge start "Morning emails"
# Check what's active
drudge list
# End the task
drudge end "Morning emails"
# View today's summary
drudge daily
๐ Command Reference
| Command | Description | Example |
|---|---|---|
| Task Management | ||
drudge start "Name" |
๐ Start a new task (auto-ends previous) | drudge start "Bug fix #123" |
drudge start |
๐ Start anonymous work session | drudge start |
drudge start --parallel |
๐ Start without ending active tasks | drudge start "Review" --parallel |
drudge start --time HH:MM |
๐ Start at specific time | drudge start "Meeting" --time 09:30 |
drudge end "Name" |
๐ End a specific task | drudge end "Bug fix #123" |
drudge end |
๐ End ALL active tasks (paused remain) | drudge end |
drudge end --all |
๐ NEW End active AND paused tasks | drudge end --all |
drudge end --time HH:MM |
๐ End at specific time | drudge end "Meeting" --time 17:30 |
drudge pause "Name" |
โธ๏ธ Pause an active task | drudge pause "Task" |
drudge resume "Name" |
โถ๏ธ Resume a paused task | drudge resume "Task" |
| Cleaning & Maintenance | ||
drudge clean YYYY-MM-DD |
๐๏ธ NEW Clean all entries for date | drudge clean 2025-10-03 |
drudge clean "Task" |
๐๏ธ NEW Clean task (all dates) | drudge clean "Bug fix" |
drudge clean "Task" --date |
๐๏ธ NEW Clean task for specific date | drudge clean "Meeting" -d 2025-10-03 |
drudge clean --all |
๐๏ธ NEW Clean ALL entries (confirm) | drudge clean --all |
| Viewing & Reporting | ||
drudge list |
๐ Show active, paused, completed | drudge list |
drudge list --date YYYY-MM-DD |
๐ List entries for date | drudge list --date 2025-10-03 |
drudge list --task "keyword" |
๐ Filter by task name | drudge list --task "bug" |
drudge list --limit N |
๐ Limit results | drudge list --limit 10 |
drudge recent |
๐ Recent tasks (full details) | drudge recent |
drudge recent --limit N |
๐ Show N recent tasks | drudge recent --limit 10 |
drudge daily |
๐ Today's summary | drudge daily |
drudge daily --date YYYY-MM-DD |
๐ Specific date summary | drudge daily --date 2025-10-03 |
| Help & Info | ||
drudge --help |
โ IMPROVED Main help | drudge --help |
drudge COMMAND --help |
โ IMPROVED Command help | drudge start --help |
drudge config |
โ๏ธ Show configuration | drudge config |
drudge version |
๐ฆ Show version | drudge version |
๐ก Usage Examples
Basic Task Tracking
# Start a task
$ drudge start "Fix bug #123"
๐ Started 'Fix bug #123' at 2025-10-04 10:00:00
# End it
$ drudge end "Fix bug #123"
๐ Completed 'Fix bug #123' at 2025-10-04 12:30:00 (Duration: 02:30:00)
Anonymous Work Session
# Don't know what you're working on yet?
$ drudge start
๐ก Starting anonymous work session
# Name it later (converts anonymous โ named)
$ drudge start "Research and planning"
โ๏ธ Renamed anonymous work to 'Research and planning'
Parallel Tasks
# Work on multiple tasks simultaneously
$ drudge start "Backend API"
$ drudge start "Code review" --parallel # Keeps Backend API running
$ drudge list
๐ฅ ACTIVE TASKS:
โข Backend API (Running: 01:00:00)
โข Code review (Running: 00:15:00)
# End specific task
$ drudge end "Code review"
๐ Completed 'Code review' (Duration: 00:30:00)
Pause and Resume
# Working on a task
$ drudge start "Important project"
# Lunch break
$ drudge pause "Important project"
โธ๏ธ Paused 'Important project'
# Back from lunch
$ drudge resume "Important project"
โถ๏ธ Resumed 'Important project'
# Finish up
$ drudge end "Important project"
๐ Completed 'Important project' (Duration: 03:30:00)
Enhanced End Command (v2.1.0)
# Create test scenario
$ drudge start "Active Task"
$ drudge start "Another Task" --parallel
$ drudge pause "Active Task"
$ drudge list
๐ฅ ACTIVE TASKS:
โข Another Task (Running: 00:05:00)
โธ๏ธ PAUSED TASKS:
โข Active Task
# End only active tasks (DEFAULT behavior)
$ drudge end
โ
Ended 1 task(s) successfully # Only "Another Task" ended
$ drudge list
โธ๏ธ PAUSED TASKS:
โข Active Task # Paused task remains!
# End ALL tasks including paused (NEW --all flag)
$ drudge end --all
โถ๏ธ Resumed 'Active Task'
๐ Completed 'Active Task'
โ
Ended 1 task(s) successfully
Clean Command (v2.1.0)
# Clean all entries for a specific date
$ drudge clean 2025-10-03
โ
Cleaned 15 entries for 2025-10-03
๐พ Backup created for safety
# Clean all entries for a task (across all dates)
$ drudge clean "Bug fix #123"
โ
Cleaned 3 entries for task 'Bug fix #123'
๐พ Backup created for safety
# Clean task entries for specific date only
$ drudge clean "Meeting" --date 2025-10-03
โ
Cleaned 1 entries for task 'Meeting' on 2025-10-03
๐พ Backup created for safety
# Clean everything (with confirmation)
$ drudge clean --all
โ ๏ธ This will clean ALL worklog entries!
Are you sure you want to continue? [y/N]: y
โ
Cleaned 50 entries and 10 daily files
๐พ Backup created for safety
Custom Time Entry
# Forgot to track? Backdate it
$ drudge start "Morning standup" --time 09:00
๐ Started 'Morning standup' at 2025-10-04 09:00:00
$ drudge end "Morning standup" --time 09:30
๐ Completed 'Morning standup' (Duration: 00:30:00)
Daily Reporting
# View today's summary
$ drudge daily
๐
Daily Summary for 2025-10-04
๐ Total: 5 tasks, 7h 30m
โข Fix bug #123: 2h 30m
โข Code review: 1h 00m
โข Morning standup: 0h 30m
โข Documentation: 2h 00m
โข Backend API: 1h 30m
# View specific date
$ drudge daily --date 2025-10-03
๐๏ธ Architecture
Package Structure
src/worklog/
โโโ __init__.py # Package initialization
โโโ __main__.py # Entry point
โโโ models.py # Data models (TaskEntry, PausedTask, WorkLogData)
โโโ config.py # Configuration management
โโโ validators.py # Input validation
โโโ managers/ # Business logic
โ โโโ worklog.py # Core WorkLog class
โ โโโ backup.py # Backup management
โ โโโ daily_file.py # Daily file operations
โโโ cli/ # Command-line interface
โ โโโ commands.py # Typer commands
โโโ utils/ # Utilities
โโโ decorators.py # Common decorators
Data Storage
~/.worklog/
โโโ worklog.json # Complete task database (JSON)
โโโ worklog.log # Application logs
โโโ 2025-10-01.txt # Human-readable daily logs
โโโ 2025-10-02.txt
โโโ 2025-10-03.txt
โโโ daily/ # Backup directory
โโโ 2025-10-01.txt
โโโ 2025-10-02.txt
Daily File Format
2025-10-04 09:00:00 Morning standup (00:30:00)
2025-10-04 10:00:00 Fix bug #123 (02:30:00)
2025-10-04 14:00:00 Backend API [ACTIVE]
2025-10-04 15:00:00 Code review [PAUSED]
๐ Version History
Version 2.1.0 (Current - October 4, 2025)
New Features:
- โจ Enhanced end command:
--allflag to end both active and paused tasks - โจ Clean command: Erase worklog entries by date, task, or all (with backups)
- โจ Improved help: Native Typer
--helpintegration (removed custom help command)
Improvements:
- ๐ง End command:
drudge endkeeps paused tasks,drudge end --allends everything - ๐ก๏ธ Clean safety: Automatic backups, confirmation for --all, smart daily file rebuild
- ๐ All 39 test cases passing
Version 2.0.2
New Features:
- Anonymous work sessions
- Parallel task mode
- Optimized list command
- Enhanced recent command
Version 2.0.1
Major Refactoring:
- Complete architectural overhaul
- Typer CLI framework with Rich formatting
- Professional package structure
- 28 comprehensive test cases
Version 1.0
- Initial release with basic task tracking
๐งช Testing
Run Tests
# Run all tests
python3.10 -m pytest test_worklog_updated.py -v
# Run specific test class
python3.10 -m pytest test_worklog_updated.py::TestNewFeatures -v
Test Coverage
- 39 comprehensive test cases
- 100% pass rate on Python 3.10 and 3.13
- Core features: Start, end, pause, resume
- New features: Anonymous tasks, parallel mode, clean command
- Edge cases and error handling
๐ ๏ธ Development
Build Package
# Build distribution
python3.10 -m build
# Check distribution
twine check dist/*
Publish to PyPI
# Upload to PyPI
twine upload dist/*
๐ License
MIT License - See LICENSE file for details
๐ Links
- GitHub: github.com/Trik16/drudge
- PyPI: pypi.org/project/drudge-cli
- Changelog: CHANGELOG.md
- Release Notes: docs/RELEASE_2.1.0.md
๐ Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
๐ฌ Support
For issues, questions, or feature requests, please open an issue on GitHub.
Built with โค๏ธ using Python, Typer, and Rich
Version 2.1.1 - Enhanced CLI with native help, powerful clean command, and improved task management
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 drudge_cli-2.1.1.tar.gz.
File metadata
- Download URL: drudge_cli-2.1.1.tar.gz
- Upload date:
- Size: 32.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c8d9ec0ed4bb919abdd3ddf00e3e753479a8e17c2dd742f4efae42b15a50d223
|
|
| MD5 |
118ec13a41e4b4e0f3bb01ebb7d06d9f
|
|
| BLAKE2b-256 |
ec4c734aca6325f96f11f3e8d908ea8beeb97a7a8bf34befc4ee80708ea7e436
|
Provenance
The following attestation bundles were made for drudge_cli-2.1.1.tar.gz:
Publisher:
publish.yml on Trik16/drudge
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
drudge_cli-2.1.1.tar.gz -
Subject digest:
c8d9ec0ed4bb919abdd3ddf00e3e753479a8e17c2dd742f4efae42b15a50d223 - Sigstore transparency entry: 583938933
- Sigstore integration time:
-
Permalink:
Trik16/drudge@ccb9028d5145371afc3f02811871b5a6b325ce15 -
Branch / Tag:
refs/tags/v2.1.1 - Owner: https://github.com/Trik16
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ccb9028d5145371afc3f02811871b5a6b325ce15 -
Trigger Event:
push
-
Statement type:
File details
Details for the file drudge_cli-2.1.1-py3-none-any.whl.
File metadata
- Download URL: drudge_cli-2.1.1-py3-none-any.whl
- Upload date:
- Size: 30.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 |
0a834433a8fb897d7a6ba7db9a26b0e2440c1d5f6d9f37e0abb366566ac7ccd9
|
|
| MD5 |
0ee18b45b343c06607b020cf5547a17e
|
|
| BLAKE2b-256 |
cd700e804e700e8b921cad090cd6850be1455b9b48cffc0ff29b0ae8a1c0cd28
|
Provenance
The following attestation bundles were made for drudge_cli-2.1.1-py3-none-any.whl:
Publisher:
publish.yml on Trik16/drudge
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
drudge_cli-2.1.1-py3-none-any.whl -
Subject digest:
0a834433a8fb897d7a6ba7db9a26b0e2440c1d5f6d9f37e0abb366566ac7ccd9 - Sigstore transparency entry: 583938934
- Sigstore integration time:
-
Permalink:
Trik16/drudge@ccb9028d5145371afc3f02811871b5a6b325ce15 -
Branch / Tag:
refs/tags/v2.1.1 - Owner: https://github.com/Trik16
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ccb9028d5145371afc3f02811871b5a6b325ce15 -
Trigger Event:
push
-
Statement type: