So you’re hacking away, and realise that you need to refactor some code. But it’s not in the path of what you’re actually working on. When this happens to me, I often find myself faced with a very small decision - which drops me out of my zone:
- Do I open a browser and create a ticket, risking distractions and losing flow entirely?
- Do I add a TODO in the code, making it a tiny bit uglier?
- Do I just hope to remember that this needs to be done, knowing deep inside that I will forget?
ihai is a small script which helps developers note these things without losing too much flow.
- bash
go-jirafrom https://github.com/go-jira/jira.
If you’re on a mac, you can install go-jira using homebrew:
brew install go-jiraThe script install.sh should help you get things running.
It’s an interactive script, and it will ask you for the following info after you run it.
- Your Jira endpoint. It should look something like:
https://YOUR_ORG.atlassian.net. - Your Jira username. It should look like an email address.
- Your default Jira project. (Optional)
The script does not require escalated privileges.
ihai expects the ticket summary as commandline arguments. The ticket description is expected to be entered as STDIN. Before it submits the ticket, go-jira will start your default editor so you can eyeball/edit everything. If this annoys you, you can start ihai with the -n flag.
$ ihai This is a test ticket Please enter a description, and exit with ctrl-d. This is my ticket. Yay >> Creating ticket: OK >> Labelling ticket as 'ihai ': OK >> git branch name suggestion (copied to clipboard) git checkout -b key-1014-this-is-a-test-ticket
As you can see above, the ticket is labelled with the label ihai, to make it easy to find. It also pastes a suggested branch name into your (mac) clipboard.
Running ihai with the -L option followed by one or more labels (whitespace separated) will add these new labels next to the ihai label.
$ ihai -l
This will output all existing ihai tickets which are not Done.