undpaul/toggl2redmine

Command line tool to sync toggl time entries to redmine

1.1.2 2022-01-12 12:33 UTC

This package is not auto-updated.

Last update: 2024-04-05 13:14:34 UTC


README

PHP CLI tool for syncing toggl with redmine.

Latest Stable Version Total Downloads Latest Unstable Version License

Time entry sync

Currently only time-entry-sync is available.

  • One-way-synchronisaton from toggl to Redmine
  • Mapping of Toggl tag name with Redmine
  • Sync state is marked as tag #synched in Toggl

Installation

The installation is simple by using composer. After installing composer you can either install the command globally or within a project.

Global

In the global installation toggl2redmine will be available as a command line tool.

  • Run composer global require undpaul/toggl2redmine to install globally.
  • Add export PATH=~/.composer/vendor/bin:$PATH to your .bashrcor .profile

After the installation you should be able to run toggl2redmine time-entry-sync ... from anywhere.

Local

You can run composer require undpaul/toggl2redmine in any composer enabled project to add this project as a dependency.

Usage

You can run the global or local command by appending options, use a configuration file or use both. A command line argument or option will allways override a setting from the toggl2redmine.yml.

Global: toggl2redmine.php time-entry-sync ...

Local: ./toggl2redmine time-entry-sync ...

Command line arguments and options

Usage:
 time-entry-sync [--workspace="..."] [--fromDate="..."] [--toDate="..."] [--defaultActivity="..."] redmineURL redmineAPIKey tooglAPIKey

Arguments:
 redmineURL            Provide the URL for the redmine installation
 redmineAPIKey         The APIKey for accessing the redmine API
 tooglAPIKey           API Key for accessing toggl API

Options:
 --workspace           Workspace ID to get time entries from
 --fromDate            From Date to get Time Entries from (default: "-1 day")
 --toDate              To Date to get Time Entries from (default: "now")
 --defaultActivity     Name of the default redmine activity to use for empty time entry tags (default: "")

Configuration

You can place a toggl2redmine.yml in your current working directory for local defaults. For global defaults you can place it at ~/.toggl2redmine/toggl2redmine.yml. Attention: local and global defaults will not be merged. The local default always take precedence over the global defaults, in the case it exists.

You can find a template for toggl2redmine.yml at default.toggl2redmine.yml. Make sure to rename it to toggl2redmine.yml!

For example, for adding the default config template to the global folder you can simply type:

mkdir ~/.toggl2redmine
curl https://github.com/undpaul/toggle2redmine/blob/main/default.toggl2redmine.yml > ~/.toggl2redmine/toggl2redmine.yml