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.4.0

Published

Set of helpful CLI utilities

Maintainers

srishtigautamsrishtigautamaklimaiteaklimaitejsullivandigsjsullivandigsjulianduque-sfdcjulianduque-sfdccwallsfcwallsfijanakijanakjeffrey.estradajeffrey.estradadlira-sfdlira-sfntonollierntonollierdaebumleedaebumleetetsuya_tetsuya_mttrmttrelearyelearysalesforce-releasessalesforce-releasesanujpandey001anujpandey001sripad.kulkarnisripad.kulkarnikbaird-sfkbaird-sfcbaxtersfcbaxtersfryoneyamaryoneyamaadirasanamadirasanamnrisaronrisarocmarcojoscmarcojosmgates-salesforcemgates-salesforceademusoyoademusoyoelzoonaelzoonajondaniel-sfdcjondaniel-sfdcdhagberg-sfdhagberg-sfbencdentonbencdentonmarcelsfdcmarcelsfdcccaseyccaseyjoeybrown90sfjoeybrown90sfsuppadasuppadadiana.doherty.sfdcdiana.doherty.sfdchritchhritchryanbrainardryanbrainardrsoerensenrsoerensenjasoncummings-herokujasoncummings-herokubrock-salesforcebrock-salesforcetkoh-sfdctkoh-sfdcgnettergnettercoreypurcell_salesforcecoreypurcell_salesforceswapnilghoseswapnilghosestessema-sfcstessema-sfcjmonrealjmonrealbrittany.jonesbrittany.jonesrstiltonsfrstiltonsfnilamuthunilamuthusghaffarsghaffarcdwort-sfdccdwort-sfdcagatpareekagatpareekaaronromeosfdcaaronromeosfdckpremkumarkpremkumarrchandarchandaxx-sfdc-npmxx-sfdc-npmcv88cv88ekozilforceekozilforceumarsfdcumarsfdcbeanieboibeanieboindavidson-sfndavidson-sfmingzhi-liu1258mingzhi-liu1258angelcampbellangelcampbellmandeepsfmandeepsfyann_ckyann_ckdasofieidasofieisudarshanhiraysudarshanhirayalex_herokualex_herokusbosio_sfsbosio_sfsarahoh2468sarahoh2468tlowrimoretlowrimoreptemporiniptemporinitcareysmith-sfdctcareysmith-sfdcrobinson.mrobinson.mdkabanov1dkabanov1rdagg-herordagg-herok80bowmank80bowmansheax0rsheax0rdpark.herokudpark.herokudaniel.brightdaniel.brightjdowningjdowningabhinavkoulabhinavkouljoshwlewis-sfdcjoshwlewis-sfdcviniljainviniljaineblackeblackk.plentyk.plentyapadalaapadalalsorstokkelsorstokkercrossrcrosskdreyerorenkdreyerorendhammer25dhammer25tenharmsel_sftenharmsel_sfdougmcinnes-sfdcdougmcinnes-sfdcchap-herokuchap-herokumichellejhlimmichellejhlimmbuschherokumbuschherokubeckychenbeckychensmrutisamantasmrutisamantaapoorvasrivapoorvasrivp.shreyap.shreyasai_harshitha_neelasai_harshitha_neelanlanattanlanattadreichenbergdreichenbergvlazukavlazukamarsmarsheroku-front-endheroku-front-endrichatiwaririchatiwariwchrisjohnsonwchrisjohnsonthe7okathe7okasimonebonettisfitasimonebonettisfitalucaszhoulucaszhoupsalimpsalimtaylor.jonestaylor.jonesangelayoungangelayoungktsforcektsforcekerry-bennettkerry-bennettgkomminenigkomminenismukusmukudgallegossfdcdgallegossfdcdzuelke-sfdcdzuelke-sfdcrishabh.wasonrishabh.wasonsarassassinsarassassinarajaarajav.anandv.anandlmckenzielmckenziejordaneekeyjordaneekeydaigo-herokudaigo-herokumimenmimenjwadsworthsfjwadsworthsfpfuentepfuentebleongbleongpaguilarpaguilarzli-sfzli-sfsruthichsruthichjesse.brown-sfjesse.brown-sftij005tij005tholschuh-salesforcetholschuh-salesforcekumardinesh2kumardinesh2tholmes-sfdctholmes-sfdcpalakjeetkaur12palakjeetkaur12sfjonnpmsfjonnpmvjohnevjohnejinjutha.hancockjinjutha.hancockmgauger_herokumgauger_herokutdhayanandatdhayanandakharlowsfkharlowsfjhili!16jhili!16slizcoslizcoyasuhiro-herokuyasuhiro-herokuanna-crossanna-crosscromwellryan-sfcromwellryan-sfhyunwookleehyunwookleematthew.rossimatthew.rossitm-sftm-sfnkoziuknkoziukherokucodyherokucodydodom-sfdcdodom-sfdccsinghaus-sfdccsinghaus-sfdcjw-sfdcjw-sfdcjlopezdanjlopezdangsinghsfdcgsinghsfdcnrenkenrenkesalesforcegenesalesforcegenebsonntag-salesforcebsonntag-salesforcechetankd10chetankd10heroku-johnnyheroku-johnnyemilyhuang-herokuemilyhuang-herokumichael.malavemichael.malaveerika.wallaceerika.wallacevalluri056valluri056hk-ankitkumarhk-ankitkumarkaruna123karuna123mjoherson-sfmjoherson-sfskediyal-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 color styling.

Features

  • User prompts and confirmations (yes/no, input)
  • Styled output (headers, JSON, objects, tables)
  • Wait indicators for async operations
  • Colors for consistent, semantic CLI styling

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?');

Colors

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

// App-related colors
console.log(color.app('my-awesome-app'));        // Purple, bold with app icon
console.log(color.pipeline('staging'));          // Purple
console.log(color.space('production'));         // Blue, bold with space icon
console.log(color.addon('heroku-postgresql'));   // Yellow, bold
console.log(color.datastore('postgresql-123'));  // Yellow, bold with datastore icon

// Status colors
console.log(color.success('Deploy complete'));   // Green
console.log(color.failure('Build failed'));      // Red
console.log(color.warning('Deprecated feature')); // Orange

// User/Team colors
console.log(color.team('my-team'));              // Light cyan
console.log(color.user('[email protected]'));     // Cyan

// General purpose
console.log(color.label('Name'));                // Bold
console.log(color.info('Help text'));            // Teal
console.log(color.command('heroku apps:list'));  // Command with prompt styling

See the COLORS.md documentation for the complete color palette and usage guide.

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