Skip to content
Open
Show file tree
Hide file tree
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
23 changes: 12 additions & 11 deletions experimental/ssh/cmd/connect.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,15 @@ import (
func newConnectCommand() *cobra.Command {
cmd := &cobra.Command{
Use: "connect",
Short: "Connect to Databricks compute via SSH",
Long: `Connect to Databricks compute via SSH.
Short: "Connect to your Databricks compute and workspace via SSH",
Long: `Connect to your Databricks compute and workspace via SSH.

This command establishes an SSH connection to Databricks compute, setting up
the SSH server and handling the connection proxy.
Connect to serverless:
databricks ssh connect
databricks ssh connect --accelerator=<GPU_type> # AI Runtime

Connect to a dedicated cluster:
databricks ssh connect --cluster=<cluster-id>

` + disclaimer,
}
Expand All @@ -38,17 +42,14 @@ the SSH server and handling the connection proxy.
var environmentVersion int
var autoApprove bool

cmd.Flags().StringVar(&clusterID, "cluster", "", "Databricks cluster ID (for dedicated clusters)")
cmd.Flags().StringVar(&clusterID, "cluster", "", "Databricks dedicated cluster ID")
cmd.Flags().DurationVar(&shutdownDelay, "shutdown-delay", defaultShutdownDelay, "Delay before shutting down the server after the last client disconnects")
cmd.Flags().IntVar(&maxClients, "max-clients", defaultMaxClients, "Maximum number of SSH clients")
cmd.Flags().BoolVar(&autoStartCluster, "auto-start-cluster", true, "Automatically start the cluster if it is not running")

cmd.Flags().StringVar(&connectionName, "name", "", "Connection name (for serverless compute)")
cmd.Flags().MarkHidden("name")
cmd.Flags().StringVar(&accelerator, "accelerator", "", "GPU accelerator type (GPU_1xA10 or GPU_8xH100)")
cmd.Flags().MarkHidden("accelerator")
cmd.Flags().StringVar(&connectionName, "name", "", "Connection name to reuse across sessions (serverless only)")
cmd.Flags().StringVar(&accelerator, "accelerator", "", "Serverless GPU accelerator type (GPU_1xA10 or GPU_8xH100)")
cmd.Flags().StringVar(&ide, "ide", "", "Open remote IDE window (vscode or cursor)")
cmd.Flags().MarkHidden("ide")

cmd.Flags().BoolVar(&proxyMode, "proxy", false, "ProxyCommand mode")
cmd.Flags().MarkHidden("proxy")
Expand All @@ -69,7 +70,7 @@ the SSH server and handling the connection proxy.
cmd.Flags().BoolVar(&skipSettingsCheck, "skip-settings-check", false, "Skip checking and updating IDE settings")
cmd.Flags().MarkHidden("skip-settings-check")

cmd.Flags().IntVar(&environmentVersion, "environment-version", defaultEnvironmentVersion, "Environment version for serverless compute")
cmd.Flags().IntVar(&environmentVersion, "environment-version", defaultEnvironmentVersion, "Environment version for AI Runtime")
cmd.Flags().MarkHidden("environment-version")

cmd.Flags().BoolVar(&autoApprove, "auto-approve", false, "Skip confirmation prompts, installing IDE extensions and applying IDE settings without asking")
Expand Down
9 changes: 5 additions & 4 deletions experimental/ssh/cmd/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ import (
func newSetupCommand() *cobra.Command {
cmd := &cobra.Command{
Use: "setup",
Short: "Setup SSH configuration for Databricks compute",
Long: `Setup SSH configuration for Databricks compute.
Short: "Setup SSH configuration for dedicated (single-user) clusters",
Long: `Setup SSH configuration for dedicated (single-user) clusters.

This command configures SSH to connect to Databricks compute by adding
an SSH host configuration to your SSH config file.
After running setup, you can connect with ` + "`ssh <name>`" + `.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Placeholder is inconsistent across files: ssh.go uses <connection> (in both the workflow example and --name=<connection>), but here it's <name>. Pick one and use it consistently in both files — <name> keeps the link to the flag name, <connection> reads more conceptually.


For serverless connections, use ` + "`databricks ssh connect`" + ` (no setup step needed).

` + disclaimer,
}
Expand Down
14 changes: 7 additions & 7 deletions experimental/ssh/cmd/ssh.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@ const disclaimer = `WARNING! This is an experimental feature:
func New() *cobra.Command {
cmd := &cobra.Command{
Use: "ssh",
Short: "Connect to Databricks compute with ssh",
Short: "Connect to your Databricks compute and workspace via SSH",
Hidden: true,
Long: `Connect to Databricks compute with ssh.

SSH commands let you setup and establish ssh connections to Databricks compute.
Long: `Connect to your Databricks compute and workspace via SSH.

Common workflows:
databricks ssh connect --cluster=<cluster-id> --profile=<profile-name> # connect to a cluster without any setup
databricks ssh setup --name=my-compute --cluster=<cluster-id> # update local ssh config
ssh my-compute # connect to the compute using ssh client
databricks ssh connect --ide=cursor # connect to serverless through Cursor
databricks ssh setup --name=<name> --cluster=<cluster-id> # update ~/.ssh/config so you can reconnect to a dedicated cluster
ssh <name> # connect to dedicated cluster after setup

Use ` + "`databricks ssh connect --help`" + ` to see all available flags.

` + disclaimer,
}
Expand Down