AbstractProtecteddebugProtectedHostStaticaliasesAn array of aliases for this command.
StaticargsAn order-dependent object of arguments for the command
StaticbaseInherited by every subclass through oclif's static baseFlags mechanism.
Static OptionaldeprecateEmit deprecation warning when a command alias is used
Static OptionaldeprecationStaticdescriptionA full description of how to use the command.
If no summary, the first line of the description will be used as the summary.
StaticenableStaticexamplesAn array of examples to show at the end of the command's help.
IF only a string is provided, it will try to look for a line that starts with the cmd.bin as the example command and the rest as the description. If found, the command will be formatted appropriately.
EXAMPLES:
A description of a particular use case.
$ <%= config.bin => command flags
StaticflagsA hash of flags for the command
StatichasStatichelpStatichiddenHide the command from help
StatichiddenAn array of aliases for this command that are hidden from help.
StaticidA command ID, used mostly in error or verbose reporting.
StaticpluginStatic Optional ReadonlypluginStatic Optional ReadonlypluginStatic Optional ReadonlypluginStatic OptionalstateMark the command as a given state (e.g. beta or deprecated) in help
StaticstrictWhen set to false, allows a variable amount of arguments
Static OptionalsummaryThe tweet-sized description for your class, used in a parent-commands sub-command listing and as the header for the command help.
StaticusageAn override string (or strings) for the default usage documentation.
StaticUsageEvery plugin declares its own usage + runtime metadata. The CLI root reads
this off the registered classes to assemble the progressive-disclosure
mj usage / mj <domain> usage surface and the timeout advisory.
Subclasses MUST override.
Protected_ProtectedcatchProtectedCleanupOptional post-Emit hook. Override to release resources (DB pools, singletons)
and, when necessary, process.exit() to terminate lingering background work.
Optionaloptions: { code?: string; exit?: number } & PrettyPrintableErrorProtected AbstractExecuteSubclasses implement this — pure logic, no direct stdio.
Optionalcode: numberProtectedfinallyProtectedGetThe flags parsed for this command. Subclasses call this in Execute instead of re-parsing — the parse happens once, in run.
The as unknown as T is the ONE place the cross-package @oclif/core copy
split is bridged: cli-core nests its own oclif, so the inferred parse type
isn't nameable from a strict consumer package (TS2742). Confining the cast
here keeps every plugin's Execute() cast-free. Pass
Interfaces.InferredFlags<typeof YourPlugin.flags> as T.
ProtectedinitDetermine if the command is being run with the --json flag in a command that supports it.
true if the command supports json and the --json flag is present
Optionalmessage: stringProtectedlogOptionalmessage: stringProtectedparseoclif entry point — do NOT override in subclasses. Override Execute.
ProtectedtoProtectedtoProtectedwarnProtectedwarnStaticrun
Abstract base for every pluggable
mjcommand (plan D1/D2).Extends oclif's Command, so oclif still owns flag parsing, help generation, and routing. We wrap only the execution layer: subclasses implement BaseCLIPlugin.Execute (pure logic, returns data) and the shared BaseCLIPlugin.run wires up the IMJCLIRuntimeHost, emits the runtime advisory, renders the result per
--format, and sets the exit code.The global flags
--format,--verbose, and--no-bannerare declared on BaseCLIPlugin.baseFlags and inherited by every subclass via oclif's nativebaseFlagsmerging — no per-command duplication (plan D3).