@oclif/plugin-help

The standard help command plugin for oclif CLIs

Library
npm
v7.0.6
24 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
71 /100 Good
Development Activity 88
Maintenance 96
Community 28
Maturity 60
Momentum 12

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
68 /100 Good
Architecture 65
Code Quality 72
Innovation 45
Learning Curve 90

@oclif/plugin-help drops a fully-featured help command into any CLI built on the oclif framework, rendering usage, flags, arguments, and nested command listings without the CLI author having to write formatting code themselves. It is maintained by Salesforce as one of oclif’s official plugins and is installed by nearly every oclif-based CLI, since oclif’s own generator scaffolds new projects with it pre-wired in.

The plugin itself is intentionally thin: it registers a single help command that delegates to @oclif/core’s Help class for the actual formatting logic, and supports showing help for the whole CLI or for a specific command, including a --nested-commands flag to expand deeply nested command trees.

What You Get

  • A ready-to-use help command registered automatically when the plugin is added to an oclif CLI’s dependencies
  • Support for showing top-level CLI help or help scoped to a specific command and its arguments/flags
  • A --nested-commands/-n flag to expand and display all nested subcommands in the output
  • Consistent formatting that matches oclif’s conventions (USAGE, ARGUMENTS, FLAGS, DESCRIPTION sections)
  • Zero-configuration integration — installing the plugin and adding it to the oclif config’s plugin list is the entire setup

Common Use Cases

  • Giving a new oclif-based CLI tool standard --help/help behavior without writing any formatting code
  • Providing command-specific help output (mycli help deploy) for CLIs with many subcommands
  • Displaying a full nested command tree for CLIs organized into topics and subtopics via --nested-commands

Under The Hood

Architecture: The plugin is deliberately minimal — src/index.ts exports a commands map with a single help entry, and src/commands/help.ts (22 lines) defines an oclif Command subclass that parses its command argument and --nested-commands flag, then calls loadHelpClass(this.config) from @oclif/core to obtain the actual Help renderer and invoke showHelp(). All formatting logic — column layout, ANSI coloring, topic/command tree traversal — lives upstream in @oclif/core, not in this package.

Tech Stack: TypeScript, built with tsc, with its only runtime dependency being @oclif/core (peer-aligned to the CLI’s own oclif version). Testing uses Mocha with chai and @oclif/test for command-output assertions. The oclif CLI itself is used at build time to generate the oclif.manifest.json and README command reference.

Code Quality: With only ~30 lines of source across two files, the plugin’s own code quality surface is small; the single test file (test/commands/help.test.ts) exercises the command’s argument/flag parsing and delegates the harder assertions to snapshot-style output checks. Linting uses eslint-config-oclif plus Prettier, matching the conventions shared across the whole oclif plugin family. Commit history shows very active, consistent maintenance (health score flags active development and consistent updates) driven largely by Salesforce’s oclif team and automated dependency bots.

API Design: There is effectively no API for consumers to learn — installing the package and listing it under an oclif CLI’s plugins array is the entire integration. The one user-facing surface is the help command’s CLI flags (--nested-commands), which follows the same flag conventions as every other oclif command, keeping the learning curve at zero for anyone already using oclif.

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers