from_cli_args(
cls,
*,
project_context: ProjectContext | None,
model_name| Name | Type | Description |
|---|---|---|
project_context* | ProjectContext | None | Explicit user/project path context. |
model_name* | str | None | Model spec string. |
summarization_model | str | None | Default: NoneModel spec used only for context-compaction
summaries; |
model_params* | dict[str, Any] | None | |
cli_max_retries | int | None | Default: None |
profile_overrides | dict[str, Any] | None | Default: None |
assistant_id* | str | |
auto_approve* | bool | |
interrupt_shell_only | bool | Default: False |
shell_allow_list | list[str] | None | Default: None |
sandbox_type | str | Default: 'none' |
sandbox_id* | str | None | |
sandbox_snapshot_name* | str | None | |
sandbox_setup* | str | None | |
enable_shell* | bool | |
enable_ask_user* | bool | |
enable_interpreter | bool | None | Default: None |
interpreter_ptc | str | list[str] | None | Default: None |
interpreter_ptc_acknowledge_unsafe | bool | Default: False |
allow_fs_tools | list[FsToolName] | None | Default: None |
rubric_model | str | None | Default: None |
rubric_max_iterations | int | None | Default: None |
auto_classifier_model | str | None | Default: None |
recursion_limit | int | None | Default: None |
mcp_config_path* | str | None | |
no_mcp* | bool | |
trust_project_mcp* | bool | None | |
interactive* | bool | |
trust_project_extensions | bool | Default: False |
extension_paths | tuple[str, ...] | Default: () |
Build a ServerConfig from parsed CLI arguments.
Handles path normalization (e.g. resolving relative MCP config paths against the user's working directory) so that the raw serialized values are always absolute and unambiguous.
Extra model kwargs.
Explicit --max-retries value.
Model profile metadata overrides.
Agent identifier.
Auto-approve all tools.
Validate shell commands via middleware instead of HITL.
Restrictive shell allow-list to forward to the
server subprocess for ShellAllowListMiddleware.
Sandbox type.
Existing sandbox ID to reuse.
Snapshot (langsmith) or blueprint (runloop) name to use or create.
Path to setup script for the sandbox.
Enable shell execution tools.
Enable ask_user tool.
Enable CodeInterpreterMiddleware on the main
agent. None uses the sandbox-aware default.
Invocation-scoped PTC allowlist override.
Explicit acknowledgement for
an invocation-scoped interpreter_ptc="all".
Allowlist for FilesystemMiddleware's tools
param to forward to the server subprocess. None leaves the
SDK default (all tools).
Grader model spec; None reuses the main model.
Explicit grader iterations per rubric attempt;
None uses the SDK default.
Auto classifier model spec; None resolves from
env / config.toml and then reuses the main model.
Explicit main-agent recursion_limit; None resolves
from runtime configuration at agent-build time.
Path to MCP config.
Disable MCP.
Trust project MCP servers.
Whether the agent is interactive.
Allow project extension execution.
Explicit one-run extension files or directories.