Skip to content

Commit dfdc2aa

Browse files
feat: add linux support
Signed-off-by: Swarit Pandey <swarit@stepsecurity.io>
1 parent 94231e6 commit dfdc2aa

12 files changed

Lines changed: 532 additions & 49 deletions

File tree

internal/detector/agent.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,19 +106,22 @@ func (d *AgentDetector) getVersion(ctx context.Context, spec agentSpec) string {
106106
func (d *AgentDetector) detectClaudeCowork(ctx context.Context) (model.AITool, bool) {
107107
var claudePath, version string
108108

109-
if d.exec.GOOS() == "windows" {
109+
switch d.exec.GOOS() {
110+
case "windows":
110111
localAppData := d.exec.Getenv("LOCALAPPDATA")
111112
claudePath = filepath.Join(localAppData, "Programs", "Claude")
112113
if !d.exec.DirExists(claudePath) {
113114
return model.AITool{}, false
114115
}
115116
version = readRegistryVersion(ctx, d.exec, "Claude")
116-
} else {
117+
case "darwin":
117118
claudePath = "/Applications/Claude.app"
118119
if !d.exec.DirExists(claudePath) {
119120
return model.AITool{}, false
120121
}
121122
version = readPlistVersion(ctx, d.exec, filepath.Join(claudePath, "Contents", "Info.plist"))
123+
default: // linux — Claude Desktop not yet available
124+
return model.AITool{}, false
122125
}
123126

124127
if version == "unknown" {

internal/detector/framework.go

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,19 +90,35 @@ func (d *FrameworkDetector) getVersion(ctx context.Context, binaryPath string) s
9090
func (d *FrameworkDetector) detectLMStudioApp(ctx context.Context) (model.AITool, bool) {
9191
var appPath, version string
9292

93-
if d.exec.GOOS() == "windows" {
93+
switch d.exec.GOOS() {
94+
case "windows":
9495
localAppData := d.exec.Getenv("LOCALAPPDATA")
9596
appPath = filepath.Join(localAppData, "Programs", "LM Studio")
9697
if !d.exec.DirExists(appPath) {
9798
return model.AITool{}, false
9899
}
99100
version = readRegistryVersion(ctx, d.exec, "LM Studio")
100-
} else {
101+
case "darwin":
101102
appPath = "/Applications/LM Studio.app"
102103
if !d.exec.DirExists(appPath) {
103104
return model.AITool{}, false
104105
}
105106
version = readPlistVersion(ctx, d.exec, filepath.Join(appPath, "Contents", "Info.plist"))
107+
default: // linux — check common install locations
108+
homeDir := getHomeDir(d.exec)
109+
for _, candidate := range []string{
110+
filepath.Join(homeDir, ".local", "share", "LM Studio"),
111+
"/opt/lm-studio",
112+
} {
113+
if d.exec.DirExists(candidate) {
114+
appPath = candidate
115+
break
116+
}
117+
}
118+
if appPath == "" {
119+
return model.AITool{}, false
120+
}
121+
version = "unknown"
106122
}
107123

108124
running := isProcessRunningFuzzy(ctx, d.exec, "LM Studio")

0 commit comments

Comments
 (0)