blob: bba6cc223cd749e5d781611dcbd40c6273de214b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
|
# hcl
HCl is a command-line tool for interacting with Harvest time sheets using the
[Harvest time tracking API][htt].
[htt]: http://www.getharvest.com/api/time_tracking
## Quick Start
NOTE This software is nowhere near complete. To try it out:
$ cp hcl_conf.yml.example hcl_conf.yml
$ $EDITOR hcl_conf.yml
$ ./bin/hcl show [date]
### Prerequisites
* Ruby (tested with 1.8.7)
* Ruby OpenSSL support (in debian/ubuntu: apt-get install libopenssl-ruby)
* RubyGems
* Trollop option-parsing library (gem install trollop)
* Chronic date-parsing library (gem install chronic)
## Usage
NOTE that *add* and *rm* are not yet implemented.
hcl show [date]
hcl tasks
hcl set <key> <value ...>
hcl unset <key>
hcl start (<task_alias> | <project_id> <task_id>) [msg ...]
hcl note <msg ...>
hcl stop
hcl add (<task_alias> | <project_id> <task_id>) <duration> [msg ...]
hcl rm [entry_id]
### Starting a Timer
To start a new timer you need to identify the project and task. After you've
used the show command you can use the tasks command to view a cached list of
available tasks. The first two numbers in each row are the project and task
IDs. You need both values to start a timer:
$ hcl show
-------------
0:00 total
$ hcl tasks
1234 5678 ClientX Software Development
1234 9876 ClientX Admin
$ hcl start 1234 5678 adding a new feature
### Task Aliases
Since it's not practical to enter two long numbers every time you want to
identify a task, HCl supports task aliases:
$ hcl set task.xdev 1234 5678
$ hcl start xdev adding a new feature
### Adding Notes to a Running Task
While a task is running you can append strings to the note for that task:
$ hcl note Found a good time
$ hcl note or not, whatever...
### Stopping a Timer
The following command will stop a running timer (currently only one timer at
a time is supported):
$ hcl stop
### Date Formats
Dates can be expressed in a variety of ways. See the [Chronic documentation][cd]
for more information about available date input formats. The following
commands show the timesheet for the specified day:
$ hcl show yesterday
$ hcl show last friday
$ hcl show 2 days ago
$ hcl show 1 week ago
[cd]: http://chronic.rubyforge.org/
## Author
[Zack Hobson][zgh], [OpenSourcery LLC][os]
See LICENSE for copyright details.
[zgh]: mailto:zack@opensourcery.com
[os]: http://www.opensourcery.com/
## TODO
* Implement time-tracking API methods:
- display today's time sheet (done)
- display any time sheet by date (done)
- start a timer (done)
- stop a timer
- post a time sheet entry
- delete a time sheet entry
- update a time sheet entry
* better UI for e.g. tasks aliases
* command-line configuration
* search ~/.hcl_config for configuration
* integrate timesheet functionality into aiaio's [harvest gem][hg]
[hg]: http://github.com/aiaio/harvest/tree/master
|