Skip to content

igancev/work-reporter

Repository files navigation

⏱️ Work Reporter

CLI tool for automatically reporting work time from local sources (time trackers) to task trackers.

Build Coverage Status MSI License: MIT


😩 The Problem

At work, you need to log time spent on tasks. Throughout the day you switch between different tasks and activities, but task trackers like YouTrack often lack convenient built-in time tracking tools. Meanwhile, dedicated time trackers like SuperProductivity do this job perfectly — but at the end of the day, manually copying worklogs from one tool to another is tedious, repetitive, and boring.

🚀 The Solution

Work Reporter automates this routine. It reads time entries from your local time tracker and submits them to your task tracker with a single command. Just configure the source-to-destination mapping once, and let Work Reporter handle all the dirty work for you.

✨ Features & Supported Integrations

  • 📥 Supported sources:
  • 📤 Supported destinations:
  • 🔀 Automatic grouping of identical time entries
  • 🕐 Filtering out entries shorter than 1 minute
  • 🔧 Simple YAML configuration

🏗️ The architecture is extensible — adding new sources and destinations is straightforward.


📦 Installation

One-liner install — download the latest binary and you're ready to go:

Linux (amd64)

echo "⬇  Downloading work-reporter..." && curl -#L "$(curl -s https://api.github.com/repos/igancev/work-reporter/releases/latest | grep -oP '"browser_download_url":\s*"\K[^"]*linux-amd64')" -o work-reporter && echo "📦 Installing to /usr/local/bin..." && chmod +x work-reporter && sudo mv work-reporter /usr/local/bin/ && echo "✅ Done. Run: work-reporter --version"

macOS (Apple Silicon)

echo "⬇  Downloading work-reporter..." && curl -#L "$(curl -s https://api.github.com/repos/igancev/work-reporter/releases/latest | grep -o '"browser_download_url":[^"]*"[^"]*darwin-arm64[^"]*"' | cut -d'"' -f4)" -o work-reporter && echo "📦 Installing to /usr/local/bin..." && chmod +x work-reporter && sudo mv work-reporter /usr/local/bin/ && echo "✅ Done. Run: work-reporter --version"

Verify the installation

work-reporter --version

💡 You can also browse all releases for manual download.


🔧 Quick Start

Generate a default configuration file:

work-reporter init

This creates a config file at ~/.config/work-reporter/config.yaml with a template you can edit.


⚙️ Configuration

Create a config file at ~/.config/work-reporter/config.yaml:

# Active Source type: superProductivity | plainJson
source: superProductivity

# Active Destination type: youTrack | somethingElse
destination: youTrack

# Configuration for each source type
sources:
    superProductivity:
        syncFilePath: ~/.config/superProductivity/__meta_
    plainJson:
        filePath: /path/to/time-entries.json

# Configuration for each destination type
destinations:
    youTrack:
        # Your YouTrack instance URL
        url: https://youtrack.example.com
        # Permanent token for authentication
        token: your-api-token

🔑 Getting a YouTrack Token

  1. Open YouTrack → ProfileAccount Security
  2. Click New token…
  3. Set the scope and create the token
  4. Paste the token into your config file

🔄 Setting up SuperProductivity Sync

  1. Open SuperProductivity → SettingsSync & ExportSync
  2. Enable Enable Syncing
  3. Choose Sync folder path
  4. Paste the same path into sources.superProductivity.syncFilePath in your config file

🎯 Usage

# Submit worklogs for today (default)
work-reporter

# Submit worklogs for a specific date range (optional)
work-reporter --from="2026-05-01" --to="2026-05-02"

📅 Both --from and --to are optional. If omitted, today's date is used by default.


🛠️ Development

Requirements

  • PHP 8.4+
  • Composer

Setup

composer install

Commands

Command Description
make cs Check code style (PSR-12)
make cs-fix Auto-fix code style
make stat-analyze Static analysis (PHPStan)
make unit Run unit tests
make functional Run functional tests
make check-all Run all checks
make mutation Mutation testing (Infection)

Mutation testing

Mutation testing runs via Infection and is not part of make check-all. CI enforces a threshold (min-msi=70 and min-covered-msi=70) to ensure test quality. Raise the thresholds in .github/workflows/quality-checks.yaml as test quality improves.


🏗️ Architecture

The project follows a Source → Destination pattern:

[SuperProductivity / JSON] → TimeEntry[] → [YouTrack]
  • Source — reads time entries from a local data source
  • TimeEntry — value object representing a single entry
  • Destination — submits entries to a task tracker

🤝 Contributing

Contributions are welcome! Please read the Contribution Guide before opening a Pull Request — it describes the testing and CI requirements your change must satisfy.

Quick start:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/awesome)
  3. Cover your changes with tests
  4. Make sure make check-all passes ✅
  5. Open a Pull Request

📄 License

MIT © igancev


⭐ Like the project?

Give it a star — it helps and motivates! 🌟

About

A versatile CLI tool for automated reporting of work time. It bridges local time-tracking data (like JSON files or SuperProductivity sync files) with professional task trackers, ensuring your worklogs are always up to date.

Resources

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages