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 🙏

© 2025 – Pkg Stats / Ryan Hefner

team-cli

v1.0.5

Published

Automate all the things with a team-centric CLI.

Readme

team-cli

npm version

Automate all the things with a team-centric CLI. Abstract away annoying day-to-day tasks and eliminate tribal team knowledge by building your team their very own CLI.

Getting Started

Initialize Project

mkdir teamname-cli
cd teamname-cli
git init
npm init
npm install --save team-cli

Create Bin index.js

Then in an index.js you could write the following:

#!/usr/bin/env node

const { resolve } = require('path');
const cli = require('team-cli');

const commandsDir = resolve(__dirname, 'commands');
cli(commandsDir);

Point to Bin index.js in Package

Then customize your package.json to include a path to the bin:

"bin": {
  "NAME_OF_TOOL": "./index.js"
}

Create Commands

Then you may make a commands directory with files like command-foo.js:

const run = require('team-cli/terminal');
const { resolve } = require('path');

const script = resolve(__dirname, 'foo.sh'); // also supports bash .ps1 scripts

const action = async param => {
  await run(script, param)
  // Or, run any Node code you wish
};

module.exports = {
  title: 'foo <param>',
  description: 'Calls foo',
  action,
}

Try it out!

node ./index.js --help

Options

Any command can export the following options:

{
  title: 'foo', // or 'foo <required_param>' or 'foo [optional_param]'
  action: (param) => {} // function with param as a string or undefined
  description: 'Calls foo', // optional
  alias: 'f', // optional
  option: ['-f, --force', 'Forces something to happen'], // optional, this will become available globally not just per-command
}

For Your Users

At any time a --help or -h may be passed to log commands to the console.

Prompts

Optionally, you may find it useful to walk users through a guided CLI experience with prompts to your users. I suggest prompts for this task, but any tool of your choice will work within an action.

Example usage with prompts:

const action = async (cmd) => {
  if (!cmd) {
    let { value: cmdResponse } = await prompts({
        type: 'text',
        name: 'value',
        message: 'Which git command would you like to run?',
    });
    cmd = cmdResponse
  }
  await run(`git ${cmd}`, '~/aCoolRepo');
};

Logging

The environment's log level can be changed with process.env.LOG_LEVEL to any of winston's supported log levels including verbose.

To customize where logs are saved, pass a second param in your index.js's cli call like so:

cli(commandsDir, logsDir)