# DebugReplFn

**Kind:** Class

**Source:** [`packages/core/repl/native-functions/debug-repl-fn.ts`](https://github.com/nestjs/nest/blob/master/packages/core/repl/native-functions/debug-repl-fn.ts#L7)

**Part of:** [Core](subsystem-packages-core)

`DebugReplFn` is a native REPL function that provides a debug-oriented command within the core REPL environment. Its `action()` method performs the command's behavior when the function is invoked by the REPL command dispatcher.

**Extends:** `ReplFunction`

## Methods

| Method | Signature | Returns |
|---|---|---|
| `action` | `action(moduleCls: Type<unknown> | string)` | `void` |

## Properties

| Property | Type |
|---|---|
| `fnDefinition` | `ReplFnDefinition` |

## Where it refuses work

- `DebugReplFn` stops the work with an early return when `!moduleEntry`.
- `DebugReplFn` stops the work with an early return when `collectionEntries.length <= 0`.

## Diagram

```mermaid
graph LR
  User[REPL user] --> Parser[REPL command parser]
  Parser --> Dispatcher[Native function dispatcher]
  Dispatcher --> DebugReplFn[DebugReplFn]
  DebugReplFn --> Action[action(): void]
  Action --> DebugOutput[Debug behavior/output]
```

## Usage

```ts
import { DebugReplFn } from './native-functions/debug-repl-fn';

// Typically invoked by the REPL's native-function dispatcher.
const debugCommand = new DebugReplFn();

debugCommand.action();
```

## AI Coding Instructions

- Keep `action()` focused on the behavior of the debug REPL command; avoid placing command parsing logic in this class.
- Integrate `DebugReplFn` through the existing native-function registration and dispatch flow rather than calling it directly from unrelated application code.
- Preserve the `void` return contract of `action()` and route observable results through the REPL's established output or logging mechanisms.
- Treat this function as a developer-facing REPL capability; avoid exposing sensitive runtime state unless the surrounding debug conventions explicitly allow it.
