Skip to content

Drew-Daniels/jg

Repository files navigation

jgit

Utility functions for Jira and Git

oclif Version Downloads/week

Setup

GitHub API Auth

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

https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#about-personal-access-tokens

export GITHUB_OAUTH_TOKEN="YOUR_GITHUB_OAUTH_TOKEN"

Jira API Auth

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

export JIRA_HOSTNAME="https://jira.example.com"
export JIRA_API_TOKEN="YOUR_JIRA_API_TOKEN"
export JIRA_API_EMAIL="YOUR_JIRA_EMAIL"

Usage

$ npm install -g jgit
$ jg COMMAND
running command...
$ jg (--version)
jgit/0.0.10 darwin-arm64 node-v22.5.1
$ jg --help [COMMAND]
USAGE
  $ jg COMMAND
...

Commands

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.

DESCRIPTION
  Generates a Git branch name from a Jira Issue Key

EXAMPLES
  $ jg bname

  $ jg bname --clipboard

  $ jg bname --clipboard --quiet

  $ jg bname --json

See code: src/commands/bname/index.ts

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.

DESCRIPTION
  Generates a Conventional Commit Message from a Jira Issue Key

EXAMPLES
  $ jg cc

  $ jg cc --clipboard

  $ jg cc --clipboard --quiet

  $ jg cc --json

See code: src/commands/cc/index.ts

jg find [ISSUEKEY]

Finds the latest GH PR for a Jira ticket

USAGE
  $ jg find [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.

DESCRIPTION
  Finds the latest GH PR for a Jira ticket

EXAMPLES
  $ jg find

  $ jg find --clipboard

  $ jg find --clipboard --quiet

  $ jg find --json

See code: src/commands/find/index.ts

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 id

Returns Jira Issue ID from current Git branch

USAGE
  $ jg id [--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.

DESCRIPTION
  Returns Jira Issue ID from current Git branch

EXAMPLES
  $ jg id

  $ jg id --clipboard

  $ jg id --clipboard --quiet

  $ jg id --json

See code: src/commands/id/index.ts

jg key

Returns Jira Issue Key from current Git branch

USAGE
  $ jg key [--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.

DESCRIPTION
  Returns Jira Issue Key from current Git branch

EXAMPLES
  $ jg key

  $ jg key --clipboard

  $ jg key --clipboard --quiet

  $ jg key --json

See code: src/commands/key/index.ts

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 pr [ISSUEKEY]

Generates a Slack Message with a Link to a Jira Issue and corresponding GitHub link

USAGE
  $ jg pr [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.

DESCRIPTION
  Generates a Slack Message with a Link to a Jira Issue and corresponding GitHub link

EXAMPLES
  $ jg pr

  $ jg pr --clipboard

  $ jg pr --clipboard --quiet

  $ jg pr --json

See code: src/commands/pr/index.ts

jg related [ISSUEKEY]

Opens all related PRs for a given Jira Issue

USAGE
  $ jg related [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.

DESCRIPTION
  Opens all related PRs for a given Jira Issue

EXAMPLES
  $ jg related

See code: src/commands/related/index.ts

jg revisit [ISSUEKEY]

Opens all related PRs for a given Jira Issue

USAGE
  $ jg revisit [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.

DESCRIPTION
  Opens all related PRs for a given Jira Issue

EXAMPLES
  $ jg revisit

See code: src/commands/revisit/index.ts

jg url [ISSUEKEY]

Returns a URL to a Jira Issue

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

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

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  Returns a URL to a Jira Issue

EXAMPLES
  $ jg url

  $ jg url --clipboard

  $ jg url --clipboard --quiet

  $ jg url --json

See code: src/commands/url/index.ts

About

Utility functions for Jira and Git

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published