{"id":2463,"date":"2012-03-11T11:51:29","date_gmt":"2012-03-11T10:51:29","guid":{"rendered":"http:\/\/www.devco.net\/?p=2463"},"modified":"2012-03-11T11:59:15","modified_gmt":"2012-03-11T10:59:15","slug":"go-with-the-flow-task-tracking-for-the-cli","status":"publish","type":"post","link":"https:\/\/www.devco.net\/archives\/2012\/03\/11\/go-with-the-flow-task-tracking-for-the-cli.php","title":{"rendered":"Go With The Flow – Task tracking for the CLI"},"content":{"rendered":"

I’ve wanted to play with the GLI gem<\/a> from Dave Copeland<\/a> for a while after seeing his presentation on writing CLI tools in Ruby<\/a> – he also has a book due on the subject<\/a> that I’m quite keen to get.<\/p>\n

I hate all task trackers, todo lists and everything like it, I’ve spent lots of money buying all sorts of tools with syncing and reminders and whatever and never end up seeing it through. I’ve always attacked the problem from my desktop, phone or tablet front but I realize I don’t actually use any of those. I use the CLI. I’ve had some ideas like using sub-shells to track progress on tasks while working in my Unix CLI where I live so I thought I’ll give it a go.<\/p>\n

So this weekend I finally sat down to play with GLI and wrote a little task tracker. GLI is quite nice, it’s not perfect there’s a few things I’d have done differently. But it saves so much time and brings all important consistency – there really isn’t enough wrong with it that you wouldn’t want to use it as the benefits are huge.<\/p>\n

The task tracker I wrote is designed for the CLI, it has the usual create, edit, close work flow so I won’t be going into much of that but see below:<\/p>\n

<\/p>\n

\r\n$ alias t=gwtf\r\n$ t a this is a sample task\r\n3 (open): this is a sample task\r\n$ t ls\r\n    3    this is a sample task\r\n\r\nItems: 1 \/ 2\r\n$ t done 3\r\n3 (closed): this is a sample task\r\n<\/pre>\n

<\/code><\/p>\n

Apart from these basic things though each task has a worklog where you can record activities associated with this task:<\/p>\n

<\/p>\n

\r\n$ t log 3 did some work on this sample task --hour=2\r\nLogged 'did some work on this sample task' against item 3 for 2 hours 0 minutes 0 seconds\r\n<\/pre>\n

<\/code><\/p>\n

So this just tracks that 2 hours of work was done on the item, this is nice if the work isn’t CLI based, but if they are CLI based:<\/p>\n

<\/p>\n

\r\n$ t shell 3\r\nStarting work on item 3, exit to record the action and time\r\n$ tmux attach-session -t foo\r\n# do your work\r\n$ exit\r\nOptional description for work log: Added some code feature\r\nRecorded 30 seconds of work against item: 3 (open,2): this is a sample task\r\n$ t show 3\r\n         ID: 3\r\n    Subject: this is a sample task\r\n     Status: open\r\nTime Worked: 2 hours 0 minutes 30 seconds\r\n    Created: 03\/11\/12 10:30\r\n\r\nWork Log: \r\n             03\/11\/12 10:33 did some work on this sample task (2 hours 0 minutes 0 seconds)\r\n             03\/11\/12 10:36 Added some code feature (30 seconds)\r\n<\/pre>\n

<\/code><\/p>\n

So here I went into a sub shell for this task, did some work in a tmux session and used gwtf to record the time spent – 30 seconds. When viewing the item all the work done is added up and a total is showed above.<\/p>\n

In the shell you’ll find environment variables for the current task ID, description and project I use this to give myself some visual feedback that I am working on a task as below<\/p>\n

<\/center><\/p>\n

It supports projects so you can group related tasks into a project. All the data is stored in simple JSON files in your home directory and it makes backups of your data on every change.<\/p>\n

Hopefully someone finds this useful, I’ll probably be tweaking it a lot to see if I can finally create a solution to this problem I like.<\/p>\n

The code is on GitHub<\/a> and you can just install the Gem<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"

I’ve wanted to play with the GLI gem from Dave Copeland for a while after seeing his presentation on writing CLI tools in Ruby – he also has a book due on the subject that I’m quite keen to get. I hate all task trackers, todo lists and everything like it, I’ve spent lots of […]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"","_et_pb_old_content":"","footnotes":""},"categories":[7],"tags":[121,103,13],"_links":{"self":[{"href":"https:\/\/www.devco.net\/wp-json\/wp\/v2\/posts\/2463"}],"collection":[{"href":"https:\/\/www.devco.net\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devco.net\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devco.net\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devco.net\/wp-json\/wp\/v2\/comments?post=2463"}],"version-history":[{"count":8,"href":"https:\/\/www.devco.net\/wp-json\/wp\/v2\/posts\/2463\/revisions"}],"predecessor-version":[{"id":2471,"href":"https:\/\/www.devco.net\/wp-json\/wp\/v2\/posts\/2463\/revisions\/2471"}],"wp:attachment":[{"href":"https:\/\/www.devco.net\/wp-json\/wp\/v2\/media?parent=2463"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devco.net\/wp-json\/wp\/v2\/categories?post=2463"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devco.net\/wp-json\/wp\/v2\/tags?post=2463"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}