Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions experimental/aitools/cmd/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"time"

"github.com/databricks/cli/experimental/aitools/lib/agents"
"github.com/databricks/cli/libs/agent"
"github.com/databricks/cli/libs/cmdio"
"github.com/fatih/color"
"github.com/spf13/cobra"
Expand All @@ -29,24 +30,25 @@ func runInstall(ctx context.Context) error {
// Check for non-interactive mode with agent detection
// If running in an AI agent, install automatically without prompts
if !cmdio.IsPromptSupported(ctx) {
if os.Getenv("CLAUDECODE") != "" {
switch agent.Product(ctx) {
case agent.ClaudeCode:
if err := agents.InstallClaude(); err != nil {
return err
}
cmdio.LogString(ctx, color.GreenString("✓ Installed Databricks MCP server for Claude Code"))
cmdio.LogString(ctx, color.YellowString("⚠️ Please restart Claude Code for changes to take effect"))
return nil
}
if os.Getenv("CURSOR_AGENT") != "" {
case agent.Cursor:
if err := agents.InstallCursor(); err != nil {
return err
}
cmdio.LogString(ctx, color.GreenString("✓ Installed Databricks MCP server for Cursor"))
cmdio.LogString(ctx, color.YellowString("⚠️ Please restart Cursor for changes to take effect"))
return nil
default:
// Unknown agent in non-interactive mode - show manual instructions
return agents.ShowCustomInstructions(ctx)
}
// Unknown agent in non-interactive mode - show manual instructions
return agents.ShowCustomInstructions(ctx)
}

cmdio.LogString(ctx, "")
Expand Down