Command line tool used to track you time working on a GitLab issue.
Each time you start working on something, the timer create a new Toggl time entry with the name of the branch you are currently on (assuming you are working on a merge request with a branch named $issueID-$issue-title
.
Once you are done, stop the current entry and the associated Toggl timer will be stopped and the duration of the timer will be added to the GitLab issue as spent time.
npm install -g gitlab-toggl-timer
You need to create a Toggl project manualy. The project name must match the following format: NAMESPACE/PROJECT
TODO: Change this part for a detailled work-flow with examples
The timer check your git repository to gather information about what you are currently working on
- Remote (by default origin): to get the name of the project you are working on
- Current branch: to get the id of the issue you are working on (assuming you made a merge request where the branch name looks like
10-issue-name
where10
is the issue id)
Config file is located at ~/.gitlab-toggl-timer.config
.
If you don't have a config file, you will be asked a few questions about your GitLab and Toggl accounts so that it can be created.
Create a GitLab token with access to the api
Create a Toggle api token
TODO: Check gitconfig filename
Add the following alias to ~/.git.config
[alias]
start = !gitlab-toggl-timer start $@
stop = !gitlab-toggl-timer stop $@
current-timer = !gitlab-toggl-timer current $@