Skip to content

Commit c89f49a

Browse files
authored
Add support for Zed client (#2836)
Fix #2835
1 parent 0dc40b7 commit c89f49a

File tree

8 files changed

+39
-9
lines changed

8 files changed

+39
-9
lines changed

cmd/thv/app/client.go

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ Valid clients:
6666
- vscode: Visual Studio Code (GitHub Copilot)
6767
- vscode-insider: Visual Studio Code Insiders edition
6868
- windsurf: Windsurf IDE
69-
- windsurf-jetbrains: Windsurf for JetBrains IDEs`,
69+
- windsurf-jetbrains: Windsurf for JetBrains IDEs
70+
- zed: Zed editor`,
7071
Args: cobra.ExactArgs(1),
7172
RunE: clientRegisterCmdFunc,
7273
}
@@ -96,7 +97,8 @@ Valid clients:
9697
- vscode: Visual Studio Code (GitHub Copilot)
9798
- vscode-insider: Visual Studio Code Insiders edition
9899
- windsurf: Windsurf IDE
99-
- windsurf-jetbrains: Windsurf for JetBrains IDEs`,
100+
- windsurf-jetbrains: Windsurf for JetBrains IDEs
101+
- zed: Zed editor`,
100102
Args: cobra.ExactArgs(1),
101103
RunE: clientRemoveCmdFunc,
102104
}
@@ -204,13 +206,13 @@ func clientRegisterCmdFunc(cmd *cobra.Command, args []string) error {
204206
switch clientType {
205207
case "roo-code", "cline", "cursor", "claude-code", "vscode-insider", "vscode", "windsurf", "windsurf-jetbrains",
206208
"amp-cli", "amp-vscode", "amp-vscode-insider", "amp-cursor", "amp-windsurf", "lm-studio", "goose", "trae",
207-
"continue", "opencode", "kiro", "antigravity":
209+
"continue", "opencode", "kiro", "antigravity", "zed":
208210
// Valid client type
209211
default:
210212
return fmt.Errorf(
211213
"invalid client type: %s (valid types: roo-code, cline, cursor, claude-code, vscode, vscode-insider, "+
212214
"windsurf, windsurf-jetbrains, amp-cli, amp-vscode, amp-vscode-insider, amp-cursor, amp-windsurf, lm-studio, "+
213-
"goose, trae, continue, opencode, kiro, antigravity)",
215+
"goose, trae, continue, opencode, kiro, antigravity, zed)",
214216
clientType)
215217
}
216218

@@ -224,13 +226,13 @@ func clientRemoveCmdFunc(cmd *cobra.Command, args []string) error {
224226
switch clientType {
225227
case "roo-code", "cline", "cursor", "claude-code", "vscode-insider", "vscode", "windsurf", "windsurf-jetbrains",
226228
"amp-cli", "amp-vscode", "amp-vscode-insider", "amp-cursor", "amp-windsurf", "lm-studio", "goose", "trae",
227-
"continue", "opencode", "kiro", "antigravity":
229+
"continue", "opencode", "kiro", "antigravity", "zed":
228230
// Valid client type
229231
default:
230232
return fmt.Errorf(
231233
"invalid client type: %s (valid types: roo-code, cline, cursor, claude-code, vscode, vscode-insider, "+
232234
"windsurf, windsurf-jetbrains, amp-cli, amp-vscode, amp-vscode-insider, amp-cursor, amp-windsurf, lm-studio, "+
233-
"goose, trae, continue, opencode, kiro, antigravity)",
235+
"goose, trae, continue, opencode, kiro, antigravity, zed)",
234236
clientType)
235237
}
236238

docs/cli/thv_client_register.md

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/cli/thv_client_remove.md

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/server/docs.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/server/swagger.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/server/swagger.yaml

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/client/config.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ const (
6565
Kiro MCPClient = "kiro"
6666
// Antigravity represents the Google Antigravity IDE.
6767
Antigravity MCPClient = "antigravity"
68+
// Zed represents the Zed editor.
69+
Zed MCPClient = "zed"
6870
)
6971

7072
// Extension is extension of the client config file.
@@ -474,6 +476,21 @@ var supportedClientIntegrations = []mcpClientConfig{
474476
IsTransportTypeFieldSupported: false,
475477
MCPServersUrlLabel: "serverUrl",
476478
},
479+
{
480+
ClientType: Zed,
481+
Description: "Zed editor",
482+
SettingsFile: "settings.json",
483+
MCPServersPathPrefix: "/context_servers",
484+
RelPath: []string{"zed"},
485+
PlatformPrefix: map[string][]string{
486+
"linux": {".config"},
487+
"darwin": {".config"},
488+
"windows": {"AppData", "Roaming"},
489+
},
490+
Extension: JSON,
491+
IsTransportTypeFieldSupported: false,
492+
MCPServersUrlLabel: "url",
493+
},
477494
}
478495

479496
// ConfigFile represents a client configuration file

pkg/client/config_test.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,7 @@ func TestSuccessfulClientConfigOperations(t *testing.T) {
352352
string(OpenCode),
353353
string(Kiro),
354354
string(Antigravity),
355+
string(Zed),
355356
},
356357
},
357358
}
@@ -445,6 +446,9 @@ func TestSuccessfulClientConfigOperations(t *testing.T) {
445446
case OpenCode:
446447
assert.Contains(t, string(content), `"mcp":`,
447448
"OpenCode config should contain mcp key")
449+
case Zed:
450+
assert.Contains(t, string(content), `"context_servers":`,
451+
"Zed config should contain context_servers key")
448452
case Goose:
449453
// YAML files are created empty and initialized on first use
450454
// Just verify the file exists and is readable
@@ -486,7 +490,7 @@ func TestSuccessfulClientConfigOperations(t *testing.T) {
486490
assert.Contains(t, string(content), testURL,
487491
"VSCode config should contain the server URL")
488492
case Cursor, RooCode, ClaudeCode, Cline, Windsurf, WindsurfJetBrains, AmpCli,
489-
AmpVSCode, AmpCursor, AmpVSCodeInsider, AmpWindsurf, LMStudio, Goose, Trae, Continue, OpenCode, Kiro, Antigravity:
493+
AmpVSCode, AmpCursor, AmpVSCodeInsider, AmpWindsurf, LMStudio, Goose, Trae, Continue, OpenCode, Kiro, Antigravity, Zed:
490494
assert.Contains(t, string(content), testURL,
491495
"Config should contain the server URL")
492496
}

0 commit comments

Comments
 (0)