Create a CLI-configured agent with flexible options.
This is the main entry point for creating a deepagents CLI agent, usable both internally and from external code (e.g., benchmarking frameworks).
create_cli_agent(
model: str | BaseChatModel,
assistant_id: str,
*,
tools: Sequence[BaseTool | Callable | dict[str, Any]] | None = None,
sandbox: SandboxBackendProtocol | None = None,
sandbox_type: str | None = None,
system_prompt: str | None = None,
interactive: bool = True,
auto_approve: bool = False,
interrupt_shell_only: bool = False,
shell_allow_list: list[str] | None = None,
enable_ask_user: bool = True,
enable_memory: bool = True,
enable_skills: bool = True,
enable_shell: bool = True,
checkpointer: BaseCheckpointSaver | None = None,
mcp_server_info: list[MCPServerInfo] | None = None,
cwd: str | Path | None = None,
project_context: ProjectContext | None = None,
async_subagents: list[AsyncSubAgent] | None = None
) -> tuple[Pregel, CompositeBackend]| Name | Type | Description |
|---|---|---|
model* | str | BaseChatModel | LLM model to use (e.g., |
assistant_id* | str | Agent identifier for memory/state storage |
tools | Sequence[BaseTool | Callable | dict[str, Any]] | None | Default: NoneAdditional tools to provide to agent |
sandbox | SandboxBackendProtocol | None | Default: NoneOptional sandbox backend for remote execution
(e.g., If |
sandbox_type | str | None | Default: NoneType of sandbox provider
( |
system_prompt | str | None | Default: NoneOverride the default system prompt. If |
interactive | bool | Default: TrueWhen |
auto_approve | bool | Default: FalseIf If |
interrupt_shell_only | bool | Default: FalseIf Used in non-interactive mode with a restrictive shell allow-list to avoid splitting traces into multiple LangSmith runs. Has no effect when |
shell_allow_list | list[str] | None | Default: NoneExplicit restrictive shell allow-list forwarded from
the CLI process. When provided (and |
enable_ask_user | bool | Default: TrueEnable Disabled in non-interactive mode. |
enable_memory | bool | Default: TrueEnable |
enable_skills | bool | Default: TrueEnable |
enable_shell | bool | Default: TrueEnable shell execution via |
checkpointer | BaseCheckpointSaver | None | Default: NoneOptional checkpointer for session persistence.
When |
mcp_server_info | list[MCPServerInfo] | None | Default: NoneMCP server metadata to surface in the system prompt. |
cwd | str | Path | None | Default: NoneOverride the working directory for the agent's filesystem backend and system prompt. |
project_context | ProjectContext | None | Default: NoneExplicit project path context for project-sensitive
behavior such as project |
async_subagents | list[AsyncSubAgent] | None | Default: NoneRemote LangGraph deployments to expose as async subagent tools. Loaded from |