workday-daemon
v0.29.0
Published
Lightweight activity tracker & timesheet tool
Maintainers
Readme
workday-daemon
Background daemon that tracks developer activity via git and pushes timesheets to Tempo.
Polls git repos every 30s, detects work sessions from diffs/reflog/commits, scores activity, and produces daily JSON logs. Supports multi-repo tracking with automatic leader election, adaptive idle timeouts, and manual log entries.
Install
npm install -g workday-daemonRequires Node.js 20+.
Quick Start
workday init # creates ~/.workday/ with config templates
# edit ~/.workday/config.json — add repo paths, tracked Jira project keys,
# and (optionally) your branch-owner name(s)
workday start # start background daemon
workday status # check running sessions
workday today # full day summaryCommands
workday init Initialize config in ~/.workday/
workday start Start daemon (background)
workday stop Stop daemon
workday status Show daemon status and sessions
workday today Today's summary
workday day YYYY-MM-DD Past day summary
workday pause [repo] Pause sessions
workday resume Resume paused sessions
workday autopause on|off [repo] Toggle idle auto-pause
workday log <task> <min> "<desc>" Log manual time on a task
workday fav-add <task> <min> "<name>" Add a favorite (reusable log template)
workday fav-remove <#|id> Remove a favorite
workday fav-list List favorites
workday jira-search "<query>" Live Jira issue search (key + summary)
workday session-delete <target> Delete a junk session (add --date for past days)
workday tempo Show report (month to date)
workday tempo --push Push to Tempo
workday month [YYYY-MM] Month view: day statuses vs Tempo
workday tempo-sync [YYYY-MM] Refresh the month's Tempo snapshot (mirror pull)
workday tempo-import [YYYY-MM] Adopt Tempo-only worklogs as local entries
workday schedule [YYYY-MM] Tempo work schedule (required hours, holidays)
workday approval [YYYY-MM] Tempo timesheet approval status
workday notifications Active desktop notifications (tray toasts)
workday notifications test [minutes] Inject a test notification (pipeline check)
workday notifications ack <id> <act> Acknowledge (shown|opened|hidden)
workday daemon Run in foreground (live dashboard)Configuration
~/.workday/config.json
{
"repos": ["/path/to/repo-a", "/path/to/repo-b"],
"boundaryHour": 4,
"tracking": {
"projectKeys": ["PROJ", "OTHER"],
"branchOwners": ["your-username"]
},
"genericBranches": ["develop", "main", "master"],
"session": {
"diffPollSeconds": 30,
"signalDeduplicationSeconds": 300,
"reflogCount": 20,
"idleCloseHours": 3
},
"report": { "roundingMinutes": 15 },
"workDays": [1, 2, 3, 4, 5],
"notifications": {
"timesheetReminder": { "enabled": true, "notifyHour": 14 }
}
}tracking.projectKeys are the Jira projects whose branches/commits the daemon
follows (the branch task regex is derived from them — no hand-written regex).
tracking.branchOwners marks branches as yours: a branch is tracked only when
one of the names appears as an exact delimiter-separated word in the branch
name, case-insensitive — "jdoe" matches PROJ-1-jdoe-fix but not
PROJ-1-jdoes-fix, and "jdo" never matches jdoe. Empty list = every
branch is tracked. In the tray app both live under Settings → Tracking, with
projects picked from the Jira catalog. Legacy configs migrate automatically:
taskPattern seeds projectKeys, and the old secrets.json Developer
field seeds branchOwners.
notifications.timesheetReminder drives the tray's desktop toast: on the last
working day of the month (per workDays + holidays), from notifyHour
until the month ends, while unpushed days remain — delivered once per month,
at the first moment the user is actually at the keyboard.
~/.workday/secrets.json
{
"Jira_Email": "[email protected]",
"Jira_BaseUrl": "https://your-company.atlassian.net",
"Jira_Token": "",
"Tempo_Token": ""
}Config can also live next to package.json for local development — the daemon checks there first before falling back to ~/.workday/.
How It Works
- Polls
git diff --numstat,git status, andgit reflogfor each repo - Filters branches by tracked project keys and branch-owner names
- Computes diff deltas between snapshots (dynamics = actual keystrokes)
- Manages session lifecycle: IDLE → PENDING → ACTIVE
- Scores activity via EMA with adaptive idle timeout (15–45 min)
- Elects a leader session across repos (highest score wins)
- Writes atomic JSON logs to
~/.workday/data/YYYY-MM/MM-DD.json - Day boundary detected automatically (default 4:00 AM)
Data
Daily logs stored as JSON in ~/.workday/data/. Sessions recover after crashes (up to 7 days lookback).
License
MIT
