Skip to content

timemate/toggl-sync

Repository files navigation

toggl-sync: Synchronize time reports with ease

Latest GitHub release GitHub stars Homebrew downloads Go implementation (CI)

toggl-sync is a tiny CLI command/daemon for syncing Toggl time entries with Jira written in Go and distributed with HomeBrew.

This is the first implementation of the bigger concept of time-tracking, syncing, and reporting among third-party platforms.

In active development of v1 of TimeMate

Find the full concept overview in TimeMate docs.

Installation

Install the app via brew package manager.

brew tap timemate/tap
brew install toggl-sync

Re-install newer version of the library

brew update && \
  brew reinstall toggl-sync && \
  brew services restart toggl-sync

Configuration

Toggl

  1. Login to your toggl account
  2. Visit https://track.toggl.com/profile
  3. Find API token

Jira

  1. Login to your atlassian account
  2. Visit https://id.atlassian.com/manage-profile/security
  3. Create new API token with a name: toggl-sync

Config

Create a file in ~/.toggl-sync/config.yaml

tracker:
  - type: toggl
    token: "token-from-toggl"
#    projects:  # <-- use this section to filter projects
#      - 174942904

period:
  timeframe: 2w
  every: 1d

# places to sync time entries with
sync:
  - type: jira
    url: https://customer-host.atlassian.net
    login: [email protected]
    token: "token-from-jira"
    projects:
      - DO
      - DEV
  • timeframe - look for timeframe in the past for new entries
  • every - for --service mode, how often to repeat sync
  • projects it's a list of project keys in Jira.

Run the app

Brew background service

brew services start toggl-sync

The program will start on system start up.

Find logs in here tail -f $(brew --prefix)/var/log/toggl-sync/toggl-sync.log

One time run

toggl-sync sync -period 2w

Where -period specifies the period of time from current moment to sync. In this example 2w - 2 past weeks.

As a service

toggl-sync sync -period 1d --service

Where --service allows program to work as a daemon, it will repeatedly sync time entries every 1 day (1d).