Jira CLI: The Missing Command-line Tool for Atlassian Jira
Tags: go, opensource, showdev, bash
Published: 2021-10-16 13:52:48

---
title: Jira CLI: The Missing Command-line Tool for Atlassian Jira
published: true
description: Feature-rich interactive command-line for Jira to boost your productivity.
tags: golang, opensource, showdev, bash
canonical_url: https://medium.com/@ankitpokhrel/introducing-jira-cli-the-missing-command-line-tool-for-atlassian-jira-fe44982cc1de
cover_image: https://miro.medium.com/max/1400/0*qMSabMbCD0KSuACp
---

_The [original version](https://medium.com/@ankitpokhrel/introducing-jira-cli-the-missing-command-line-tool-for-atlassian-jira-fe44982cc1de) of this post first appeared in Medium._

> The year is 2078 and there have been 0 improvements in the Jira UI — #rant

Jira UI is terrible to work with. It is slow, buggy, and doesn’t even load on occasions. If you have to rely on it for your day-to-day job it is going to cost you a lot of time and frustration. These frustrations pile up if you need to create tickets, in a pre-defined format with proper labels, components, etc, for every change you make, even a typo!

Since I spend a significant amount of my time in the command-line, this is my small attempt to make Jira experience better for the CLI users.

### Introducing Jira CLI

{% github ankitpokhrel/jira-cli %}

### TLDR; Features Highlight

- Interactive mode + an option to easily integrate with shell/automation scripts using standard [POSIX-complaint](https://www.gnu.org/software/libc/manual/html_node/Argument-Syntax.html) flags.
- [Easy search](https://github.com/ankitpokhrel/jira-cli/#list) and navigation. For instance, you can easily search for something like “_Issues that are of high priority, is in progress, was created this month, and has a label called backend_” with `jira issue list -yHigh -s"In Progress" --created month -lbackend`
- [Create a neat Jira ticket](https://github.com/ankitpokhrel/jira-cli/#create) (and [comment](https://github.com/ankitpokhrel/jira-cli/#comment)) using [Github-flavored](https://github.github.com/gfm/) + [Jira-flavored](https://jira.atlassian.com/secure/WikiRendererHelpAction.jspa?section=all) markdown as a template. Supports pre-defined templates.
- The ticket details are translated to [markdown](https://github.github.com/gfm/) from the [Atlassian document](https://developer.atlassian.com/cloud/jira/platform/apis/document/structure/) and is [beautifully displayed](https://github.com/ankitpokhrel/jira-cli/#view) on the screen when you view it.
- Easy [sprint](https://github.com/ankitpokhrel/jira-cli/#sprint) and [epic](https://github.com/ankitpokhrel/jira-cli/#epic) navigation. You can quickly view tickets in previous, current, and next sprint tickets using flags like `--prev`, `--next`, and `--current` eg: `jira sprint list --current`.
- Fast and straightforward [ticket cloning](https://github.com/ankitpokhrel/jira-cli/#clone) with the ability to replace text in summary and description.
- You can [edit](https://github.com/ankitpokhrel/jira-cli#edit), [link](https://github.com/ankitpokhrel/jira-cli#link), [assign](https://github.com/ankitpokhrel/jira-cli#assign) and [transition](https://github.com/ankitpokhrel/jira-cli#movetransition) the issues with ease.
- Supports multiple Jira servers using `--config` flag or `XDG_CONFIG_HOME` env.

### Disclaimer

The tool is mosty tested with the latest Jira cloud since that’s what I usually work with. However, the support for on-premise Jira installation is [on the way](https://github.com/ankitpokhrel/jira-cli/issues/138).

Also, the tool is still a work in progress with some exciting features in the todo pipeline.

### Searching for an Issue

[JiraCLI](https://github.com/ankitpokhrel/jira-cli) makes searching for an issue as easy as it should be. The lists are displayed in an interactive UI and can be navigated easily to perform actions like viewing, navigating, and copying issue keys/links.

The examples below shows how easy it is to look for an issue. See more examples [here](https://github.com/ankitpokhrel/jira-cli).

```
# List issues that I am watching in the current board
$ jira issue list -w

# List issues assigned to me
$ jira issue list -a$(jira me)

# List issues created within an hour and updated in the last 30 minutes️
$ jira issue list --created -1h --updated -30m

# Give me issues that are of high priority, is in progress, was created this month, and has given labels 🔥
$ jira issue list -yHigh -s"In Progress" --created month -lbackend -l"high prio"

# Wait, what was that ticket I opened earlier today? 😫
$ jira issue list --history# What was the first issue I ever reported on the current board? 🤔
$ jira issue list -r$(jira me) --reverse

# What was the first bug I ever fixed in the current board? 🐞
$ jira issue list -a$(jira me) -tBug sDone -rFixed --reverse

# What issues did I report this week? 🤷‍♂️
$ jira issue list -r$(jira me) --created week
```

### Creating an Issue

The `create` command lets you create an issue and supports Github-flavored and Jira-flavored markdown for writing descriptions. You can load pre-defined templates using `--template` flag.

```
# Create an issue using interactive prompt
$ jira issue create

# Pass required parameters to skip prompt or use --no-input option
$ jira issue create -tBug -s"New Bug" -yHigh -lbug -lurgent -b"Bug description"

# Load description from template file
$ jira issue create --template /path/to/template.tmpl
```

![Creating an issue](https://miro.medium.com/max/1400/1*YJ7iBrmFlpBR3VSgj3UIXg.gif)

The preview below shows the markdown template passed in JiraCLI and the way it is rendered in the Jira UI.

![Create shell and UI preview](https://miro.medium.com/max/1400/1*k5q3jXFs2m_oYHUI3qBDzA.jpeg)

### Viewing an Issue

The `view` command lets you see issue details in a terminal. Atlassian document is roughly converted to a markdown and is nicely displayed in the terminal.

```
$ jira issue view ISSUE-1
```

![Viewing an issue](https://miro.medium.com/max/1400/1*5Zt6icnszXhq3ALznT5pTA.gif)

### Assigning a user to an issue

The `assign` command lets you easily assign and unassign users to and from the issue.

![Assigning a user to an issue](https://miro.medium.com/max/1400/1*Cs0JlkQWXCSP1MtUApjptw.gif)

```
# Assign user to an issue using interactive prompt
$ jira issue assign

# Pass required parameters to skip prompt
$ jira issue assign ISSUE-1 "Jon Doe"

# Assign to self
$ jira issue assign ISSUE-1 $(jira me)

# Will prompt for selection if keyword suffix returns multiple entries
$ jira issue assign ISSUE-1 suffix

# Assign to default assignee
$ jira issue assign ISSUE-1 default

# Unassign
$ jira issue assign ISSUE-1 x
```

### Cloning an Issue

The `clone` command lets you clone an issue. You can update fields like summary, priority, assignee, labels, and components when cloning the issue. The command also allows you to replace a part of the string (case-sensitive) in summary and description using `--replace/-H` option.

```
# Clone an issue
$ jira issue clone ISSUE-1

# Clone issue and modify the summary, priority and assignee
$ jira issue clone ISSUE-1 -s"Modified summary" -yHigh -a$(jira me)

# Clone issue and replace text from summary and description
$ jira issue clone ISSUE-1 -H"find-me:replace-with-me"
```

### Sprints

Sprints are displayed in an explorer view by default. You can output the results in a table view using the `--table` flag. When viewing sprint issues, you can use all filters available for the issue command. You can quickly view tickets in previous, current, and next sprint tickets using flags like `--prev`, `--next`, and `--current`.

![Sprints](https://miro.medium.com/max/1400/1*3pFxH8lmXAdGDpNXYhZKsQ.gif)

```
# Display sprints in an interactive list
$ jira sprint list

# Display tickets in the current active sprint
$ jira sprint list --current

# Display tickets in the previous sprint
$ jira sprint list --prev

# Display tickets of a particular sprint
$ jira sprint list <SPRINT_ID>
```

### Learn more

Check out [the project page](https://github.com/ankitpokhrel/jira-cli) to view the full set of features and learn more about the project.

Your suggestions and feedback is highly appreciated. Feel free to [start a discussion](https://github.com/ankitpokhrel/jira-cli/discussions) or [create an issue](https://github.com/ankitpokhrel/jira-cli/issues/new) to share your experience about the tool or to discuss a feature/issue. If you think this project is useful, consider contributing by [starring the repo](https://github.com/ankitpokhrel/jira-cli/stargazers), sharing with your friends, or submitting a PR.