Introducing gh-log

This weekend I finished and released a small tool I’ve been wanting to write for a few months. It is called gh-log and it is a plugin for GitHub’s gh CLI tool. The plugin adds a gh log subcommand which is sort of like git log but for actions you take on GitHub, such as creating or closing issues, reviewing or merging PRs, pushing branches and tags, etc.

When you run gh log, it prints out a summary of what you did on GitHub over the past 7 days, in chronological order. You can specify a different time frame using the --since option. Here’s an example of the output.

λ gh log --since '3 days ago'
Thursday, March 20
maproulette/maproulette3
  09:36  reviewed PR "make open editor buttons linked" (#2558) (approved)
  09:52  reviewed PR "fix positioning of move challenge to project modal" (#2598) (approved)
  11:12  pushed 1 commits to refs/heads/jlow/upgrade-react-table
  11:55  pushed 1 commits to refs/heads/jlow/upgrade-react-table

Saturday, March 22
OSMCha/osmcha-frontend
  10:41  commented on issue "OSMCha incorrectly claims no tags were changed in changeset" (#770)
  10:48  commented on issue "OSMCha.org doesn't load changesets" (#637)

OSMCha/osmcha-django
  10:51  commented on PR "Fix N+1 query problem in GET /api/v1/changesets/" (#744)

OSMCha/osmcha-frontend
  12:35  commented on issue "OSMCha.org doesn't load changesets" (#637)

OSMCha/osm-adiff-service
  12:50  created issue "Service crashes with error: "Unexpected token u in JSON at position 0"" (#23)
  13:49  created branch jlow/bump-changeset-xml-parser

OSMCha/osm-changeset-xml-parser
  13:50  created tag v1.0.1
  13:50  pushed 2 commits to refs/heads/main

OSMCha/osm-adiff-service
  13:51  created PR "Bump @osmcha/osm-changeset-xml-parser (fixes #23)" (#24)
  14:14  merged PR "Bump @osmcha/osm-changeset-xml-parser (fixes #23)" (#24)
  14:14  closed issue "Service crashes with error: "Unexpected token u in JSON at position 0"" (#23) (completed)
  14:14  pushed 1 commits to refs/heads/main

OSMCha/osmcha-deploy
  14:27  created branch jlow/bump-osm-adiff-service
  14:28  created PR "Bump osm-adiff-service version" (#66)
  14:31  merged PR "Bump osm-adiff-service version" (#66)
  14:31  pushed 1 commits to refs/heads/main

I wrote this tool to help me remember what I did last week. I like to review what I’ve been working on from time to time—it helps me spend my time wisely and follow up on things that I might otherwise forget about. I keep a work journal to help me with this too, but I don’t always add every last thing to it, and some days I forget to update it at all. Seeing the actions I’ve taken on GitHub helps jog my memory and fill in gaps I may have left in my notes.

This is also the first program I’ve written in Go. Go, being a popular and very successful language, is something that a lot of programmers have strong and diverging opinions on. I had read a bunch of these opinions before ever touching Go, so I admit that I went in with some preconceptions about the language’s strengths and weaknesses. My experience so far mostly matched my expections, but it was nice to get some hands-on experience and start forming my own opinions about Go.

Anyway, if you want to try out gh-log, you can install it by running:

gh extension install jake-low/gh-log

Please let me know if you do, and feel free to open an issue if you run into any problems.