# SlashCommandController

> **Class** in `deepagents_code`

📖 [View in docs](https://reference.langchain.com/python/deepagents-code/widgets/autocomplete/SlashCommandController)

Controller for / slash command completion.

## Signature

```python
SlashCommandController(
    self,
    commands: list[CommandEntry],
    view: CompletionView,
)
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `commands` | `list[CommandEntry]` | Yes | List of `CommandEntry` instances. |
| `view` | `CompletionView` | Yes | View to render suggestions to. |

## Constructors

```python
__init__(
    self,
    commands: list[CommandEntry],
    view: CompletionView,
) -> None
```

| Name | Type |
|------|------|
| `commands` | `list[CommandEntry]` |
| `view` | `CompletionView` |


## Methods

- [`update_commands()`](https://reference.langchain.com/python/deepagents-code/widgets/autocomplete/SlashCommandController/update_commands)
- [`can_handle()`](https://reference.langchain.com/python/deepagents-code/widgets/autocomplete/SlashCommandController/can_handle)
- [`reset()`](https://reference.langchain.com/python/deepagents-code/widgets/autocomplete/SlashCommandController/reset)
- [`name_prefix_matches()`](https://reference.langchain.com/python/deepagents-code/widgets/autocomplete/SlashCommandController/name_prefix_matches)
- [`on_text_changed()`](https://reference.langchain.com/python/deepagents-code/widgets/autocomplete/SlashCommandController/on_text_changed)
- [`on_key()`](https://reference.langchain.com/python/deepagents-code/widgets/autocomplete/SlashCommandController/on_key)
- [`apply_name_prefix_completion()`](https://reference.langchain.com/python/deepagents-code/widgets/autocomplete/SlashCommandController/apply_name_prefix_completion)

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/a98f0dfa8d534d8a1885b524632400e52db22ac6/libs/code/deepagents_code/widgets/autocomplete.py#L115)