Skip to content

HelpReplFn

reference
1 min readUpdated

Kind: Class

Source: packages/core/repl/native-functions/help-repl-fn.ts

Part of: Core

HelpReplFn implements the native help command for the core REPL. Its action() method displays available REPL commands or usage guidance, helping users discover supported interactive functionality.

Extends: ReplFunction

Methods

MethodSignatureReturns
actionaction()void

Properties

PropertyType
fnDefinitionReplFnDefinition
buildHelpMessageany

Diagram

mermaid
graph LR
  U[REPL User] --> C[help command]
  C --> H[HelpReplFn]
  H --> A[action()]
  A --> O[Help text written to REPL output]

Usage

ts
import { HelpReplFn } from "@core/repl/native-functions/help-repl-fn";

// Construct the command with the same REPL dependencies used by the command registry.
const helpCommand = new HelpReplFn(/* REPL context or output dependencies */);

// Execute the native help command.
helpCommand.action();

AI Coding Instructions

  • Keep action() focused on presenting help content; avoid adding command-execution logic to this class.
  • Register HelpReplFn through the REPL native-function or command registry so users can invoke it interactively.
  • Keep displayed command names and descriptions synchronized with the commands actually available in the REPL.
  • Preserve the REPL’s existing output mechanism and formatting conventions when changing help text.

Was this page helpful?

Download as PDF
HelpReplFn — NestJS head-to-head