cli

package
v0.19.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 11, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package cli provides helpers for locating the Databricks CLI binary.

Index

Constants

This section is empty.

Variables

View Source
var FallbackCLIDirs = []string{
	"/usr/local/bin",
	"/opt/homebrew/bin",
	"/opt/homebrew/sbin",
	".local/bin",
	"go/bin",
	"bin",
}

FallbackCLIDirs lists install locations to probe when the CLI binary is not on PATH. Order matters: most-likely first. GUI-launched subprocesses (e.g. Claude Desktop invoking the credential helper) inherit launchd's minimal PATH (/usr/bin:/bin:/usr/sbin:/sbin), which omits all of these.

Functions

func IsExecutableFile

func IsExecutableFile(path string) bool

IsExecutableFile reports whether path refers to an executable file.

func ResolveDatabricksCLI

func ResolveDatabricksCLI(cmdName string) string

ResolveDatabricksCLI returns an executable path for cmdName. Lookup order:

  1. Absolute or path-qualified cmdName → returned unchanged (back-compat for tests).
  2. $DATABRICKS_CLI env override, if set and executable.
  3. exec.LookPath(cmdName), which honors the inherited PATH.
  4. A scan of common install dirs (FallbackCLIDirs).

If none match, cmdName is returned unchanged so the eventual exec error surfaces with its original message.

Types

This section is empty.