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

@heroku/heroku-cli-util

v10.2.0

Published

Set of helpful CLI utilities

Downloads

74,702

Maintainers

sconklinsconklinsrishtigautamsrishtigautamaklimaiteaklimaitejsullivandigsjsullivandigsjulianduque-sfdcjulianduque-sfdccwallsfcwallsfijanakijanakjeffrey.estradajeffrey.estradadlira-sfdlira-sfntonollierntonollierdaebumleedaebumleetetsuya_tetsuya_mttrmttrelearyelearysalesforce-releasessalesforce-releasesdboston528dboston528anujpandey001anujpandey001sripad.kulkarnisripad.kulkarnirafaydinrafaydinkbaird-sfkbaird-sfcbaxtersfcbaxtersfryoneyamaryoneyamaadirasanamadirasanammengxiao.zhaomengxiao.zhaonrisaronrisarocmarcojoscmarcojosadirksmeieradirksmeiermgates-salesforcemgates-salesforceademusoyoademusoyoelzoonaelzoonajondaniel-sfdcjondaniel-sfdcdhagberg-sfdhagberg-sfbencdentonbencdentonlsangalang2023lsangalang2023marcelsfdcmarcelsfdcccaseyccaseyjoeybrown90sfjoeybrown90sfsuppadasuppadadiana.doherty.sfdcdiana.doherty.sfdchritchhritchryanbrainardryanbrainardrsoerensenrsoerensenjasoncummings-herokujasoncummings-herokubrock-salesforcebrock-salesforcetkoh-sfdctkoh-sfdcgnettergnettercoreypurcell_salesforcecoreypurcell_salesforceswapnilghoseswapnilghosestessema-sfcstessema-sfcjmonrealjmonrealbrittany.jonesbrittany.jonesrstiltonsfrstiltonsfnilamuthunilamuthusghaffarsghaffarcdwort-sfdccdwort-sfdcagatpareekagatpareekaaronromeosfdcaaronromeosfdckpremkumarkpremkumarrchandarchanda7ftz7ftzxx-sfdc-npmxx-sfdc-npmcv88cv88ekozilforceekozilforceumarsfdcumarsfdcbeanieboibeanieboindavidson-sfndavidson-sfmingzhi-liu1258mingzhi-liu1258angelcampbellangelcampbellmandeepsfmandeepsfyann_ckyann_ckdasofieidasofieirajashri-gurusamyrajashri-gurusamysudarshanhiraysudarshanhirayalex_herokualex_herokusbosio_sfsbosio_sfsarahoh2468sarahoh2468justinwilaby-sfjustinwilaby-sfcmcclung-npm-salesforce.comcmcclung-npm-salesforce.comtlowrimoretlowrimoreptemporiniptemporinitcareysmith-sfdctcareysmith-sfdcrobinson.mrobinson.mdkabanov1dkabanov1cgfuhcgfuhrdagg-herordagg-herok80bowmank80bowmansheax0rsheax0rdpark.herokudpark.herokuafraidknotafraidknotdaniel.brightdaniel.brightjdowningjdowningabhinavkoulabhinavkouljoshwlewis-sfdcjoshwlewis-sfdcviniljainviniljaineblackeblackk.plentyk.plentyapadalaapadalajhili!16jhili!16lsorstokkelsorstokkercrossrcrosskdreyerorenkdreyerorendhammer25dhammer25tenharmsel_sftenharmsel_sfdougmcinnes-sfdcdougmcinnes-sfdchillzbot2000hillzbot2000chap-herokuchap-herokumichellejhlimmichellejhlimmbuschherokumbuschherokureidmixreidmixbeckychenbeckychensmrutisamantasmrutisamantaapoorvasrivapoorvasrivsfalansfalanp.shreyap.shreyasai_harshitha_neelasai_harshitha_neelanlanattanlanattadreichenbergdreichenbergvlazukavlazukamarsmarsheroku-front-endheroku-front-endrichatiwaririchatiwariwchrisjohnsonwchrisjohnsonthe7okathe7okasimonebonettisfitasimonebonettisfitalucaszhoulucaszhoupsalimpsalimtaylor.jonestaylor.jonesangelayoungangelayoungktsforcektsforcekerry-bennettkerry-bennettgkomminenigkomminenismukusmukuykatzykatzdgallegossfdcdgallegossfdcdzuelke-sfdcdzuelke-sfdcrishabh.wasonrishabh.wasonsarassassinsarassassinarajaarajav.anandv.anandlmckenzielmckenziejordaneekeyjordaneekeydaigo-herokudaigo-herokumimenmimenjwadsworthsfjwadsworthsfpfuentepfuentemontes_herokumontes_herokubleongbleongpaguilarpaguilarjoanneyeungjoanneyeungzli-sfzli-sfmarcusblankenshipmarcusblankenshipsruthichsruthichjesse.brown-sfjesse.brown-sftij005tij005tholschuh-salesforcetholschuh-salesforcekumardinesh2kumardinesh2tholmes-sfdctholmes-sfdcannajohnson-sfannajohnson-sfpalakjeetkaur12palakjeetkaur12sfjonnpmsfjonnpmvjohnevjohnejinjutha.hancockjinjutha.hancockmgauger_herokumgauger_herokutdhayanandatdhayanandaabernicchiaabernicchiaslizcoslizcoanna-crossanna-crosscromwellryan-sfcromwellryan-sfhyunwookleehyunwookleematthew.rossimatthew.rossitm-sftm-sfdhawleydhawleynkoziuknkoziukherokucodyherokucodydodom-sfdcdodom-sfdccsinghaus-sfdccsinghaus-sfdcjw-sfdcjw-sfdcjlopezdanjlopezdangsinghsfdcgsinghsfdcnrenkenrenkesalesforcegenesalesforcegenetanushree.guptatanushree.guptabsonntag-salesforcebsonntag-salesforcechetankd10chetankd10nicole.klusmannicole.klusmanlcalermolcalermoheroku-johnnyheroku-johnnychandlerprallsfchandlerprallsfecbulmanecbulmanemilyhuang-herokuemilyhuang-herokumichael.malavemichael.malaveerika.wallaceerika.wallacevalluri056valluri056hk-ankitkumarhk-ankitkumarkaruna123karuna123mjoherson-sfmjoherson-sfchristopher.josechristopher.joseskediyal-sfskediyal-sf

Keywords

Readme

@heroku/heroku-cli-util

A set of helpful CLI utilities for Heroku and oclif-based Node.js CLIs. This package provides convenient wrappers and helpers for user interaction, output formatting, and test utilities.

Features

  • User prompts and confirmations (yes/no, input)
  • Styled output (headers, JSON, objects, tables)
  • Wait indicators for async operations
  • Test helpers for CLI output and environment setup

Installation

npm install @heroku/heroku-cli-util

Usage

You can import the utilities you need from the main exports.

Output Utilities

import { hux } from '@heroku/heroku-cli-util';

// Styled header
hux.styledHeader('My CLI Header');

// Styled JSON
hux.styledJSON({ foo: 'bar' });

// Styled object
hux.styledObject({ foo: 'bar' });

// Table output
hux.table([
  {name: 'Alice', age: 30},
  {name: 'Bob', age: 25},
], {
  name: {header: 'Name'},
  age: {header: 'Age'},
});

// Wait indicator
const stop = hux.wait('Processing...');
// ...do async work...
stop();

User Interaction

import { hux } from '@heroku/heroku-cli-util';

const name = await hux.prompt('What is your name?');
const proceed = await hux.confirm('Continue?');

Test Helpers

import { testHelpers } from '@heroku/heroku-cli-util';

testHelpers.initCliTest();

testHelpers.setupStdoutStderr();
// ...run your CLI code...
const output = testHelpers.stdout();
const errorOutput = testHelpers.stderr();
testHelpers.restoreStdoutStderr();

testHelpers.expectOutput(output, 'expected output');

// Run a command (see docs for details)
// await testHelpers.runCommand(MyCommand, ['arg1', 'arg2']);

Types

Error Classes

import { utils } from '@heroku/heroku-cli-util';

// Error types
try {
  throw new utils.errors.AmbiguousError([{ name: 'foo' }, { name: 'bar' }], 'addon');
} catch (err) {
  if (err instanceof utils.errors.AmbiguousError) {
    console.error('Ambiguous:', err.message);
  }
}

try {
  throw new utils.errors.NotFound();
} catch (err) {
  if (err instanceof utils.errors.NotFound) {
    console.error('Not found:', err.message);
  }
}

PostgreSQL Types (TypeScript)

Import PG types using the pg namespace:

import type { pg } from '@heroku/heroku-cli-util';

// Use the types
const connection: pg.ConnectionDetails = {
  database: 'mydb',
  host: 'localhost',
  password: 'pass',
  pathname: '/mydb',
  port: '5432',
  url: 'postgres://...',
  user: 'admin'
};

function processDatabase(details: pg.ConnectionDetailsWithAttachment) {
  // ...
}

const addon: pg.AddOnWithRelatedData = { /* ... */ };
const link: pg.Link = { /* ... */ };
const tunnel: pg.TunnelConfig = { /* ... */ };

Alternatively, you can import types directly:

import type { 
  ConnectionDetails,
  AddOnWithRelatedData,
  ExtendedAddonAttachment,
  Link,
  TunnelConfig
} from '@heroku/heroku-cli-util';

Database and Utility Helpers

import { utils } from '@heroku/heroku-cli-util';

// Get Heroku Postgres database connection details (requires APIClient from @heroku-cli/command)
// const db = await utils.pg.databases(herokuApiClient, 'my-app', 'DATABASE_URL');

// Get Heroku Postgres host
const host = utils.pg.host();

// Run a query (requires a ConnectionDetails object)
// const result = await utils.pg.psql.exec(db, 'SELECT 1');

Development

  • Build: npm run build
  • Test: npm test
  • Lint: npm run lint