Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.

Commit b357020

Browse files
committed
Unsuck docs #2
1 parent e1e36ed commit b357020

File tree

2 files changed

+96
-36
lines changed

2 files changed

+96
-36
lines changed

package.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
{
22
"name": "gitlab-time-tracker",
33
"version": "1.3.0",
4-
"description": "A CLI that makes working with GitLabs time tracking feature more enjoyable",
4+
"description": "A command line interface for GitLabs time tracking feature.",
5+
"bugs": {
6+
"url": "https://github.com/kriskbx/gitlab-time-tracker/issues"
7+
},
8+
"repository": {
9+
"type": "git",
10+
"url": "https://github.com/kriskbx/gitlab-time-tracker.git"
11+
},
512
"main": "gtt.js",
613
"scripts": {},
714
"bin": {

readme.md

Lines changed: 88 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,29 @@
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
57
gtt 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
79
stored 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
2021
yarn global add gitlab-time-tracker --prefix /usr/local
22+
```
2123

22-
# using npm
24+
... or using npm:
25+
26+
```
2327
npm install -g gitlab-time-tracker
2428
```
2529

@@ -38,62 +42,111 @@ url: https://gitlab.com/api/v4/
3842
token: 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
5393
gtt start "kriskbx/example-project" 15
5494
gtt 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+
```
57102
gtt status
103+
```
58104

59-
# stop LOCAL time monitoring
105+
**Stop local time monitoring and save as a new time record:**
106+
107+
```
60108
gtt stop
109+
```
61110

62-
# cancel LOCAL time monitoring and discard the record
111+
**Cancel local time monitoring and discard the time record:**
112+
113+
```
63114
gtt 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+
```
66120
gtt 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
71127
gtt 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

99152
Get a report for your project from GitLab.

0 commit comments

Comments
 (0)