# CommandHandlerSpec

> **Class** in `deepagents_code`

📖 [View in docs](https://reference.langchain.com/python/deepagents-code/hooks/models/config/CommandHandlerSpec)

Configuration for a synchronous command hook.

Currently only `type: "command"` is supported. Additional handler types
remain a discriminated-union extension point and are rejected until
implemented.

When `argv` is set, the runner launches via `create_subprocess_exec` and
ignores shell metacharacters in `command`.

`argv` is a temporary legacy-migration compatibility field. Remove it with
`hooks.legacy` and `hooks.migration` after September 1, 2026.

## Signature

```python
CommandHandlerSpec()
```

## Extends

- `_ConfigModel`

## Properties

- `type`
- `command`
- `argv`
- `timeout`
- `status_message`
- `async_`

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/caaa7e7c12d214afa5cf0a1afed8eb6232aa6f7b/libs/code/deepagents_code/hooks/models/config.py#L20)