Skip to content

The cross-harness, self-improving memory layer for AI agents. Join our community: https://discord.com/invite/zdNChS2fBu

feat(cli): make cline installable through beacon endpoint hooks

Claudeb77a08841469
diff --git a/cli/beacon/cmd/endpoint_diagnostics.go b/cli/beacon/cmd/endpoint_diagnostics.go
index dd997b4b..08c5fbcc 100644
--- a/cli/beacon/cmd/endpoint_diagnostics.go
+++ b/cli/beacon/cmd/endpoint_diagnostics.go
@@ -869,7 +869,7 @@ func hookTargets() ([]string, error) {
}
func allHookTargetsForLevel() []string {
- all := []string{"cursor", "codex", "vscode", "factory", "opencode", "grok", "hermes", "devin-cli", "devin-desktop", "antigravity"}
+ all := []string{"cursor", "codex", "vscode", "factory", "opencode", "cline", "grok", "hermes", "devin-cli", "devin-desktop", "antigravity"}
if endpointOpts.hookLevel != "project" {
return all
}
@@ -917,6 +917,9 @@ func hookStatusesWithConfig(targets []string, cfg endpointconfig.Config) map[str
case "opencode":
status := endpointhooks.OpenCodeHookStatus(endpointhooks.OpenCodeOptions{Level: endpointhooks.Level(endpointOpts.hookLevel), LogPath: cfg.LogPath, UserMode: cfg.UserMode})
statuses[name] = hookTargetResult{Target: name, Status: targetStatus(status.Installed), Installed: status.Installed, Message: status.Message, Path: status.PluginPath, Raw: status}
+ case "cline":
+ status := endpointhooks.ClineHookStatus(endpointhooks.ClineOptions{Level: endpointhooks.Level(endpointOpts.hookLevel), LogPath: cfg.LogPath, UserMode: cfg.UserMode})
+ statuses[name] = hookTargetResult{Target: name, Status: targetStatus(status.Installed), Installed: status.Installed, Message: status.Message, Path: status.PluginPath, Raw: status}
case "grok":
status := endpointhooks.GrokHookStatus(endpointhooks.GrokOptions{Level: endpointhooks.Level(endpointOpts.hookLevel), LogPath: cfg.LogPath, UserMode: cfg.UserMode})
statuses[name] = hookTargetResult{Target: name, Status: targetStatus(status.Installed), Installed: status.Installed, Message: status.Message, Path: status.HooksPath, Raw: status}
diff --git a/cli/beacon/cmd/endpoint_hooks.go b/cli/beacon/cmd/endpoint_hooks.go
index 3ab157f7..61b7f08c 100644
--- a/cli/beacon/cmd/endpoint_hooks.go
+++ b/cli/beacon/cmd/endpoint_hooks.go
@@ -130,6 +130,16 @@ func installEndpointHookTarget(name string, cfg endpointconfig.Config) error {
return err
}
fmt.Printf("opencode plugin installed: %s\n", status.PluginPath)
+ case "cline":
+ status, err := endpointhooks.InstallCline(endpointhooks.ClineOptions{
+ Level: endpointhooks.Level(endpointOpts.hookLevel),
+ LogPath: cfg.LogPath,
+ UserMode: cfg.UserMode,
+ })
+ if err != nil {
+ return err
+ }
+ fmt.Printf("Cline plugin installed: %s\n", status.PluginPath)
case "grok":
status, err := endpointhooks.InstallGrok(endpointhooks.GrokOptions{
Level: endpointhooks.Level(endpointOpts.hookLevel),
@@ -275,6 +285,16 @@ func uninstallEndpointHookTarget(name string, cfg endpointconfig.Config) error {
return err
}
fmt.Println(status.Message)
+ case "cline":
+ status, err := endpointhooks.UninstallCline(endpointhooks.ClineOptions{
+ Level: endpointhooks.Level(endpointOpts.hookLevel),
+ LogPath: cfg.LogPath,
+ UserMode: cfg.UserMode,
+ })
+ if err != nil {
+ return err
+ }
+ fmt.Println(status.Message)
case "grok":
status, err := endpointhooks.UninstallGrok(endpointhooks.GrokOptions{
Level: endpointhooks.Level(endpointOpts.hookLevel),
@@ -373,6 +393,12 @@ func runEndpointHooksStatus(cmd *cobra.Command, args []string) error {
LogPath: cfg.LogPath,
UserMode: cfg.UserMode,
})
+ case "cline":
+ statuses["cline"] = endpointhooks.ClineHookStatus(endpointhooks.ClineOptions{
+ Level: endpointhooks.Level(endpointOpts.hookLevel),
+ LogPath: cfg.LogPath,
+ UserMode: cfg.UserMode,
+ })
case "grok":
statuses["grok"] = endpointhooks.GrokHookStatus(endpointhooks.GrokOptions{
Level: endpointhooks.Level(endpointOpts.hookLevel),
@@ -431,6 +457,10 @@ func runEndpointHooksStatus(cmd *cobra.Command, args []string) error {
status := statuses["opencode"].(endpointhooks.OpenCodeStatus)
fmt.Printf("opencode plugin: installed=%t path=%s\n", status.Installed, status.PluginPath)
fmt.Println(status.Message)
+ case "cline":
+ status := statuses["cline"].(endpointhooks.ClineStatus)
+ fmt.Printf("Cline plugin: installed=%t path=%s\n", status.Installed, status.PluginPath)
+ fmt.Println(status.Message)
case "grok":
status := statuses["grok"].(endpointhooks.GrokStatus)
fmt.Printf("Grok hooks: installed=%t path=%s\n", status.Installed, status.HooksPath)
diff --git a/cli/beacon/cmd/endpoint_hooks_repair.go b/cli/beacon/cmd/endpoint_hooks_repair.go
index bea422e0..66c4b241 100644
--- a/cli/beacon/cmd/endpoint_hooks_repair.go
+++ b/cli/beacon/cmd/endpoint_hooks_repair.go
@@ -148,7 +148,7 @@ func installedHookTargetsForUser(homeDir, logPath string) ([]string, error) {
}
func repairTargetOrder() []string {
- return []string{"claude", "codex", "cursor", "vscode", "factory", "opencode", "grok", "hermes", "devin-cli", "devin-desktop", "antigravity"}
+ return []string{"claude", "codex", "cursor", "vscode", "factory", "opencode", "cline", "grok", "hermes", "devin-cli", "devin-desktop", "antigravity"}
}
// withUserHome runs fn as if it were executing inside another user's profile.
diff --git a/cli/beacon/cmd/endpoint_hooks_test.go b/cli/beacon/cmd/endpoint_hooks_test.go
new file mode 100644
index 00000000..d8ad59d1
--- /dev/null
+++ b/cli/beacon/cmd/endpoint_hooks_test.go
@@ -0,0 +1,43 @@
+package cmd
+
+import (
+ "path/filepath"
+ "strings"
+ "testing"
+
+ endpointconfig "github.com/asymptote-labs/agent-beacon/cli/beacon/internal/endpoint/config"
+)
+
+// Every hook target the CLI advertises must be handled by the install, uninstall, and status
+// switches.
+//
+// The three switches end in `unsupported hook harness %q`, and the target registry is a separate
+// list, so adding a runtime to the registry without wiring a switch produces a harness that
+// tab-completes, documents, and then refuses to install. Uninstall is the safe probe: it removes
+// nothing when nothing is installed, and it fails the same way for an unwired target.
+func TestEveryHookTargetIsWired(t *testing.T) {
+ home := t.TempDir()
+ t.Setenv("HOME", home)
+ t.Setenv("USERPROFILE", home)
+ cfg := endpointconfig.Config{LogPath: filepath.Join(home, "runtime.jsonl"), UserMode: true}
+
+ seen := map[string]bool{}
+ for _, target := range harnessTargets {
+ if target.endpointKind != endpointTargetHook && len(target.hookAliases) == 0 {
+ continue
+ }
+ if seen[target.name] {
+ continue
+ }
+ seen[target.name] = true
+ t.Run(target.name, func(t *testing.T) {
+ if err := uninstallEndpointHookTarget(target.name, cfg); err != nil &&
+ strings.Contains(err.Error(), "unsupported hook harness") {
+ t.Errorf("%s is a hook target but is not wired into the CLI: %v", target.name, err)
+ }
+ })
+ }
+ if !seen["cline"] {
+ t.Error("cline is missing from the hook target registry")
+ }
+}
diff --git a/cli/beacon/cmd/endpoint_targets.go b/cli/beacon/cmd/endpoint_targets.go
index d0f70f98..6c39e434 100644
--- a/cli/beacon/cmd/endpoint_targets.go
+++ b/cli/beacon/cmd/endpoint_targets.go
@@ -45,6 +45,7 @@ var harnessTargets = []harnessTarget{
{name: "cursor", endpointKind: endpointTargetHook, endpointAliases: []string{"cursor"}, hookAliases: []string{"cursor"}},
{name: "factory", endpointKind: endpointTargetHook, endpointAliases: []string{"factory", "droid"}, hookAliases: []string{"factory", "droid"}},
{name: "opencode", endpointKind: endpointTargetHook, endpointAliases: []string{"opencode"}, hookAliases: []string{"opencode"}},
+ {name: "cline", endpointKind: endpointTargetHook, endpointAliases: []string{"cline"}, hookAliases: []string{"cline"}},
{name: "grok", endpointKind: endpointTargetHook, endpointAliases: []string{"grok"}, hookAliases: []string{"grok"}},
{name: "hermes", endpointKind: endpointTargetHook, endpointAliases: []string{"hermes", "hermes-agent"}, hookAliases: []string{"hermes", "hermes-agent"}},
{name: "antigravity", endpointKind: endpointTargetHook, endpointAliases: []string{"antigravity", "antigravity-cli"}, hookAliases: []string{"antigravity", "antigravity-cli"}},
diff --git a/cli/beacon/cmd/endpoint_targets_characterization_test.go b/cli/beacon/cmd/endpoint_targets_characterization_test.go
index 431ac6f3..1a320102 100644
--- a/cli/beacon/cmd/endpoint_targets_characterization_test.go
+++ b/cli/beacon/cmd/endpoint_targets_characterization_test.go
@@ -32,6 +32,7 @@ func TestNormalizeEndpointTargetCharacterization(t *testing.T) {
"factory": {"factory", endpointTargetHook, true},
"droid": {"factory", endpointTargetHook, true},
"opencode": {"opencode", endpointTargetHook, true},
+ "cline": {"cline", endpointTargetHook, true},
"grok": {"grok", endpointTargetHook, true},
"hermes": {"hermes", endpointTargetHook, true},
"hermes-agent": {"hermes", endpointTargetHook, true},
@@ -82,6 +83,7 @@ func TestNormalizeHookTargetCharacterization(t *testing.T) {
"factory": {"factory", true},
"droid": {"factory", true},
"opencode": {"opencode", true},
+ "cline": {"cline", true},
"grok": {"grok", true},
"hermes": {"hermes", true},
"hermes-agent": {"hermes", true},