Jira Integration with Git CLI.
Jig is an attempt at making it easier for me and my colleagues to collaborate on jira issues.
Specifically:
- Making it simpler to create branches with descriptive names.
- Automatically include issue key in commits.
- Simplifying issue administration and workflow
- Creating Worklogs.
- Transitioning issues.
- Assigning to others.
- Bonus: Scripting Jira interactions.
$ jig help
A Jira CLI integration with Git
Usage: jig <COMMAND>
Commands:
assign Assign user to issue
branch Create and checkout branch using issue key with(out) summary as branch name
comment Create comment on a Jira Issue
completion Generate completion script
configs List config file locations
hook Install git commit-msg hook
init Initialise config file(s)
worklog Create a work log entry on a Jira issue
transition Move ticket through transitions
open Open issue in your browser
query Interactively send JQL queries to Jira when tab is pressed
upgrade Download and install latest version
help Print this message or the help of the given subcommand(s)
Options:
-h, --help Print help
-V, --version Print version
# Create or checkout branch named after an issue.
jig branch
# Work on that branch and commit as usual. git add/commit/push.
# Make comments as you progress with your work.
jig comment "Note: Changed impl due to X"
# Create worklogs as you finish up a session or at the end of the day.
jig log 1h --comment "Bug squashed"
# Transition issue according to your workflow.
jig move
Pick between cloud
and data-center
instances (The APIs are slightly different)
wget
mkdir -p ~/.local/bin || true
# Cloud
wget -O ~/.local/bin/jig "https://github.com/baarsgaard/jig/releases/latest/download/jig-cloud-x86_64-unknown-linux-gnu"
# Data-center
wget -O ~/.local/bin/jig "https://github.com/baarsgaard/jig/releases/latest/download/jig-data-center-x86_64-unknown-linux-gnu"
chmod +x ~/.local/bin/jig
# A musl variant is available be replacing gnu with musl
Using eget
eget baarsgaard/jig --to ~/.local/bin/jig -a gnu -a cloud
Compile from source with Rust
cargo install --locked --git https://github.com/baarsgaard/jig --features <cloud|data-center>
Untested, mileage will vary
Invoke-WebRequest -Uri "https://github.com/baarsgaard/jig/releases/download/latest/jig-$INSTANCE-x86_64-pc-windows-msvc.exe" -OutFile "C:\<Somewhere in PATH>"
Supports Global and Local config files.
~/.config/jig/config.toml
and .jig.toml
respectively (XDG).
If both exist, they are merged with the Local config taking priority.
This is useful when working across repositories with varying contribution workflows or issue queries tailored to creating branches or worklogs from the current location.
Generate your configuration using:
jig init [--all]
Why?
I personally love a strict Git workflow with well designed PRs and every commit being attributed to an issue.
But convincing others to adopt this can be a challenge without obvious benefits.
An obvious use case being my own workflow:
Most if not all my work at $day_job is coordinated through and logged in Jira.
additionally I'm not a fan of doing simple tasks in the Jira UI..
I always know the issue I am currently working on, I am on the branch already.
Why could I not log my time or comment more easily? Maybe directly from the terminal even?
Looking at the existing CLI tools that interacted with Jira, none solved my exact problem.
Hence, Jig!
Jig is designed to simplify working with a "Per issue" branching model.
It therefore includes options and features I needed to support that.
Primarily:
- Creating or checking out branches from existing Jira issues with(out) summaries.
- Quickly logging time and Commenting on the issue found in the branch name.
- Moving issues from one status to the next.
- Scripting, I live for automation.