# MethodsReplFn

**Kind:** Class

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

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

`MethodsReplFn` is a native REPL function responsible for handling the `methods` command/action within the core REPL environment. Its `action()` method performs the command’s behavior, allowing the REPL to expose method-related information through the native-function system.

**Extends:** `ReplFunction`

## Methods

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

## Properties

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

## Diagram

```mermaid
graph LR
  User[REPL User] --> Command[methods command]
  Command --> MethodsReplFn[MethodsReplFn]
  MethodsReplFn --> Action[action()]
  Action --> Output[REPL Output]
```

## Usage

```ts
import { MethodsReplFn } from './packages/core/repl/native-functions/methods-repl-fn';

const methodsCommand = new MethodsReplFn();

// Execute the native REPL command behavior.
methodsCommand.action();
```

## AI Coding Instructions

- Keep command-specific behavior inside `action()` so it remains compatible with the REPL native-function dispatch flow.
- Follow the conventions used by other classes in `packages/core/repl/native-functions/` when adding output, validation, or context access.
- Avoid placing interactive input parsing in this class unless other native functions use the same pattern; parsing is typically handled by the REPL command layer.
- When changing displayed method information, ensure the output remains useful for interactive REPL users and consistent with related help or introspection commands.
