config
Class info¶
Classes¶
| Name | Children | Inherits |
|---|---|---|
| AgentSpec acptui.config How to reach an agent: a command to launch (stdio) or a URL (HTTP / WebSocket). |
||
| ConfigError acptui.config The config file could not be read. |
||
| McpServerConfig acptui.config An MCP server passed to the agent on session setup (stdio or HTTP). |
||
| Settings acptui.config Contents of ``config.toml``. |
||
| UserAgent acptui.config An agent entry of ``config.toml`` (the table key is its id). |
🛈 DocStrings¶
Agent registry and user configuration.
The built-in registry lists well-known ACP agents. Users add their own agents (or
override built-in ones) in config.toml in the platform config directory::
default_agent = "codex"
theme = "tokyo-night"
diff_view = "auto" # "unified", "split" or "auto"
[agents.my-agent]
name = "My agent"
command = ["my-agent", "--acp"]
env = { MY_FLAG = "1" }
[agents.remote]
name = "Remote agent"
url = "https://example.com/acp"
headers = { "X-API-Key" = "${MY_API_KEY}" } # ${VAR} expands from the environment
BUILTIN_AGENTS
module-attribute
¶
BUILTIN_AGENTS: tuple[AgentSpec, ...] = (
AgentSpec(
id="claude",
name="Claude Code",
command=("claude-agent-acp",),
description="Anthropic's Claude Code via the claude-agent-acp adapter",
homepage="https://github.com/agentclientprotocol/claude-agent-acp",
install="npm install -g @agentclientprotocol/claude-agent-acp",
builtin=True,
),
AgentSpec(
id="codex",
name="Codex",
command=("codex-acp",),
description="OpenAI Codex via the codex-acp adapter",
homepage="https://github.com/agentclientprotocol/codex-acp",
install="npm install -g @agentclientprotocol/codex-acp",
builtin=True,
),
AgentSpec(
id="gemini",
name="Gemini CLI",
command=("gemini", "--experimental-acp"),
description="Google's Gemini CLI in ACP mode",
homepage="https://github.com/google-gemini/gemini-cli",
install="npm install -g @google/gemini-cli",
builtin=True,
),
AgentSpec(
id="opencode",
name="OpenCode",
command=("opencode", "acp"),
description="SST's OpenCode in ACP mode",
homepage="https://opencode.ai",
install="curl -fsSL https://opencode.ai/install | bash",
builtin=True,
),
AgentSpec(
id="agentpool",
name="AgentPool",
command=("agentpool", "serve-acp"),
description="agentpool's configurable agents served over ACP",
homepage="https://github.com/phil65/agentpool",
install="uv tool install agentpool",
builtin=True,
),
AgentSpec(
id="demo",
name="Demo agent",
command=(sys.executable, "-m", "acptui.demo"),
description="Scripted v2 agent bundled with acptui (no LLM, no API key)",
homepage="https://github.com/phil65/acptui",
builtin=True,
),
)
Agents acptui knows out of the box.
DiffViewMode
module-attribute
¶
How diffs are shown: one column, side by side, or side by side when wide enough.
AgentSpec
¶
Bases: BaseModel
How to reach an agent: a command to launch (stdio) or a URL (HTTP / WebSocket).
Source code in src/acptui/config.py
available
property
¶
Whether the agent can be started: its program is on PATH (or it is remote).
builtin
class-attribute
instance-attribute
¶
Whether the agent comes from the built-in registry.
command
class-attribute
instance-attribute
¶
Program and arguments of a local (stdio) agent.
env
class-attribute
instance-attribute
¶
Extra environment variables for a local agent (${VAR} is expanded).
headers
class-attribute
instance-attribute
¶
HTTP headers for a remote agent (${VAR} is expanded).
options
class-attribute
instance-attribute
¶
Initial session config options (config_id -> value), e.g. {"model": "opus"}.
url
class-attribute
instance-attribute
¶
URL of a remote agent (http(s):// or ws(s)://).
resolved_env
¶
resolved_headers
¶
ConfigError
¶
McpServerConfig
¶
Bases: BaseModel
An MCP server passed to the agent on session setup (stdio or HTTP).
Source code in src/acptui/config.py
command
class-attribute
instance-attribute
¶
Program of a stdio server (resolved on PATH; ACP requires an absolute path).
to_schema
¶
The ACP model (${VAR} is expanded in env and header values).
Source code in src/acptui/config.py
Settings
¶
Bases: BaseModel
Contents of config.toml.
Source code in src/acptui/config.py
additional_directories
class-attribute
instance-attribute
¶
More workspace roots for every session (if the agent supports it).
agent_options
class-attribute
instance-attribute
¶
Initial session config options per agent id (also for built-in agents).
agents
class-attribute
instance-attribute
¶
agents: dict[str, UserAgent] = Field(default_factory=dict)
User-defined agents; an id of a built-in agent replaces it.
default_agent
class-attribute
instance-attribute
¶
Agent to start when acptui is run without one (instead of the picker).
diff_view
class-attribute
instance-attribute
¶
diff_view: DiffViewMode = 'auto'
How diffs are shown.
expand_thoughts
class-attribute
instance-attribute
¶
Show agent thoughts expanded instead of collapsed.
mcp_servers
class-attribute
instance-attribute
¶
mcp_servers: list[McpServerConfig] = Field(default_factory=list)
MCP servers passed to every session (if the agent supports the transport).
system_prompt
class-attribute
instance-attribute
¶
Extra system instructions for every session (if the agent supports it).
system_prompt_mode
class-attribute
instance-attribute
¶
Append to the agent's own instructions, or replace them (if supported).
all_agents
¶
all_agents() -> list[AgentSpec]
Built-in and user agents; user agents override built-in ones with the same id.
Source code in src/acptui/config.py
UserAgent
¶
Bases: BaseModel
An agent entry of config.toml (the table key is its id).
Source code in src/acptui/config.py
to_spec
¶
to_spec(agent_id: str) -> AgentSpec
Build the agent spec.
Source code in src/acptui/config.py
config_path
¶
Path of config.toml ($ACPTUI_CONFIG overrides the platform default).
expand_env
¶
Replace ${NAME} references with environment variables (unset ones become empty).
Source code in src/acptui/config.py
load_settings
¶
load_settings(path: Path | None = None) -> Settings
Read the settings; a missing file gives the defaults.
Raises:
| Type | Description |
|---|---|
ConfigError
|
The file is not valid TOML or has invalid values. |