Very cool! I wrote a project a few years ago to do something similar: https://github.com/christiangenco/t_time_tracker
It lets you add tasks like this:
$ t browsing HN
Started: browsing HN (now)
$ t @website writing blog post
Finished: browsing HN (0:12)
Started: @website writing blog post (now)