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
| Method | Signature | Returns |
|---|---|---|
action | action() | void |
Properties
| Property | Type |
|---|---|
fnDefinition | ReplFnDefinition |
buildHelpMessage | any |
Diagram
mermaidgraph LR U[REPL User] --> C[help command] C --> H[HelpReplFn] H --> A[action()] A --> O[Help text written to REPL output]
Usage
tsimport { 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
HelpReplFnthrough 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?