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

@portel/cli

v1.0.1

Published

CLI toolkit for building terminal applications - formatting, progress, fuzzy matching, logging

Readme

@portel/cli

CLI toolkit for building beautiful terminal applications. Provides formatting, progress indicators, fuzzy matching, and logging utilities.

Part of the Portel Ecosystem

┌─────────────────────────────────────────────────────────────────┐
│                     @portel/cli (this package)                  │
│            CLI utilities: formatting, progress, logging         │
└─────────────────────────────────────────────────────────────────┘
                              ▲
                              │
┌─────────────────────────────────────────────────────────────────┐
│                        @portel/mcp                              │
│              MCP protocol: client, transport, config            │
└─────────────────────────────────────────────────────────────────┘
                              ▲
                              │
┌─────────────────────────────────────────────────────────────────┐
│                     @portel/photon-core                         │
│         Core library: schema extraction, generators, UI         │
└─────────────────────────────────────────────────────────────────┘
                              ▲
                              │
        ┌─────────────────────┼─────────────────────┐
        │                     │                     │
┌───────┴───────┐    ┌───────┴───────┐    ┌───────┴───────┐
│ @portel/photon│    │    lumina     │    │ @portel/ncp   │
│  CLI + BEAM   │    │  REST runtime │    │ MCP orchestr. │
└───────────────┘    └───────────────┘    └───────────────┘

Use this package if: You're building CLI tools and need beautiful output formatting, spinners, or fuzzy matching.

Installation

npm install @portel/cli

Features

Output Formatting

Format data as tables, trees, lists, or cards with automatic detection.

import { formatOutput, renderTable, renderTree } from '@portel/cli';

// Auto-detect format based on data shape
formatOutput([{ name: 'Alice', age: 30 }, { name: 'Bob', age: 25 }]);

// Explicit formats
formatOutput(data, 'table');  // Bordered table
formatOutput(data, 'tree');   // Indented tree
formatOutput(data, 'list');   // Bullet list
formatOutput(data, 'json');   // Pretty JSON

Progress Indicators

Show spinners and progress bars for long-running operations.

import { startSpinner, stopProgress, showProgress } from '@portel/cli';

// Simple spinner
startSpinner('Loading...');
await doWork();
stopProgress();

// With progress updates
showProgress('Processing files', 0, 100);
for (let i = 0; i <= 100; i++) {
  await processFile(i);
  showProgress('Processing files', i, 100);
}
stopProgress();

Status Messages

Print colored status messages.

import { printSuccess, printError, printInfo, printWarning } from '@portel/cli';

printSuccess('Operation completed');  // ✓ green
printError('Something failed');       // ✗ red
printInfo('FYI...');                  // ℹ blue
printWarning('Be careful');           // ⚠ yellow

Fuzzy Matching

Find similar strings for "did you mean?" suggestions.

import { FuzzyMatcher, findBestMatch } from '@portel/cli';

const matcher = new FuzzyMatcher();
const suggestions = matcher.findSuggestions('helo', ['hello', 'help', 'world']);
// => ['hello', 'help']

// Or simple best match
const best = findBestMatch('get-usrs', ['get-users', 'get-posts', 'delete-user']);
// => 'get-users'

Text Utilities

Word wrapping, truncation, and formatting helpers.

import { TextUtils } from '@portel/cli';

TextUtils.wrap('Long text...', { width: 80 });
TextUtils.truncate('Very long string', 20);
TextUtils.padRight('Name', 10);

Logging

Structured logging with levels and formatting.

import { createLogger } from '@portel/cli';

const logger = createLogger({ level: 'debug' });
logger.debug('Detailed info');
logger.info('General info');
logger.warn('Warning');
logger.error('Error occurred');

API Reference

Formatting Functions

| Function | Description | |----------|-------------| | formatOutput(data, hint?) | Auto-format and print data | | detectFormat(data) | Detect best format for data | | renderTable(data) | Render bordered table | | renderTree(data) | Render indented tree | | renderList(items) | Render bullet list | | renderCard(data) | Render key-value card |

Progress Functions

| Function | Description | |----------|-------------| | startSpinner(message) | Start a spinner | | showProgress(label, current, total) | Show progress bar | | updateProgressMessage(message) | Update spinner text | | stopProgress() | Stop spinner/progress | | isProgressActive() | Check if progress is active |

Status Functions

| Function | Description | |----------|-------------| | printSuccess(message) | Print success (green ✓) | | printError(message) | Print error (red ✗) | | printInfo(message) | Print info (blue ℹ) | | printWarning(message) | Print warning (yellow ⚠) | | printHeader(text) | Print section header |

License

MIT