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

harness-cli-plugin-example

v0.1.0

Published

Minimal example plugin for harness-cli — copy-paste template for plugin authors

Downloads

107

Readme

harness-cli-plugin-example

Minimal example plugin for harness-cli. Copy-paste this package as the starting point for your own plugin.

What this plugin does

Provides one command: harness-cli hello say — outputs "Hello from harness-cli-plugin-example!".

That's it. The plugin exists to demonstrate the full plugin authoring pattern in its simplest form.

Plugin authoring pattern

Required files

| File | Purpose | |------|---------| | package.json | "type": "commonjs", "main": "./dist/index.js", oclif.commands pointing to ./dist/commands, build: "tsc -p tsconfig.build.json && oclif manifest" | | tsconfig.build.json | Extends ../../tsconfig.base.json (or a root tsconfig). Sets outDir: ./dist, rootDir: ./src. | | src/index.ts | Exports a named register function — the entry point the harness-cli init hook calls. | | src/commands/**/*.ts | One file per command. Nested directories create nested topics (hello/say.tshello say). | | oclif.manifest.json | Auto-generated by oclif manifest. Must be included in published output ("files": ["dist", "oclif.manifest.json"]). |

How register() works

import type { PluginContract } from 'harness-cli'
import type { Config } from '@oclif/core'

export const register: PluginContract['register'] = function (_cli: Config): void {
  // Plugin-level setup goes here (optional).
  // Commands in src/commands/ are loaded automatically via the manifest.
}

The harness-cli init hook:

  1. Scans node_modules for harness-cli-plugin-* packages.
  2. Calls require(pluginRoot) to load the plugin.
  3. Checks that pluginModule.register is a function — if missing, the plugin is skipped with a warning.
  4. Loads commands from dist/commands/ via the oclif Plugin object.
  5. Calls register(config) for any plugin-level setup.

Your register() body can be empty if you have no plugin-level setup. Commands load regardless.

Commands

Commands extend Command from @oclif/core:

import { Command } from '@oclif/core'

export class Say extends Command {
  static description = 'My command description'

  async run(): Promise<void> {
    this.log('Hello!')
  }
}

Building

pnpm install        # or npm install — wire workspace symlinks first
pnpm run build      # tsc -p tsconfig.build.json && oclif manifest

Both steps are required. oclif manifest generates oclif.manifest.json which the init hook uses to load your commands. Missing manifest = harness-cli startup is catastrophically slow on the first run.

Publishing

npm publish

Consumers install with:

npm install harness-cli-plugin-yourname

After install, restart harness-cli — your commands appear automatically in harness-cli --help.

Package name convention

Plugin packages must follow the naming convention harness-cli-plugin-<slug> for auto-discovery. The harness-cli init hook filters node_modules for this prefix.