@@ -11,12 +11,14 @@ stored on GitLab.
1111
1212![ preview] ( https://raw.githubusercontent.com/kriskbx/gitlab-time-tracker/master/preview.gif )
1313
14- ### requirements
14+ ## requirements
1515
16- * nodejs version > 6
17- * npm or yarn
16+ * [ node.js ] ( https:// nodejs.org/en/download ) version > 6
17+ * [ npm] ( https://github.com/npm/npm ) or [ yarn] ( https://yarnpkg.com/en/docs/install )
1818
19- ### installation
19+ ## installation
20+
21+ Install the gtt command line interface:
2022
2123```
2224# using yarn
@@ -26,18 +28,37 @@ yarn global add gitlab-time-tracker --prefix /usr/local
2628npm install -g gitlab-time-tracker
2729```
2830
31+ Run the config command to create a config file and open it in your default editor.
32+ If nothing happens, open the file manually: ` ~/.gtt/config.yml `
33+
34+ ```
35+ gtt config
36+ ```
37+
38+ Add your GitLab API url and your [ GitLab API personal token] ( https://gitlab.com/profile/personal_access_tokens )
39+ to the config file and save it afterwards:
40+
41+ ```
42+ url: https://gitlab.com/api/v4/
43+ token: 01234567891011
44+ ```
45+
2946#### upgrading from 0.*
3047
3148I built gtt originally in PHP because I'm a PHP dev and I chose the language I'm most familiar
3249with to create a quick and dirty prototype. After some consideration I rebuilt everything from
33- scratch for nodejs . Follow these steps to upgrade:
50+ scratch for node.js . Follow these steps to upgrade:
3451
3552```
3653# 1. remove the old version entirely
3754composer global remove kriskbx/gitlab-time-tracker
3855
3956# 2. install the new version
40- yarn global add gitlab-time-tracker
57+ # using yarn
58+ yarn global add gitlab-time-tracker --prefix /usr/local
59+
60+ # using npm
61+ npm install -g gitlab-time-tracker
4162
4263# 3. edit your configuration and update the date format
4364# format options: http://momentjs.com/docs/#/displaying/format/
@@ -49,12 +70,10 @@ gtt edit
4970# with total time spent. please update your config accordingly
5071```
5172
52- ### commands
73+ ## commands
5374
5475#### time tracking
5576
56-
57-
5877Time tracking enables you to track and monitor your time locally. When you're done,
5978you can sync time records to GitLab and create "time spent comments" automatically.
6079
@@ -187,7 +206,7 @@ gtt report --output=csv --file=filename.csv
187206gtt report --output=pdf --file=filename.pdf
188207```
189208
190- ### configuration options
209+ #### configuration options
191210
192211Here's a sample configuration file including all available options:
193212
@@ -316,7 +335,7 @@ _parallel: 4
316335_perPage: 100
317336```
318337
319- ### use as a library
338+ ## use as a library
320339
321340```
322341# install as dependency
@@ -357,14 +376,14 @@ report.mergeRequests.forEach(mergeRequest => {
357376
358377```
359378
360- ### faqs
379+ ## faqs
361380
362381#### What is the difference between 'total spent' and 'spent'?
363382
364383` total spent ` is the total amount of time spent in all issues after filtering.
365384It can include times outside the queried time frame. ` spent ` on the other hand
366385is the total amount of time spent in the given time frame.
367386
368- ### license
387+ ## license
369388
370389GPL v2
0 commit comments