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 🙏

© 2024 – Pkg Stats / Ryan Hefner

jirash

v2.11.0

Published

a JIRA CLI

Downloads

36

Readme

A limited JIRA CLI. Get an issue. Create an issue. Update project versions. Etc.

Install

npm install -g jirash
jirash --version

This supports Bash completion. Install it something like this:

# Mac
jirash completion > /usr/local/etc/bash_completion.d/jirash \
    && source /usr/local/etc/bash_completion.d/jirash

# Linux
sudo jirash completion > /etc/bash_completion.d/jirash \
    && source /etc/bash_completion.d/jirash

Config

First you need a config file with Jira URL and auth info:

$ cat ~/.jirash.json
{
    "jira_url": "https://jira.example.com",
    "jira_username": "joe.blow",
    "jira_password": "secret"
}

Usage

List available commands:

$ jirash help
Usage:
    jirash COMMAND [ARGS...]
    jirash help [COMMAND]
...
Commands:
...
    issue       Search, get, and create JIRA issues.
...

Some examples follow. Get info on an issue:

$ jirash issue get IMGAPI-654
IMGAPI-654 IMGAPI ExportImage when basename(MANTA_PATH) doesn't exist is (a) wrong and (b) unhelpful (trent.mick -> <unassigned>, Bug, 4 - Normal, Open)

A shortcut for that:

$ jirash IMGAPI-654

A full JSON dump of REST API data for the issue:

$ jirash issue get -j IMGAPI-654
{
    "id": "64401",
    "self": "https://jira.joyent.us/rest/api/2/issue/64401",
    "key": "IMGAPI-654",
    "fields": {
...

List your favourite filters (saved issue searches):

$ jirash filter ls
ID     NAME                                       OWNER.NAME
10644  ADMINUI: open issues                       trent.mick
10580  AGENT: open issues                         trent.mick
10577  All issues                                 trent.mick
...

List issues in a filter:

$ jirash issue ls AGENT
KEY         SUMMARYCLIPPED                            ASSIGNEE     REPORTER    P  STAT  CREATED     UPDATED
AGENT-1083  Want auto.DATACENTER_NAME in config-age�  cody.mello   cody.mello  4  Open  2017-09-26  2017-09-26
AGENT-1081  config-agent could use one-shot mode fo�  dap          dap         3  Open  2017-08-01  2017-08-01
AGENT-1080  hagfish-watcher should use sdcnode        josh.clulow  trent.mick  4  Open  2017-07-14  2017-07-14
...

Edit an issue:

This is less user-friendly than other commands, but allows you more control
over editing issues. For more information on JSON accepted, see the Jira API
docs:
https://docs.atlassian.com/software/jira/docs/api/REST/7.4.2/#api/2/issue-editIssue

$ jirash issue edit TRITON-1140 '{"labels": [{"add": "lullaby-phase2"}]}'

Configuration Reference

Configuration is via a JSON file at "~/.jirash.json". Example:

{
    "jira_url": "https://dev.example.com/jira",
    "jira_username": "joe.blow",
    "jira_password": "secret"
}

The possible config vars are:

  • jira_url The base Jira URL. This or jirash -J <jira-url> ... is required.
  • jira_username Required. The Jira username with which to auth.
  • jira_password Required. The password for the given Jira username.

Module Usage

There is a lib/jirashapi.js that is a reasonable REST API wrapper, albeit with coverage of very little of the JIRA REST API.

var JirashApi = require('jirash').JirashApi;

var config = require('/Users/trentm/.jirash.json');
var api = new JirashApi({config: config});

api.getIssue('IMGAPI-654', function (err, issue) {
    if (err) {
        // Handle `err`.
    }
    console.log(issue);
        // { id: '64401',
        //  self: 'https://jira.joyent.us/rest/api/2/issue/64401',
        //  key: 'IMGAPI-654',
        //  fields:
        //  ...
});

Development

There is automated code formatting (using eslint --fix and prettier):

make fmt

There is lint/style checking (using eslint and prettier --list-different):

make check

Please be sure to run all of the above prior to submitting changes. One easy way to remember that is to run the following once for a clone to run them automatically prior to git commit:

make git-hooks

Sadly, there is not yet a test suite (no make test).

License

MIT. See the LICENSE.txt file.