npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

jgit

v0.12.0

Published

Utility functions for Jira and Git

Downloads

545

Readme

jgit

Pronounced /dʒeɪ ɡɛt/

A Jira and Git workflow management tool with a CLI interface

oclif Version Downloads/week

Purpose

jgit allows you to easily:

  • Create standardized git branch names and conventional commit messages from Jira issues
  • Search and open changeset requests (i.e., Pull Requests and Merge Requests) that are associated to specific Jira issues
  • Query changeset requests for files changed in relation to specific Jira Issues
    • If you use neovim and grapple.nvim, you can use this feature to easily pick back up where you started when working on a Jira ticket, by getting a list of file paths that you were working with, and paste that list of file paths into the grapple.nvim buffer.
  • Generate Slack-style messages referencing changeset requests created to address Jira issues

Who This Tool is For

Although there are integrations between Jira and GitHub such as GitHub for Atlassian, these require set up, and sometimes your organization may not do this. This is where jgit is useful, because it acts as an "unofficial" integration tool that makes it easier to work with Jira issues and remote git repositories until (hopefully) the official integration is set up within your organization.

Why I created this

I made this tool because I'm lazy.

Specifically, I wanted:

  • A unified and simple interface for interfacing with whatever remote git repository is used within a repository, without having to alternate between using gh and glab, and re-learn the specific syntax of each to do the same tasks.
  • A standardized way of creating git branch names and commit messages that did not require thinking on my end. While I appreciate the ability in Jira to automatically create git branch directly from a Jira issue, this integration requires set up on behalf of your company, and if your company does not have that set up, you are stuck with the old way of creating git branch names.
  • An easy way to share with coworkers when I had created PRs/MRs for a Jira issue, in a nicely formatted markdown message to post in Slack.

Comparison with other tools

gh CLI

To search for all PRs related to a Jira issue and open the results in a web browser:

gh pr list --search "TEAM-123" --state all --web

glab CLI

To search for merged MRs related to a Jira issue:

glab mr list --search "TEAM-123" --merged

To search for open MRs related to a Jira issue:

glab mr list --search "TEAM-123"

NOTE: You cannot get a list of all MRs that reference a Jira issue in the title regardless of their state using glab NOTE: You cannot automatically open all found MRs that reference a Jira issue in their title using glab

jgit

Compared to:

jg prs TEAM-123 --web

Setup

GitHub API Auth

You will need to export a GitHub OAuth Token to authenticate with the GitHub API.

GitHub Personal Access Token Documentation

export JGIT_GITHUB_OAUTH_TOKEN="YOUR_GITHUB_OAUTH_TOKEN"

GitLab API Auth

You will need to export a GitLab OAuth Token to authenticate with the GitLab API.

GitLab Personal Access Token Documentation

export JGIT_GITLAB_HOSTNAME="YOUR_GITLAB_HOSTNAME"
export JGIT_GITLAB_OAUTH_TOKEN="YOUR_GITLAB_OAUTH_TOKEN"

Codeberg API Auth

You will need to export a GitLab OAuth Token to authenticate with the GitLab API.

Codeberg Personal Access Token Documentation

export JGIT_CODEBERG_OAUTH_TOKEN="YOUR_GITLAB_OAUTH_TOKEN"

Jira API Auth

You will need the following env vars set in your shell to authenticate with the Jira API:

Jira API Token Documentation

export JGIT_JIRA_HOSTNAME="https://jira.example.com"
export JGIT_JIRA_API_TOKEN="YOUR_JIRA_API_TOKEN"
export JGIT_JIRA_API_EMAIL="YOUR_JIRA_EMAIL"

Development Setup

git clone https://github.com/Drew-Daniels/jg.git
cd jg || exit

Majority of users:

pnpm i

If using nix+direnv:

direnv allow .

Debugging

To help debug a failing command, prepend DEBUG=<logger-name> to the command you're having issues with.

The following logger names are valid:

  • http
  • config
DEBUG=http,config jg related TEAM-123

Release Process

  • Update the version with: pnpm version <patch|minor|major>
  • Create the distributable output with: pnpm run build
  • Commit and push any updates if necessary
  • Publish the latest version of the package: pnpm publish

Roadmap

  • [ ] Enable users to specifically search only merged/open/closed changeset requests related to an issue when using changesets sub-command: --merged, --open, --closed
  • [ ] Allow users to specify multiple jira tickets as arguments for commands:
    • changesets
    • changed
  • [ ] Enable searching through changeset request "body" data as well, not just titles to turn up more results that might be tangentially related to a given jira issue
  • [ ] Look into modifying (or adding another command) the cc subcommand such that it also squashes all commits on a branch and sets the commit message to the conventional commit message
  • [ ] Add a doctor subcommand to check for configuration issues
  • [ ] Replace mocha test runner with native NodeJS test-runner
  • [ ] Enable code coverage using builtin NodeJS coverage tool
  • [ ] Enable Codeberg backend
  • [ ] Look into creating a Codeberg API client using Codeberg's swagger documentation, and a code generation tool
  • [ ] Implement testing similar to how the twilio CLI does it:
    • https://github.com/twilio/twilio-cli
    • https://github.com/twilio/twilio-cli-test
  • [ ] Enable users to get specific changeset request by index, instead of just first and last (Ex., --second, --number=2, .etc.)
    • Applies to changesets
  • [ ] Allow for more flexible Jira Issue parsing logic by using dot-prop and user configuration to map Jira Issue fields to Conventional Commit pieces (type, scope, description, etc.)
  • [ ] Add --tree option to changed subcommand to display changed files in a filetree format
    • Using something like to-path-tree & object-treeify to parse an array of filepaths and transform it into a tree format
  • [ ] Add --table option to changesets subcommand to display all changeset requests in a table format
    • Using something like tty-table or cliui to render the table itself

Usage

$ npm install -g jgit
$ jg COMMAND
running command...
$ jg (--version)
jgit/0.12.0 darwin-arm64 node-v24.4.1
$ jg --help [COMMAND]
USAGE
  $ jg COMMAND
...

Commands

jg autocomplete [SHELL]

Display autocomplete installation instructions.

USAGE
  $ jg autocomplete [SHELL] [-r]

ARGUMENTS
  SHELL  (zsh|bash|powershell) Shell type

FLAGS
  -r, --refresh-cache  Refresh cache (ignores displaying instructions)

DESCRIPTION
  Display autocomplete installation instructions.

EXAMPLES
  $ jg autocomplete

  $ jg autocomplete bash

  $ jg autocomplete zsh

  $ jg autocomplete powershell

  $ jg autocomplete --refresh-cache

See code: @oclif/plugin-autocomplete

jg bname ISSUEKEY

Generates a Git branch name from a Jira Issue Key

USAGE
  $ jg bname ISSUEKEY [--json] [-h] [-q -c]

ARGUMENTS
  ISSUEKEY  Jira Issue Key

FLAGS
  -c, --clipboard  Copy to clipboard
  -h, --help       Show help
  -q, --quiet      Suppress output

GLOBAL FLAGS
  --json  Format output as json.

EXAMPLES
  $ jg bname

  $ jg bname --clipboard

  $ jg bname --clipboard --quiet

  $ jg bname --json

jg cc ISSUEKEY

Generates a Conventional Commit Message from a Jira Issue Key

USAGE
  $ jg cc ISSUEKEY [--json] [-h] [-q -c]

ARGUMENTS
  ISSUEKEY  Jira Issue Key

FLAGS
  -c, --clipboard  Copy to clipboard
  -h, --help       Show help
  -q, --quiet      Suppress output

GLOBAL FLAGS
  --json  Format output as json.

EXAMPLES
  $ jg cc

  $ jg cc --clipboard

  $ jg cc --clipboard --quiet

  $ jg cc --json

jg changed ISSUEKEY

Lists changed files for a given Jira Issue

USAGE
  $ jg changed ISSUEKEY [--json] [-h] [-q -c] [-a | -d]

ARGUMENTS
  ISSUEKEY  Jira Issue Key

FLAGS
  -a, --asc        Sorts file paths in ascending order
  -c, --clipboard  Copy to clipboard
  -d, --desc       Sorts file paths in descending order
  -h, --help       Show help
  -q, --quiet      Suppress output

GLOBAL FLAGS
  --json  Format output as json.

EXAMPLES
  $ jg changed

jg changesets ISSUEKEY

Returns URL(s) for changesets (PRs, MRs) related to a given issue

USAGE
  $ jg changesets ISSUEKEY [--json] [-h] [-q -c] [-f | -l] [-w]

ARGUMENTS
  ISSUEKEY  Jira Issue Key

FLAGS
  -c, --clipboard  Copy to clipboard
  -f, --first      Get the first (earliest) changeset request (PR, MR) for an issue
  -h, --help       Show help
  -l, --last       Get the last (latest) changeset request (PR, MR) for an issue
  -q, --quiet      Suppress output
  -w, --web        Opens related changeset requests (PRs, MRs) for an issue in default web browser

GLOBAL FLAGS
  --json  Format output as json.

ALIASES
  $ jg prs
  $ jg mrs

EXAMPLES
  $ jg changesets

  $ jg changesets --first

  $ jg changesets --last

  $ jg changesets --first --web

FLAG DESCRIPTIONS
  -f, --first  Get the first (earliest) changeset request (PR, MR) for an issue

    Fetches all changeset requests related to an issue, sorts them such that the earliest changeset request comes first,
    and returns the URL to that changeset request

  -l, --last  Get the last (latest) changeset request (PR, MR) for an issue

    Fetches all changeset requests related to an issue, sorts them such that the latest changeset request comes first,
    and returns the URL to that changeset request

jg help [COMMAND]

Display help for jg.

USAGE
  $ jg help [COMMAND...] [-n]

ARGUMENTS
  COMMAND...  Command to show help for.

FLAGS
  -n, --nested-commands  Include all nested commands in the output.

DESCRIPTION
  Display help for jg.

See code: @oclif/plugin-help

jg mrs ISSUEKEY

Returns URL(s) for changesets (PRs, MRs) related to a given issue

USAGE
  $ jg mrs ISSUEKEY [--json] [-h] [-q -c] [-f | -l] [-w]

ARGUMENTS
  ISSUEKEY  Jira Issue Key

FLAGS
  -c, --clipboard  Copy to clipboard
  -f, --first      Get the first (earliest) changeset request (PR, MR) for an issue
  -h, --help       Show help
  -l, --last       Get the last (latest) changeset request (PR, MR) for an issue
  -q, --quiet      Suppress output
  -w, --web        Opens related changeset requests (PRs, MRs) for an issue in default web browser

GLOBAL FLAGS
  --json  Format output as json.

ALIASES
  $ jg prs
  $ jg mrs

EXAMPLES
  $ jg mrs

  $ jg mrs --first

  $ jg mrs --last

  $ jg mrs --first --web

FLAG DESCRIPTIONS
  -f, --first  Get the first (earliest) changeset request (PR, MR) for an issue

    Fetches all changeset requests related to an issue, sorts them such that the earliest changeset request comes first,
    and returns the URL to that changeset request

  -l, --last  Get the last (latest) changeset request (PR, MR) for an issue

    Fetches all changeset requests related to an issue, sorts them such that the latest changeset request comes first,
    and returns the URL to that changeset request

jg notify ISSUEKEY

Generates a Slack Message with a Link to a Jira Issue and corresponding changeset request link to notify others of a changeset request

USAGE
  $ jg notify ISSUEKEY [--json] [-h] [-q -c] [-f | -l]

ARGUMENTS
  ISSUEKEY  Jira Issue Key

FLAGS
  -c, --clipboard  Copy to clipboard
  -f, --first      Get the first (earliest) changeset request (PR, MR) for an issue
  -h, --help       Show help
  -l, --last       Get the last (latest) changeset request (PR, MR) for an issue
  -q, --quiet      Suppress output

GLOBAL FLAGS
  --json  Format output as json.

EXAMPLES
  $ jg notify

  $ jg notify --clipboard

  $ jg notify --clipboard --quiet

  $ jg notify --json

FLAG DESCRIPTIONS
  -f, --first  Get the first (earliest) changeset request (PR, MR) for an issue

    Fetches all changeset requests related to an issue, sorts them such that the earliest changeset request comes first,
    and returns a reference to the first sorted changeset request

  -l, --last  Get the last (latest) changeset request (PR, MR) for an issue

    Fetches all changeset requests related to an issue, sorts them such that the latest changeset request comes first,
    and returns a reference to the first sorted changeset request

jg plugins

List installed plugins.

USAGE
  $ jg plugins [--json] [--core]

FLAGS
  --core  Show core plugins.

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  List installed plugins.

EXAMPLES
  $ jg plugins

See code: @oclif/plugin-plugins

jg plugins add PLUGIN

Installs a plugin into jg.

USAGE
  $ jg plugins add PLUGIN... [--json] [-f] [-h] [-s | -v]

ARGUMENTS
  PLUGIN...  Plugin to install.

FLAGS
  -f, --force    Force npm to fetch remote resources even if a local copy exists on disk.
  -h, --help     Show CLI help.
  -s, --silent   Silences npm output.
  -v, --verbose  Show verbose npm output.

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  Installs a plugin into jg.

  Uses npm to install plugins.

  Installation of a user-installed plugin will override a core plugin.

  Use the JG_NPM_LOG_LEVEL environment variable to set the npm loglevel.
  Use the JG_NPM_REGISTRY environment variable to set the npm registry.

ALIASES
  $ jg plugins add

EXAMPLES
  Install a plugin from npm registry.

    $ jg plugins add myplugin

  Install a plugin from a github url.

    $ jg plugins add https://github.com/someuser/someplugin

  Install a plugin from a github slug.

    $ jg plugins add someuser/someplugin

jg plugins:inspect PLUGIN...

Displays installation properties of a plugin.

USAGE
  $ jg plugins inspect PLUGIN...

ARGUMENTS
  PLUGIN...  [default: .] Plugin to inspect.

FLAGS
  -h, --help     Show CLI help.
  -v, --verbose

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  Displays installation properties of a plugin.

EXAMPLES
  $ jg plugins inspect myplugin

See code: @oclif/plugin-plugins

jg plugins install PLUGIN

Installs a plugin into jg.

USAGE
  $ jg plugins install PLUGIN... [--json] [-f] [-h] [-s | -v]

ARGUMENTS
  PLUGIN...  Plugin to install.

FLAGS
  -f, --force    Force npm to fetch remote resources even if a local copy exists on disk.
  -h, --help     Show CLI help.
  -s, --silent   Silences npm output.
  -v, --verbose  Show verbose npm output.

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  Installs a plugin into jg.

  Uses npm to install plugins.

  Installation of a user-installed plugin will override a core plugin.

  Use the JG_NPM_LOG_LEVEL environment variable to set the npm loglevel.
  Use the JG_NPM_REGISTRY environment variable to set the npm registry.

ALIASES
  $ jg plugins add

EXAMPLES
  Install a plugin from npm registry.

    $ jg plugins install myplugin

  Install a plugin from a github url.

    $ jg plugins install https://github.com/someuser/someplugin

  Install a plugin from a github slug.

    $ jg plugins install someuser/someplugin

See code: @oclif/plugin-plugins

jg plugins link PATH

Links a plugin into the CLI for development.

USAGE
  $ jg plugins link PATH [-h] [--install] [-v]

ARGUMENTS
  PATH  [default: .] path to plugin

FLAGS
  -h, --help          Show CLI help.
  -v, --verbose
      --[no-]install  Install dependencies after linking the plugin.

DESCRIPTION
  Links a plugin into the CLI for development.

  Installation of a linked plugin will override a user-installed or core plugin.

  e.g. If you have a user-installed or core plugin that has a 'hello' command, installing a linked plugin with a 'hello'
  command will override the user-installed or core plugin implementation. This is useful for development work.


EXAMPLES
  $ jg plugins link myplugin

See code: @oclif/plugin-plugins

jg plugins remove [PLUGIN]

Removes a plugin from the CLI.

USAGE
  $ jg plugins remove [PLUGIN...] [-h] [-v]

ARGUMENTS
  PLUGIN...  plugin to uninstall

FLAGS
  -h, --help     Show CLI help.
  -v, --verbose

DESCRIPTION
  Removes a plugin from the CLI.

ALIASES
  $ jg plugins unlink
  $ jg plugins remove

EXAMPLES
  $ jg plugins remove myplugin

jg plugins reset

Remove all user-installed and linked plugins.

USAGE
  $ jg plugins reset [--hard] [--reinstall]

FLAGS
  --hard       Delete node_modules and package manager related files in addition to uninstalling plugins.
  --reinstall  Reinstall all plugins after uninstalling.

See code: @oclif/plugin-plugins

jg plugins uninstall [PLUGIN]

Removes a plugin from the CLI.

USAGE
  $ jg plugins uninstall [PLUGIN...] [-h] [-v]

ARGUMENTS
  PLUGIN...  plugin to uninstall

FLAGS
  -h, --help     Show CLI help.
  -v, --verbose

DESCRIPTION
  Removes a plugin from the CLI.

ALIASES
  $ jg plugins unlink
  $ jg plugins remove

EXAMPLES
  $ jg plugins uninstall myplugin

See code: @oclif/plugin-plugins

jg plugins unlink [PLUGIN]

Removes a plugin from the CLI.

USAGE
  $ jg plugins unlink [PLUGIN...] [-h] [-v]

ARGUMENTS
  PLUGIN...  plugin to uninstall

FLAGS
  -h, --help     Show CLI help.
  -v, --verbose

DESCRIPTION
  Removes a plugin from the CLI.

ALIASES
  $ jg plugins unlink
  $ jg plugins remove

EXAMPLES
  $ jg plugins unlink myplugin

jg plugins update

Update installed plugins.

USAGE
  $ jg plugins update [-h] [-v]

FLAGS
  -h, --help     Show CLI help.
  -v, --verbose

DESCRIPTION
  Update installed plugins.

See code: @oclif/plugin-plugins

jg print-config

Prints merged result of user and default configurations

USAGE
  $ jg print-config [--json] [-h] [-q -c]

FLAGS
  -c, --clipboard  Copy to clipboard
  -h, --help       Show help
  -q, --quiet      Suppress output

GLOBAL FLAGS
  --json  Format output as json.

EXAMPLES
  $ jg print-config

  $ jg print-config --clipboard

  $ jg print-config --clipboard --quiet

  $ jg print-config --json

jg prs ISSUEKEY

Returns URL(s) for changesets (PRs, MRs) related to a given issue

USAGE
  $ jg prs ISSUEKEY [--json] [-h] [-q -c] [-f | -l] [-w]

ARGUMENTS
  ISSUEKEY  Jira Issue Key

FLAGS
  -c, --clipboard  Copy to clipboard
  -f, --first      Get the first (earliest) changeset request (PR, MR) for an issue
  -h, --help       Show help
  -l, --last       Get the last (latest) changeset request (PR, MR) for an issue
  -q, --quiet      Suppress output
  -w, --web        Opens related changeset requests (PRs, MRs) for an issue in default web browser

GLOBAL FLAGS
  --json  Format output as json.

ALIASES
  $ jg prs
  $ jg mrs

EXAMPLES
  $ jg prs

  $ jg prs --first

  $ jg prs --last

  $ jg prs --first --web

FLAG DESCRIPTIONS
  -f, --first  Get the first (earliest) changeset request (PR, MR) for an issue

    Fetches all changeset requests related to an issue, sorts them such that the earliest changeset request comes first,
    and returns the URL to that changeset request

  -l, --last  Get the last (latest) changeset request (PR, MR) for an issue

    Fetches all changeset requests related to an issue, sorts them such that the latest changeset request comes first,
    and returns the URL to that changeset request

jg url ISSUEKEY

Returns a URL to a Jira Issue

USAGE
  $ jg url ISSUEKEY [--json] [-h] [-q -c] [-m] [-w]

ARGUMENTS
  ISSUEKEY  Jira Issue Key

FLAGS
  -c, --clipboard  Copy to clipboard
  -h, --help       Show help
  -m, --markdown   Get Markdown Link to Jira Issue
  -q, --quiet      Suppress output
  -w, --web        Opens issue in default web browser

GLOBAL FLAGS
  --json  Format output as json.

EXAMPLES
  $ jg url

  $ jg url --clipboard

  $ jg url --clipboard --quiet

  $ jg url --json