77 "time"
88
99 "github.com/databricks/cli/experimental/aitools/lib/agents"
10+ "github.com/databricks/cli/libs/agent"
1011 "github.com/databricks/cli/libs/cmdio"
1112 "github.com/fatih/color"
1213 "github.com/spf13/cobra"
@@ -29,24 +30,25 @@ func runInstall(ctx context.Context) error {
2930 // Check for non-interactive mode with agent detection
3031 // If running in an AI agent, install automatically without prompts
3132 if ! cmdio .IsPromptSupported (ctx ) {
32- if os .Getenv ("CLAUDECODE" ) != "" {
33+ switch agent .Product (ctx ) {
34+ case agent .ClaudeCode :
3335 if err := agents .InstallClaude (); err != nil {
3436 return err
3537 }
3638 cmdio .LogString (ctx , color .GreenString ("✓ Installed Databricks MCP server for Claude Code" ))
3739 cmdio .LogString (ctx , color .YellowString ("⚠️ Please restart Claude Code for changes to take effect" ))
3840 return nil
39- }
40- if os .Getenv ("CURSOR_AGENT" ) != "" {
41+ case agent .Cursor :
4142 if err := agents .InstallCursor (); err != nil {
4243 return err
4344 }
4445 cmdio .LogString (ctx , color .GreenString ("✓ Installed Databricks MCP server for Cursor" ))
4546 cmdio .LogString (ctx , color .YellowString ("⚠️ Please restart Cursor for changes to take effect" ))
4647 return nil
48+ default :
49+ // Unknown agent in non-interactive mode - show manual instructions
50+ return agents .ShowCustomInstructions (ctx )
4751 }
48- // Unknown agent in non-interactive mode - show manual instructions
49- return agents .ShowCustomInstructions (ctx )
5052 }
5153
5254 cmdio .LogString (ctx , "" )
0 commit comments