Pre-flight Checks
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:
-
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.
-
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:
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.
Pre-flight Checks
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.jsonto 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 clinecommand, no Memory Protocol rule file, no entry in the setup help text, and no documentation.Proposed Solution
Add
clineas a declarative agent inagentAdapters()(the same pattern used by Cursor, Windsurf, Qwen, Kiro, VS Code Copilot, and Kilo Code). Runningengram setup clinewould:Register the MCP server in
~/.cline/data/settings/cline_mcp_settings.jsonunder the top-levelmcpServerskey — Cline uses the same{command, args}shape as themcpServersObjectformat already supported by the registry.Write the Memory Protocol to
~/.cline/rules/engram.mdas a dedicated, engram-owned file (wholeFilestyle). Cline reads all.mdfiles from~/.cline/rules/and combines them into a unified ruleset, so this is the correct instruction surface for a global Memory Protocol.Example usage:
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/writeInstructiondriver inregistry.gohandles 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.mdcross-tool (Cline reads~/.agents/AGENTS.md) — Rejected as the primary surface. While Cline does readAGENTS.mdfor 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.mdand.txtfiles, 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.goandmain_test.goneed a one-line addition each to includeclinein the expected agents list.