WakaTime CLI
Use the local wrapper commands instead of calling the WakaTime CLI freehand. They are wired to the installed CLI at ~/.wakatime/wakatime-cli, the user's existing ~/.wakatime.cfg, and the WakaTime summaries API.
Command map
~/bin/wakatime-branches [extra args]Lists branch time for the requested day or date range, optionally filtered by project name.~/bin/wakatime-ticket-time KEY-123 [extra args]Resolves local branches matching the Jira key, infers the WakaTime project from the repo name, and fetches branch-specific time from the summaries API using bothprojectandbranches.
Intent mapping
- Requests like
what branches did I work on todayshould use~/bin/wakatime-branches. - Requests like
what branches did I work on in soteria todayshould use~/bin/wakatime-branches --project-match soteria. - Requests like
how much time did I spend on SOT-829orfetch WakaTime for SOT-829should use~/bin/wakatime-ticket-time SOT-829. - Requests for machine-readable ticket time should use
~/bin/wakatime-ticket-time SOT-829 --json. - Requests to prepare a Jira update from tracked time should use branch rows or ticket-specific branch time, then use the Jira skill or Jira wrappers to inspect the target ticket.
- Requests that name both
$wakatime-cliand$jira-aclishould fetch ticket-specific WakaTime first, then passtime_text,total_seconds, date range, project, and branch into the Jira branch-ticket update workflow.
Output guidance
- For branch-list summaries, report project, branch, and time, ordered by time descending.
- For ticket-related summaries, report the ticket key, project, matched branch, and time.
- If JSON is requested for ticket time, use
wakatime-ticket-time ... --json. - Do not print API keys or config secrets.
- For Jira handoffs, preserve both the human-readable time and exact seconds. Jira
timeSpentshould be rounded to practical Jira syntax such as1h 48m; keep the wrapper's exact seconds only for audit context if needed.
Workflow
- For branch discovery by day, run
~/bin/wakatime-branches. - For branch discovery within a project, run
~/bin/wakatime-branches --project-match soteria. - For ticket-specific time, run
~/bin/wakatime-ticket-time KEY-123. - For structured ticket time, run
~/bin/wakatime-ticket-time KEY-123 --json. - If the user wants the time reflected on Jira, pass the branch rows or ticket-specific branch time into the Jira workflow.
Jira Handoff Workflow
Use this flow when the user asks to update the associated Jira ticket with branch time.
- Infer the Jira key from the branch when the user does not provide one.
- Run
~/bin/wakatime-ticket-time KEY-123 --json. - Use the row whose
branchmatches the current branch and whoseprojectmatches the repo. - Convert
time_textinto JiratimeSpentsyntax, such as1 hr 48 minsto1h 48m. - Pass the ticket key, branch, project, date range,
time_text,total_seconds, and JiratimeSpentstring to the Jira worklog workflow. - After Jira creates a worklog, include the returned worklog id in any ticket description update.
Guardrails
- Do not read or print secret values from
~/.wakatime.cfg. - Prefer the wrapper commands over calling
~/.wakatime/wakatime-clidirectly. - Ticket-to-time matching depends on branch names containing the Jira key, such as
sot-829-browser-map-toggleforSOT-829. - Branch-specific totals should be fetched with both
projectandbranches; using onlybranchesreturned misleading results during verification. - If the CLI is missing or errors, report that clearly and stop rather than guessing.
- Do not guess time when the wrapper returns no matching row; report the miss and continue Jira updates without worklogging unless the user gives a duration.
- Do not double-log previously recorded Jira time. Inspect existing Jira worklogs when updating a ticket that already has logged time for the same branch/date.
Useful raw commands
~/bin/wakatime-branches~/bin/wakatime-branches --project-match soteria~/bin/wakatime-ticket-time SOT-829~/bin/wakatime-ticket-time SOT-829 --json