1- # gtt [ ![ npm ] ( https://img.shields.io/npm/dt/gitlab-time-tracker.svg?style=flat-square )] ( https://www.npmjs.com/package/gitlab-time-tracker ) [ ![ npm ] ( https://img.shields.io/npm/v/gitlab-time-tracker.svg?style=flat-square )] ( https://www.npmjs.com/package/gitlab-time-tracker )
1+ # gtt
22
3- > A command line interface that makes working with GitLabs time tracking feature more enjoyable.
3+ [ ![ npm] ( https://img.shields.io/npm/dt/gitlab-time-tracker.svg?style=flat-square )] ( https://www.npmjs.com/package/gitlab-time-tracker ) [ ![ npm] ( https://img.shields.io/npm/v/gitlab-time-tracker.svg?style=flat-square )] ( https://www.npmjs.com/package/gitlab-time-tracker ) [ ![ npm] ( https://img.shields.io/npm/l/gitlab-time-tracker.svg )] ( https://www.npmjs.com/package/gitlab-time-tracker )
4+
5+ > A command line interface for GitLabs time tracking feature.
46
57gtt monitors the time you spent on an issue or merge request locally and syncs it to GitLab.
6- It also allows you to create time tracking reports in various formats from time tracking data
8+ It also allows you to create reports in various formats from time tracking data
79stored on GitLab.
810
911## requirements
1012
11- * [ node.js] ( https://nodejs.org/en/download ) version > 6
13+ * [ node.js] ( https://nodejs.org/en/download ) version >= 6
1214* [ npm] ( https://github.com/npm/npm ) or [ yarn] ( https://yarnpkg.com/en/docs/install )
1315
1416## installation
1517
16- Install the gtt command line interface:
18+ Install the gtt command line interface using yarn :
1719
1820```
19- # using yarn
2021yarn global add gitlab-time-tracker --prefix /usr/local
22+ ```
2123
22- # using npm
24+ ... or using npm:
25+
26+ ```
2327npm install -g gitlab-time-tracker
2428```
2529
@@ -38,62 +42,111 @@ url: https://gitlab.com/api/v4/
3842token: 01234567891011
3943```
4044
45+ ## updating
46+
47+ Update gtt via yarn:
48+
49+ ```
50+ yarn global upgrade gitlab-time-tracker
51+ ```
52+
53+ ... or npm:
54+
55+ ```
56+ npm install -g gitlab-time-tracker
57+ ```
58+
4159## commands
4260
43- #### time tracking
61+ ### configuration
4462
63+ > [ Click here] ( #configuration-options ) for a complete list of configuration options.
4564
65+ ** Edit/create the global configuration file, stored in your home directory:**
4666
47- Time tracking enables you to track and monitor your time locally. When you're done,
48- you can sync time records to GitLab and create "time spent comments" automatically.
67+ ```
68+ gtt config
69+ ```
70+
71+ ** Edit/create a local configuration file ` .gtt.yml ` in the current working directory:**
72+
73+ ```
74+ gtt config --local
75+ ```
76+
77+ If a local configuration file is present it's used instead of the global one.
78+ So you can use gtt on a per project basis. Make sure to add .gtt.yml to your
79+ gitignore file if using a local configuration.
80+
81+ ### time tracking
82+
83+ Time tracking enables you to monitor the time you spent on an issue or merge request locally.
84+ When you're done, you can sync these time records to GitLab: gtt adds the time spent to the given
85+ issue or merge request and automagically keeps everything in sync with your local data.
86+
87+ Did you forgot to stop time monitoring locally and accidentally synced it to GitLab?
88+ No worries, just edit the local record and run sync again.
89+
90+ ** Start local time monitoring for the given project and id:**
4991
5092```
51- # start LOCAL time monitoring for the given project and id. if you
52- # configured a project in your config you can omit the project
5393gtt start "kriskbx/example-project" 15
5494gtt start 15
95+ ```
5596
56- # status
97+ If you configured a project in your config you can omit the project.
98+
99+ ** Show the current time monitoring status:**
100+
101+ ```
57102gtt status
103+ ```
58104
59- # stop LOCAL time monitoring
105+ ** Stop local time monitoring and save as a new time record:**
106+
107+ ```
60108gtt stop
109+ ```
61110
62- # cancel LOCAL time monitoring and discard the record
111+ ** Cancel local time monitoring and discard the time record:**
112+
113+ ```
63114gtt cancel
115+ ```
64116
65- # log LOCAL time records
117+ ** Show a list of all local time records (including their ids and meta data):**
118+
119+ ```
66120gtt log
121+ ```
67122
68- # edit a LOCAL time record by it's id. you can omit the id
69- # to edit the last time record recorded
70- gtt edit 2xZkV5LNM
123+ ** Edit a local time record by the given id:**
124+
125+ ```
126+ gtt edit 2XZkV5LNM
71127gtt edit
128+ ```
72129
73- # delete a LOCAL time record by it's id. you can omit the id
74- # to delete the last time record recorded
75- gtt delete 2xZkV5LNM
76- gtt delete
130+ You can omit the id to edit the last added time record.
131+
132+ ** Delete a local time record by the given id:**
77133
78- # sync LOCAL time records to GitLab and create "time spent comments"
79- gtt sync
134+ ```
135+ gtt delete 2XZkV5LNM
136+ gtt delete
80137```
81138
82- #### edit configuration
139+ You can omit the id to delete the last added time record.
83140
84- Edit the configuration file. [ Available options ] ( #options )
141+ ** Sync local time records with time tracking data on Gitlab: **
85142
86143```
87- # edit/create the global configuration file, stored in your home directory
88- gtt config
89-
90- # edit/create a local configuration file (.gtt.yml) in the current directory.
91- # if a local configuration file is present, it's used instead of the global one.
92- # so you can use gtt on a per project basis. make sure to add .gtt.yml to your
93- # gitignore file if using a local configuration
94- gtt config --local
144+ gtt sync
145+ gtt sync --proxy="http://localhost:8888"
95146```
96147
148+ You can pass an url to the proxy option if you want to use a proxy server.
149+
97150#### reports
98151
99152Get a report for your project from GitLab.
0 commit comments