posts:harvest: Add a post on Harvest and hcl
[blog.git] / posts / Harvest.mdwn
1 [Harvest][] is a time-tracking service (although I prefer the local
2 [timebook][], for which I maintain an ebuild in my
3 [[overlay|Gentoo_overlay]]).  There is an [hcl][] command line app
4 (distributed as a Ruby gem) that you can use to clock in and out via
5 the command line.  Harvest sorts folks into [subdomains][], and you'll
6 need to know your subdomain to configure `hcl`:
7
8     $ hcl 
9     Please specify your Harvest credentials.
10     Email Address: you@example.net
11     Password: 
12     Subdomain: example
13     Use SSL? (y/n): y
14     Writing configuration to /home/you/.hcl/config.yml.
15             -------------
16             0:00    total (as of 05:28 pm)
17
18 You can also get help with the usual `hcl --help`.
19
20 Harvest tracks [projects][] and [tasks][], each with numeric ids.  You
21 can find prject ids (via the web UI) by browsing to a [specific
22 project][project].  You can use the web UI to add yourself to
23 projects, but that probably takes admin powers.  Once you're added, to
24 a project, hcl will list its tasks (with numeric project and task
25 identifiers):
26
27     $ hcl tasks
28     1234 5678 Example Co. - [MP] My Project - Feature Development
29     1234 1357 Example Co. - [MP] My Project - Maintenance / Debugging
30     1234 2468 Example Co. - [MP] My Project - Project Managment
31     1234 9090 Example Co. - [MP] My Project - System Administration
32
33 You can refer to tasks by their project and task numbers, or assign
34 aliases:
35
36     $ hcl alias dev 1234 5678
37     $ hcl alias maint 1234 1357
38     $ hcl alias proj 1234 2468
39     $ hcl alias sysadmin 1234 9090
40     $ hcl aliases
41     @dev, @maint, @proj, @sysadmin
42
43 Then start tasks by their alias:
44
45     $ hcl @proj
46
47 You can optionally backdate your start time and provide an additional
48 message:
49
50     $ hcl @proj +0:20 Harvest time-tracking
51
52 See what you're currently doing:
53
54     $ hcl
55             0:22    (running) Beehive: Harvest time-tracking
56             -------------
57             0:22    total (as of 09:42 am)
58
59 Add notes about your activity:
60
61     $ hcl note Documenting basic hcl usage
62
63 And clock out when you're done:
64
65     $ hcl stop Coffee break
66
67 The Harvest folks publish the [API][] in a Git repository, so it's
68 easy to track changes or grep for keywords.
69
70 [Harvest]: http://www.getharvest.com/
71 [timebook]: https://bitbucket.org/trevor/timebook/overview
72 [hcl]: https://github.com/zenhob/hcl
73 [subdomains]: https://example.harvestapp.com/
74 [projects]: https://example.harvestapp.com/projects
75 [tasks]: https://example.harvestapp.com/tasks
76 [project]: https://example.harvestapp.com/projects/1234/edit
77 [API]: https://github.com/harvesthq/api
78
79 [[!tag tags/tools]]