# run_textual_cli_async

> **Function** in `deepagents_cli`

📖 [View in docs](https://reference.langchain.com/python/deepagents-cli/main/run_textual_cli_async)

Run the Textual CLI interface (async version).

Starts a LangGraph server in a subprocess and connects the TUI to it via the
`langgraph-sdk` client.

## Signature

```python
run_textual_cli_async(
    assistant_id: str,
    *,
    auto_approve: bool = False,
    sandbox_type: str = 'none',
    sandbox_id: str | None = None,
    sandbox_setup: str | None = None,
    model_name: str | None = None,
    model_params: dict[str, Any] | None = None,
    profile_override: dict[str, Any] | None = None,
    thread_id: str | None = None,
    resume_thread: str | None = None,
    initial_prompt: str | None = None,
    initial_skill: str | None = None,
    mcp_config_path: str | None = None,
    no_mcp: bool = False,
    trust_project_mcp: bool | None = None,
) -> AppResult
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `assistant_id` | `str` | Yes | Agent identifier for memory storage |
| `auto_approve` | `bool` | No | Whether to auto-approve tool usage (default: `False`) |
| `sandbox_type` | `str` | No | Type of sandbox ("none", "agentcore", "modal", "runloop", "daytona", "langsmith") (default: `'none'`) |
| `sandbox_id` | `str \| None` | No | Optional existing sandbox ID to reuse. (default: `None`) |
| `sandbox_setup` | `str \| None` | No | Optional path to setup script to run in the sandbox after creation. (default: `None`) |
| `model_name` | `str \| None` | No | Optional model name to use (default: `None`) |
| `model_params` | `dict[str, Any] \| None` | No | Extra kwargs from `--model-params` to pass to the model.  These override config file values. (default: `None`) |
| `profile_override` | `dict[str, Any] \| None` | No | Extra profile fields from `--profile-override`.  Merged on top of config file profile overrides. (default: `None`) |
| `thread_id` | `str \| None` | No | Thread ID for the session.  `None` when `resume_thread` is provided (the TUI resolves the final ID asynchronously). (default: `None`) |
| `resume_thread` | `str \| None` | No | Raw resume intent from `-r` flag.  `'__MOST_RECENT__'` for bare `-r`, a thread ID string for `-r <id>`, or `None` for new sessions.  Resolved asynchronously inside the TUI. (default: `None`) |
| `initial_prompt` | `str \| None` | No | Optional prompt to auto-submit when session starts (default: `None`) |
| `initial_skill` | `str \| None` | No | Optional skill name to invoke when the session starts. (default: `None`) |
| `mcp_config_path` | `str \| None` | No | Optional path to MCP servers JSON configuration file.  Merged on top of auto-discovered configs (highest precedence). (default: `None`) |
| `no_mcp` | `bool` | No | Disable all MCP tool loading. (default: `False`) |
| `trust_project_mcp` | `bool \| None` | No | Controls project-level stdio server trust.  `True` to allow, `False` to deny, `None` to check trust store. (default: `None`) |

## Returns

`AppResult`

An `AppResult` with the return code and final thread ID.

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/b710a69b12e49479045eaa54dfb709326473500b/libs/cli/deepagents_cli/main.py#L680)