Skip to content

feat(setup): add Cline CLI as supported agent #554

Description

@freddwithy

Pre-flight Checks

  • I have searched existing issues and this is not a duplicate
  • I understand this issue needs status:approved before a PR can be opened

Problem Description

Cline is a popular AI coding agent available as a VS Code extension, CLI, and SDK. It supports MCP servers natively, but it is not in Engram's agent registry. Users who want to use Engram with Cline must manually edit ~/.cline/data/settings/cline_mcp_settings.json to register the MCP server, and there is no Memory Protocol injected into Cline's rules surface. This breaks parity with the 12 agents Engram already supports out of the box.

Currently, the only way to use Engram with Cline is a manual MCP config edit — no engram setup cline command, no Memory Protocol rule file, no entry in the setup help text, and no documentation.

Proposed Solution

Add cline as a declarative agent in agentAdapters() (the same pattern used by Cursor, Windsurf, Qwen, Kiro, VS Code Copilot, and Kilo Code). Running engram setup cline would:

  1. Register the MCP server in ~/.cline/data/settings/cline_mcp_settings.json under the top-level mcpServers key — Cline uses the same {command, args} shape as the mcpServersObject format already supported by the registry.

  2. Write the Memory Protocol to ~/.cline/rules/engram.md as a dedicated, engram-owned file (wholeFile style). Cline reads all .md files from ~/.cline/rules/ and combines them into a unified ruleset, so this is the correct instruction surface for a global Memory Protocol.

Example usage:

engram setup cline

Expected output: MCP config written + Memory Protocol rule file written, with next-steps guidance to restart Cline.

This requires no new installer code — just a registry entry + path helpers. The generic injectMCP / writeInstruction driver in registry.go handles everything. No plugin directory, no hooks, no extra runtime dependencies.

Affected Area

CLI (commands, flags)

Alternatives Considered

Bespoke plugin with hooks (like Claude Code / Codex) — Rejected. Cline's hooks are SDK/TypeScript-based plugins, not shell scripts. Adding a TypeScript plugin would violate the thin-adapter principle (skills/plugin-thin) and introduce a Node runtime dependency. MCP + rules are sufficient for the Memory Protocol.

Use AGENTS.md cross-tool (Cline reads ~/.agents/AGENTS.md) — Rejected as the primary surface. While Cline does read AGENTS.md for cross-tool compatibility, using it could conflict with other agents that also read it. A dedicated file in Cline's own rules directory (~/.cline/rules/engram.md) is cleaner and mirrors how Cursor (~/.cursor/engram-memory-protocol.md) and other declarative agents are handled.

Additional Context

Cline's official config documentation confirms the paths and formats:

MCP settings~/.cline/data/settings/cline_mcp_settings.json:

{
  "mcpServers": {
    "engram": {
      "command": "engram",
      "args": ["mcp", "--tools=agent"]
    }
  }
}

Global rules~/.cline/rules/*.md (Cline reads all .md and .txt files, combining them into a unified ruleset).

Reference: Cline Config docs

The implementation touches 9 files total (4 Go, 5 docs), all following existing patterns. Tests in registry_test.go and main_test.go need a one-line addition each to include cline in the expected agents list.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions