whatisgithub

What is oclif-base-index-command?

purplecabbage/oclif-base-index-command — explained in plain English

Analysis updated 2026-08-08 · repo last pushed 2019-03-06

JavaScriptAudience · developerComplexity · 2/5DormantSetup · easy

In one sentence

A drop-in base class for oclif CLIs that lets users type subcommands with spaces instead of colons, so you can modernize tooling without breaking existing user habits.

Mindmap

mindmap
  root((repo))
    What it does
      Supports space syntax
      Routes subcommands
      Drop-in base class
    Tech stack
      JavaScript
      oclif framework
      Node.js
    Use cases
      Migrate old CLIs
      Preserve user habits
      Avoid docs rewrites
    Audience
      CLI developers
      Migration teams
    Tradeoffs
      Loses colon convention
      Gains compatibility

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Migrate an existing CLI tool to oclif while keeping space-based subcommand syntax that users already know.

USE CASE 2

Preserve backward compatibility for scripts and tutorials that use space-style commands like 'my-cli app deploy'.

USE CASE 3

Modernize underlying CLI tooling without forcing users to learn new colon-based syntax.

What is it built with?

JavaScriptoclifNode.js

How does it compare?

purplecabbage/oclif-base-index-command00kaku/gallery-slider-block0verflowme/weirdhta
LanguageJavaScriptJavaScriptJavaScript
Last pushed2019-03-062021-05-192022-06-16
MaintenanceDormantDormantDormant
Setup difficultyeasyeasymoderate
Complexity2/52/52/5
Audiencedevelopergeneraldeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min

Drop the base class into your command folder's index.js and make your command inherit from it, requires an existing oclif project.

So what is it?

This project solves a small but annoying problem for people building command-line tools. If you're using a framework called oclif to build a CLI (command-line interface), subcommands are normally called with a colon, like my-cli foo:bar. But if you're porting an older tool that already trained users to type my-cli foo bar with a space instead, that colon syntax creates friction. This package lets you support the space-style syntax so existing users don't have to change their habits. At a technical level, the package provides a base class, essentially a template, that you drop into the index.js file of your command folder. Instead of writing your own logic to handle what happens when someone runs the command, you let this base class handle the routing. It intercepts the command, figures out which subcommand the user meant, and sends them there. You just make your command inherit from it and write a description, the superclass does the rest. The people who'd use this are developers migrating existing command-line tools to oclif without breaking the muscle memory of their current users. For example, if a team has a CLI where people have been typing my-cli app deploy for years, switching to my-cli app:deploy would frustrate users and require updating documentation, scripts, and tutorials. This package lets the team modernize their underlying tooling while keeping the command syntax identical. The README doesn't go into detail about edge cases, limitations, or performance considerations, it's a fairly focused, single-purpose utility. The core tradeoff is straightforward: you give up oclif's default colon-based convention in exchange for compatibility with a space-based convention that your users already expect.

Copy-paste prompts

Prompt 1
I'm building a CLI with oclif and need my subcommands to use spaces like 'my-cli foo bar' instead of 'my-cli foo:bar'. How do I use oclif-base-index-command to route space-style commands?
Prompt 2
I'm migrating an old CLI to oclif but my users have been typing 'my-cli app deploy' for years. How can I keep that syntax working with oclif-base-index-command?
Prompt 3
Help me set up a base index.js command class in oclif that inherits from oclif-base-index-command so subcommands are invoked with spaces instead of colons.

Frequently asked questions

What is oclif-base-index-command?

A drop-in base class for oclif CLIs that lets users type subcommands with spaces instead of colons, so you can modernize tooling without breaking existing user habits.

What language is oclif-base-index-command written in?

Mainly JavaScript. The stack also includes JavaScript, oclif, Node.js.

Is oclif-base-index-command actively maintained?

Dormant — no commits in 2+ years (last push 2019-03-06).

How hard is oclif-base-index-command to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is oclif-base-index-command for?

Mainly developer.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.