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

jiraf

v0.2.4

Published

Command-line helper for Jira-GitHub workflow

Downloads

1

Readme

jiraf

jiraf is a command-line helper for a workflow based in Atlassian Jira and GitHub.
jiraf on npmjs code style: prettier CircleCI Greenkeeper badge dependencies Status

Note: jiraf is in beta. Please report any issues.

Setup

Install

npm install -g jiraf

Authorize

Create an Atlassian API token: navigate to https://id.atlassian.com/ and take note of your username, click API tokens and create a new token for yourself. Then export them:

export [email protected]
export ATLASSIAN_API_TOKEN=your_atlassian_token

If you also want to create pull requests, you need GitHub credentials as well: navigate to https://github.com/settings/tokens and generate a new token - repo access is enough, but you'll also need to enable SSO for it to be able to access your organization.

export [email protected]
export GITHUB_API_TOKEN=your_github_token

Put these exports into your bash_profile so that they persist between terminal sessions.

Configure

Edit ~/.jiraf/config.json to add your Jira URL base, editor, and possibly customize your shortcuts.
(Make sure that your editor waits for closing files before returning, eg. vim, subl -w, atom -w etc. Hint: check git config core.editor.)

You will probably want to include some information about the current card in your shell prompt like people do with their git branches. To do that, just cat the contents of the ~/.jiraf/status file, eg. with a function like this one:

function jiraf_card() {
    [ -f ~/.jiraf/status ] && cat ~/.jiraf/status
}

The format of this status is configurable by modifying the statusTemplate value of the ~/.jiraf/config.json file. See the details command for the format.

Usage

Base commands

Picking a card

jiraf setproject <project_key>
Specify the project by its key so that you can list cards on the board. You can also pass a rapidView number.

jiraf unsetproject
Unset the project.

jiraf ls [-s|--status <status>] [-a|--assignee [<username>]]
List the cards on the board in the current sprint (key, status, summary, assignee).
You can filter for status (lowercase, one word, like: "todo" or "inprogress") or assignee (pass the Jira username). If you don't pass any username, the default is yourself; to filter for unassigned cards, pass "unassigned".

jiraf set <card>
Set <card> as the active card. (The card has to be on the currently set board. If you want to pick a card from a different board, you need to call setproject first.)

jiraf details [<template>]
Print the details of the active card. The format is specified in your config file (see the detailsTemplate value), but you can also override it when calling the command. You can use the values summary, status, assignee, description, priority, and estimate passed to the template in double curly braces. If you don't pass anything and also have no template configured, the default template is used, which is {{key}} [{{status}}] {{summary}} ({{assignee}}).

jiraf refresh
Reload the current card (eg. if you've updated it on the web UI).

jiraf unset
Unset the currently active card.

Updating a card

jiraf move <status>
Update the active card to <status> (one of: blocked, todo, inprogress, review, validation, done).

jiraf assign [<username>]
Assign the active card to <username>, default is assigning to yourself.

jiraf unassign
Remove assignee from the card.

git and GitHub

jiraf branch <branchname>
Performs git checkout -b {active-cards-key}-<branchname>.

jiraf pr
Opens a text editor for you to specify the PR title and contents, based on a template and pre-filled with card details. The first line is the title, the rest is the description. Upon closing the file, it opens a PR. Note: this command only works properly if you have configured an editor that is blocking until the edited file is closed.

jiraf web [<target>]
Opens Jira views in the browser, target is one of: board (default), card, backlog.
Note: if you call jiraf without arguments, jiraf web (and consequently jiraf web board) is executed.

Compound commands (shortcuts)

The following shortcuts are defined for a smoother workflow:
start <card> == set <card> + assign + move inprogress
review == move review + pr
qa == move validation + assign YOUR_QA_PERSON You could get through the entire workflow of choosing, picking up, and delivering a card with only these three.

You can specify more shortcuts in your ~/.jiraf/config.json file.

Contributing

Run tests locally by calling npm test [pattern]. The tests will run in a docker container.
You can also call npm run debug which runs the docker container with the code mounted and the mock services for JIRA and GitHub running.

Have fun!

Photo by Rajiv Bajaj on Unsplash