CLI for using Jira offline
Project description
Git-like CLI for using Jira offline
Work offline and sync your changes back to Jira later. Create issues, modify issues, view stats, run Jira health queries.. All from a friendly git-like CLI.
Installation
A few options exist:
- Install globally with pip (not recommended)
- Install into a virtualenv with pip
- Pull and run the latest docker image
- Clone the source code and use docker compose
Install globally with pip
pip install jira-offline
Install into a virtualenv with pip
python3 -m venv jira && source jira/bin/activate
pip install jira-offline
Docker image
Unfortunately you need an access token for even public packages hosted on Github. Get yours from your settings. Pull the docker image and run it:
echo "$GITHUB_TOKEN" | docker login -u mafrosis --password-stdin docker.pkg.github.com
docker pull docker.pkg.github.com/mafrosis/jira-offline/jira-offline:dev
docker run --rm -it docker.pkg.github.com/mafrosis/jira-offline/jira-offline:dev
Clone and use docker compose
git clone https://github.com/mafrosis/jira-offline.git
cd jira-offline
docker-compose build jira-offline
docker-compose run --rm jira-offline
Known Limitations
See the Github Issues for a comprehensive list.
- You can't change the state of an issue (eg. In Progress -> Done) (GH21).
- You can't change an issue's type from (for example) Bug -> Story (GH20).
- There are mandatory fields required on Jira project screens (GH16).
- It's slow. Reading and writing all data to a single JSONL file is inefficient, and the use of the Pandas library is making the CLI slow (GH13).
- No support for the same project key from two different Jiras (an edge-case at this stage).
- There's a known race condition where a Jira project's issuetypes and priority values can be changed whilst working offline. This could mean that broken issues are created offline (GH22).
Quick Start
NB: The following examples assume jira is available in $PATH
Clone
The clone command is used to to setup a new project, which takes a single URI describing your
project.
Authentication to Jira
There are two auth options, basic and oAuth.
Basic Auth
Basic auth is quick and takes your existing username and password. Beware that this will write your password into the config file on disk.
jira clone --username benji https://jira.atlassian.com/PROJ
You will be prompted for your password.
oAuth
oAuth is preferred, as it's token based and doesn't require your password. However it requires the
setup of an Application Link on the Jira server.
jira clone --oauth-private-key=applink.pem https://jira.atlassian.com/PROJ
How To Use
NB: The following examples assume jira is available in $PATH
How to configure a new Jira project
Use clone to add a project:
jira clone https://jira.atlassian.com/PROJ
Contributing
In order to contribute, please fork this repo on Github and raise pull a request with your changes.
You can see a simple development/debugging workflow in the debugging section.
Run The Tests
There are four types of testing/validation in the source code:
- Linting of syntactic code errors, and other Python style issues with
pylint - Typechecking of the python, based on the type-hints in the source using
mypy - Unit testing via
pytest, by running all the tests - Integration testing - which requires a local instance of Jira
The Makefile run the first three steps in order, when you invoke the make command on its own.
These three checks are also run on every pull request - and must pass for your code to mergeable.
You can invoke any individual stage directly with:
make lintmake typecheckmake testmake integration
Debugging
The simplest way to debug before opening an issue or contributing is to run the application from
source code in a docker container, using the test image.
-
Clone the source code to your machine
-
Build the main & test docker images:
docker-compose build jira-offline
docker-compose build test
- Edit
docker-compose.ymlon line 5, to use the-testimage:
jira-offline:
image: mafrosis/jira-offline-test
-
Add a breakpoint in the code with
import ipdb; ipdb.set_trace() -
Run the main docker image, which will then break:
docker-compose run --rm jira-offline <CMD>
Comparison to other Jira CLIs
None of the existing clients use the "offline" approach taken by this tool:
danshumaker/jira-cli- A full featured node.js CLI. This might be a better option ifjira-offlinelacks features you need.keepcosmos/terjira- Feature-rich Ruby CLI with a neat interactive query function.mikepea/go-jira-ui- A neat ncurses client focussed on listing issues and making simple changes.foxythemes/jira-cli- A handsome node.js REPL-style interactive CLI. A very different approach fromjira-offline.toabctl/jiracli- A simple CLI for Jira. Not actively maintained.alisaifee/jira-cli- Another unmaintained and poorly-documented CLI.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file jira-offline-0.1a6.tar.gz.
File metadata
- Download URL: jira-offline-0.1a6.tar.gz
- Upload date:
- Size: 39.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
302d1146f6204a7f75bf6f1d372ce75fe717be2242f25672a51be974eea65ea2
|
|
| MD5 |
8232ddc15e162b3730a2a83e76b8c3fe
|
|
| BLAKE2b-256 |
fcd78ad512212e560e3cd6a6ae5a24ef43c3f430044937c5e6ca0437f62385a1
|
File details
Details for the file jira_offline-0.1a6-py3-none-any.whl.
File metadata
- Download URL: jira_offline-0.1a6-py3-none-any.whl
- Upload date:
- Size: 35.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1ffef1a320607b5c990dd6606ce61cd81b5144f72a1cc079ad3493efc3963e05
|
|
| MD5 |
fc4496f383b6020e8d28198e2f64ccd5
|
|
| BLAKE2b-256 |
e48fc022aa4f8c066743fa09642ff7d68c17f3f7e8fe798e702775bed2ff1f8a
|