Skip to content

acp_presets

Class info

Classes

Name Children Inherits
ACPAgentPreset
llmling_agent.agent.acp_presets
Definition of a well-known ACP agent preset.
    ClaudeACPSettings
    llmling_agent.agent.acp_presets
    Settings for claude-code-acp agent.

      🛈 DocStrings

      ACP agent presets for well-known ACP servers.

      This module provides pre-configured settings for popular ACP-compatible agents, enabling easy integration with typed configuration and LSP autocomplete support.

      The presets build CLI arguments for spawning ACP servers, providing a typed interface over command-line options.

      Example YAML configuration
      agents:
        coder:
          type: claude
          claude:
            append_system_prompt: "Always write tests first."
            permission_mode: acceptEdits
            allowed_tools:
              - Read
              - Write
              - Bash(git:*)
      

      ACPAgentPreset dataclass

      Definition of a well-known ACP agent preset.

      Source code in src/llmling_agent/agent/acp_presets.py
      110
      111
      112
      113
      114
      115
      116
      117
      118
      119
      120
      121
      122
      123
      124
      125
      126
      127
      128
      129
      130
      131
      132
      133
      134
      135
      136
      137
      138
      139
      140
      141
      142
      143
      144
      145
      146
      @dataclass
      class ACPAgentPreset:
          """Definition of a well-known ACP agent preset."""
      
          name: str
          """Identifier for this preset (e.g., 'claude', 'aider')."""
      
          command: str
          """Command to spawn the ACP server."""
      
          base_args: list[str] = field(default_factory=list)
          """Default command-line arguments (before settings)."""
      
          description: str = ""
          """Human-readable description of the agent."""
      
          settings_model: type[BaseModel] | None = None
          """Pydantic model for typed settings (enables LSP autocomplete)."""
      
          env: dict[str, str] = field(default_factory=dict)
          """Default environment variables."""
      
          def build_command(self, settings: BaseModel | None = None) -> tuple[str, list[str]]:
              """Build full command with arguments.
      
              Args:
                  settings: Optional settings model instance
      
              Returns:
                  Tuple of (command, args)
              """
              args = list(self.base_args)
      
              if settings and hasattr(settings, "build_args"):
                  args.extend(settings.build_args())
      
              return self.command, args
      

      base_args class-attribute instance-attribute

      base_args: list[str] = field(default_factory=list)
      

      Default command-line arguments (before settings).

      command instance-attribute

      command: str
      

      Command to spawn the ACP server.

      description class-attribute instance-attribute

      description: str = ''
      

      Human-readable description of the agent.

      env class-attribute instance-attribute

      env: dict[str, str] = field(default_factory=dict)
      

      Default environment variables.

      name instance-attribute

      name: str
      

      Identifier for this preset (e.g., 'claude', 'aider').

      settings_model class-attribute instance-attribute

      settings_model: type[BaseModel] | None = None
      

      Pydantic model for typed settings (enables LSP autocomplete).

      build_command

      build_command(settings: BaseModel | None = None) -> tuple[str, list[str]]
      

      Build full command with arguments.

      Parameters:

      Name Type Description Default
      settings BaseModel | None

      Optional settings model instance

      None

      Returns:

      Type Description
      tuple[str, list[str]]

      Tuple of (command, args)

      Source code in src/llmling_agent/agent/acp_presets.py
      132
      133
      134
      135
      136
      137
      138
      139
      140
      141
      142
      143
      144
      145
      146
      def build_command(self, settings: BaseModel | None = None) -> tuple[str, list[str]]:
          """Build full command with arguments.
      
          Args:
              settings: Optional settings model instance
      
          Returns:
              Tuple of (command, args)
          """
          args = list(self.base_args)
      
          if settings and hasattr(settings, "build_args"):
              args.extend(settings.build_args())
      
          return self.command, args
      

      ClaudeACPSettings

      Bases: BaseModel

      Settings for claude-code-acp agent.

      These settings map to claude CLI arguments. See claude --help for full documentation.

      Source code in src/llmling_agent/agent/acp_presets.py
       32
       33
       34
       35
       36
       37
       38
       39
       40
       41
       42
       43
       44
       45
       46
       47
       48
       49
       50
       51
       52
       53
       54
       55
       56
       57
       58
       59
       60
       61
       62
       63
       64
       65
       66
       67
       68
       69
       70
       71
       72
       73
       74
       75
       76
       77
       78
       79
       80
       81
       82
       83
       84
       85
       86
       87
       88
       89
       90
       91
       92
       93
       94
       95
       96
       97
       98
       99
      100
      101
      102
      103
      104
      105
      106
      107
      class ClaudeACPSettings(BaseModel):
          """Settings for claude-code-acp agent.
      
          These settings map to claude CLI arguments.
          See `claude --help` for full documentation.
          """
      
          system_prompt: str | None = Field(
              default=None,
              description="Custom system prompt (replaces default Claude Code prompt).",
          )
      
          append_system_prompt: str | None = Field(
              default=None,
              description="Text to append to the default system prompt.",
          )
      
          model: str | None = Field(
              default=None,
              description="Model override. Use alias ('sonnet', 'opus') or full name.",
              examples=["sonnet", "opus", "claude-sonnet-4-20250514"],
          )
      
          permission_mode: (
              Literal["default", "acceptEdits", "bypassPermissions", "dontAsk", "plan"] | None
          ) = Field(
              default=None,
              description="Permission handling mode for tool execution.",
          )
      
          allowed_tools: list[str] | None = Field(
              default=None,
              description="Whitelist of allowed tools (e.g., ['Read', 'Write', 'Bash(git:*)']).",
          )
      
          disallowed_tools: list[str] | None = Field(
              default=None,
              description="Blacklist of disallowed tools.",
          )
      
          mcp_config: list[str] | None = Field(
              default=None,
              description="MCP server config files or JSON strings to load.",
          )
      
          add_dir: list[str] | None = Field(
              default=None,
              description="Additional directories to allow tool access to.",
          )
      
          def build_args(self) -> list[str]:
              """Build CLI arguments from settings.
      
              Returns:
                  List of command-line arguments for claude-code-acp
              """
              args: list[str] = []
      
              if self.system_prompt:
                  args.extend(["--system-prompt", self.system_prompt])
              if self.append_system_prompt:
                  args.extend(["--append-system-prompt", self.append_system_prompt])
              if self.model:
                  args.extend(["--model", self.model])
              if self.permission_mode:
                  args.extend(["--permission-mode", self.permission_mode])
              if self.allowed_tools:
                  args.extend(["--allowed-tools", *self.allowed_tools])
              if self.disallowed_tools:
                  args.extend(["--disallowed-tools", *self.disallowed_tools])
              if self.mcp_config:
                  args.extend(["--mcp-config", *self.mcp_config])
              if self.add_dir:
                  args.extend(["--add-dir", *self.add_dir])
      
              return args
      

      build_args

      build_args() -> list[str]
      

      Build CLI arguments from settings.

      Returns:

      Type Description
      list[str]

      List of command-line arguments for claude-code-acp

      Source code in src/llmling_agent/agent/acp_presets.py
       82
       83
       84
       85
       86
       87
       88
       89
       90
       91
       92
       93
       94
       95
       96
       97
       98
       99
      100
      101
      102
      103
      104
      105
      106
      107
      def build_args(self) -> list[str]:
          """Build CLI arguments from settings.
      
          Returns:
              List of command-line arguments for claude-code-acp
          """
          args: list[str] = []
      
          if self.system_prompt:
              args.extend(["--system-prompt", self.system_prompt])
          if self.append_system_prompt:
              args.extend(["--append-system-prompt", self.append_system_prompt])
          if self.model:
              args.extend(["--model", self.model])
          if self.permission_mode:
              args.extend(["--permission-mode", self.permission_mode])
          if self.allowed_tools:
              args.extend(["--allowed-tools", *self.allowed_tools])
          if self.disallowed_tools:
              args.extend(["--disallowed-tools", *self.disallowed_tools])
          if self.mcp_config:
              args.extend(["--mcp-config", *self.mcp_config])
          if self.add_dir:
              args.extend(["--add-dir", *self.add_dir])
      
          return args
      

      get_preset

      get_preset(name: str) -> ACPAgentPreset | None
      

      Get an ACP agent preset by name.

      Parameters:

      Name Type Description Default
      name str

      Preset identifier (e.g., 'claude')

      required

      Returns:

      Type Description
      ACPAgentPreset | None

      ACPAgentPreset if found, None otherwise

      Source code in src/llmling_agent/agent/acp_presets.py
      175
      176
      177
      178
      179
      180
      181
      182
      183
      184
      def get_preset(name: str) -> ACPAgentPreset | None:
          """Get an ACP agent preset by name.
      
          Args:
              name: Preset identifier (e.g., 'claude')
      
          Returns:
              ACPAgentPreset if found, None otherwise
          """
          return ACP_PRESETS.get(name)
      

      list_presets

      list_presets() -> list[str]
      

      List all available preset names.

      Source code in src/llmling_agent/agent/acp_presets.py
      187
      188
      189
      def list_presets() -> list[str]:
          """List all available preset names."""
          return list(ACP_PRESETS.keys())