run_non_interactive(
message: str,
assistant_id: str = DEFAULT_AGENT_NAME,
model_name:| Name | Type | Description |
|---|---|---|
message* | str | The task/message to execute. |
assistant_id | str | Default: DEFAULT_AGENT_NAMEAgent identifier for memory storage. |
model_name | str | None | Default: NoneOptional model name to use. |
model_params | dict[str, Any] | None | Default: None |
sandbox_type | str | Default: 'none' |
sandbox_id | str | None | Default: None |
sandbox_setup | str | None | Default: None |
initial_skill | str | None | Default: None |
startup_cmd | str | None | Default: None |
profile_override | dict[str, Any] | None | Default: None |
quiet | bool | Default: False |
stream | bool | Default: True |
mcp_config_path | str | None | Default: None |
no_mcp | bool | Default: False |
trust_project_mcp | bool | Default: False |
max_turns | int | None | Default: None |
Run a single task non-interactively and exit.
The agent is created with interactive=False, which tailors the system
prompt for autonomous headless execution (no clarification questions,
reasonable assumptions).
Shell access and auto-approval are controlled by --shell-allow-list:
recommended or explicit list → shell enabled, commands gated by
allow-list; non-shell tools approved unconditionally.all → shell enabled, any command allowed, all tools auto-approved.Note: startup header rendering avoids synchronous LangSmith URL lookups. A background thread resolves the thread URL concurrently and the result is displayed after task completion if available.
Extra kwargs from --model-params to pass to the model.
These override config file values.
Type of sandbox ('none', 'agentcore',
'daytona', 'langsmith', 'modal', 'runloop').
Optional existing sandbox ID to reuse.
Optional path to setup script to run in the sandbox after creation.
Optional skill name whose SKILL.md instructions wrap
the user message before sending it to the agent.
Shell command to run at startup, before the agent runs.
Output follows the same console routing as other app messages:
stdout by default, stderr when -q is set. Non-zero exits and
timeouts warn but do not abort the task.
Extra profile fields from --profile-override.
Merged on top of config file profile overrides.
When True, all console output (headers, status messages,
tool notifications, HITL decisions, errors) is redirected to
stderr so that only the agent's response text appears on stdout.
When True (default), text chunks are written to stdout
as they arrive.
When False, the full response is buffered and written to stdout in
one shot after the agent finishes.
Optional path to MCP servers JSON configuration file. Merged on top of auto-discovered configs (highest precedence).
Disable all MCP tool loading.
When True, allow project-level stdio MCP
servers. When False (default), project stdio servers are
silently skipped.
Optional cap on total agentic turns. When None, the
internal safety default applies.