Skip to content

techdivision/opencode-time-tracking

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@techdivision/opencode-time-tracking

Automatic time tracking plugin for OpenCode. Tracks session duration and tool usage, writing entries to a CSV file compatible with Jira worklog sync.

Installation

Add to your opencode.json:

{
  "plugin": ["@techdivision/opencode-time-tracking"]
}

Configuration

1. Project Configuration

Add the time_tracking section to your .opencode/opencode-project.json:

{
  "$schema": "https://raw.githubusercontent.com/techdivision/opencode-plugins/main/schemas/opencode-project.json",
  "time_tracking": {
    "csv_file": "~/time_tracking/time-tracking.csv",
    "default_account_key": "YOUR_ACCOUNT_KEY"
  }
}

2. User Email (Environment Variable)

Set your user email via the OPENCODE_USER_EMAIL environment variable.

Add to your .env file (recommended):

OPENCODE_USER_EMAIL=your@email.com

Or export in your shell:

export OPENCODE_USER_EMAIL=your@email.com

If not set, the system username is used as fallback.

How it works

  • Tracks tool executions during each session turn
  • Extracts JIRA ticket from git branch name (e.g., feature/PROJ-123-description)
  • Writes CSV entry when session becomes idle (after each complete response)
  • Shows toast notification with tracked time

CSV Format

id,start_date,end_date,user,ticket_name,issue_key,account_key,start_time,end_time,duration_seconds,tokens_used,tokens_remaining,story_points,description,notes

Events

Event When triggered
session.idle After each complete AI response (including all tool calls)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published