# ChatInput

> **Class** in `deepagents_cli`

📖 [View in docs](https://reference.langchain.com/python/deepagents-cli/widgets/chat_input/ChatInput)

Chat input widget with prompt, multi-line text, autocomplete, and history.

Features:
- Multi-line input with TextArea
- Enter to submit, modifier key for newlines (see `config.newline_shortcut`)
- Up/Down arrows for command history at input boundaries (start/end of text)
- Autocomplete for @ (files) and / (commands)

## Signature

```python
ChatInput(
    self,
    cwd: str | Path | None = None,
    history_file: Path | None = None,
    image_tracker: MediaTracker | None = None,
    **kwargs: Any = {},
)
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `cwd` | `str \| Path \| None` | No | Current working directory for file completion (default: `None`) |
| `history_file` | `Path \| None` | No | Path to history file (default: ~/.deepagents/history.jsonl) (default: `None`) |
| `image_tracker` | `MediaTracker \| None` | No | Optional tracker for attached images (default: `None`) |
| `**kwargs` | `Any` | No | Additional arguments for parent (default: `{}`) |

## Extends

- `Vertical`

## Constructors

```python
__init__(
    self,
    cwd: str | Path | None = None,
    history_file: Path | None = None,
    image_tracker: MediaTracker | None = None,
    **kwargs: Any = {},
) -> None
```

| Name | Type |
|------|------|
| `cwd` | `str \| Path \| None` |
| `history_file` | `Path \| None` |
| `image_tracker` | `MediaTracker \| None` |


## Properties

- `DEFAULT_CSS`
- `mode`
- `value`
- `input_widget`

## Methods

- [`compose()`](https://reference.langchain.com/python/deepagents-cli/widgets/chat_input/ChatInput/compose)
- [`on_mount()`](https://reference.langchain.com/python/deepagents-cli/widgets/chat_input/ChatInput/on_mount)
- [`update_slash_commands()`](https://reference.langchain.com/python/deepagents-cli/widgets/chat_input/ChatInput/update_slash_commands)
- [`on_text_area_changed()`](https://reference.langchain.com/python/deepagents-cli/widgets/chat_input/ChatInput/on_text_area_changed)
- [`on_chat_text_area_typing()`](https://reference.langchain.com/python/deepagents-cli/widgets/chat_input/ChatInput/on_chat_text_area_typing)
- [`on_chat_text_area_submitted()`](https://reference.langchain.com/python/deepagents-cli/widgets/chat_input/ChatInput/on_chat_text_area_submitted)
- [`on_chat_text_area_history_previous()`](https://reference.langchain.com/python/deepagents-cli/widgets/chat_input/ChatInput/on_chat_text_area_history_previous)
- [`on_chat_text_area_history_next()`](https://reference.langchain.com/python/deepagents-cli/widgets/chat_input/ChatInput/on_chat_text_area_history_next)
- [`on_chat_text_area_pasted_paths()`](https://reference.langchain.com/python/deepagents-cli/widgets/chat_input/ChatInput/on_chat_text_area_pasted_paths)
- [`handle_external_paste()`](https://reference.langchain.com/python/deepagents-cli/widgets/chat_input/ChatInput/handle_external_paste)
- [`on_key()`](https://reference.langchain.com/python/deepagents-cli/widgets/chat_input/ChatInput/on_key)
- [`watch_mode()`](https://reference.langchain.com/python/deepagents-cli/widgets/chat_input/ChatInput/watch_mode)
- [`focus_input()`](https://reference.langchain.com/python/deepagents-cli/widgets/chat_input/ChatInput/focus_input)
- [`set_disabled()`](https://reference.langchain.com/python/deepagents-cli/widgets/chat_input/ChatInput/set_disabled)
- [`set_cursor_active()`](https://reference.langchain.com/python/deepagents-cli/widgets/chat_input/ChatInput/set_cursor_active)
- [`exit_mode()`](https://reference.langchain.com/python/deepagents-cli/widgets/chat_input/ChatInput/exit_mode)
- [`dismiss_completion()`](https://reference.langchain.com/python/deepagents-cli/widgets/chat_input/ChatInput/dismiss_completion)
- [`render_completion_suggestions()`](https://reference.langchain.com/python/deepagents-cli/widgets/chat_input/ChatInput/render_completion_suggestions)
- [`clear_completion_suggestions()`](https://reference.langchain.com/python/deepagents-cli/widgets/chat_input/ChatInput/clear_completion_suggestions)
- [`on_completion_popup_option_clicked()`](https://reference.langchain.com/python/deepagents-cli/widgets/chat_input/ChatInput/on_completion_popup_option_clicked)
- [`replace_completion_range()`](https://reference.langchain.com/python/deepagents-cli/widgets/chat_input/ChatInput/replace_completion_range)

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/64ecf141be0479f859f4efe25d139166b45ee18c/libs/cli/deepagents_cli/widgets/chat_input.py#L828)