Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
4093a5a
Add experimental workspace open command
simonfaltum Mar 12, 2026
db5bf27
Fix review findings: URL patterns, fragment handling, workspace ID
simonfaltum Mar 13, 2026
edf1682
Fix BROWSER contract and workspace ID detection
simonfaltum Mar 13, 2026
25e54ee
Use plural resource types and add --url flag
simonfaltum Mar 13, 2026
c514e85
Add experiments resource type
simonfaltum Mar 13, 2026
59d2959
Share workspace URL helpers between experimental and bundle open
simonfaltum Mar 13, 2026
c5ae950
Revert bundle initialize_urls changes to avoid URL output regression
simonfaltum Mar 13, 2026
d2d9e60
Handle multi-argument BROWSER and warn on workspace ID lookup failure
simonfaltum Mar 13, 2026
e14c23c
Address review: remove redundant check, add all resource types, add a…
simonfaltum Mar 13, 2026
d773fff
Fix registered_models URL, quoted BROWSER env, and BROWSER=none message
simonfaltum Mar 13, 2026
14ba838
Merge remote-tracking branch 'origin/main' into simonfaltum/workspace…
simonfaltum Mar 13, 2026
2b76247
Merge branch 'main' into simonfaltum/workspace-open
simonfaltum Mar 14, 2026
11e37be
Fix browser command execution on Windows by using shell
simonfaltum Mar 15, 2026
f9e6129
Fix auth login timeout on Windows by not inheriting stdin in browser …
simonfaltum Mar 15, 2026
be8948d
Revert libs/browser: use existing exec-based browser patterns
simonfaltum Mar 15, 2026
43727e8
Add dedicated unit tests for libs/workspaceurls package
simonfaltum Mar 16, 2026
20af4ed
Merge branch 'main' into simonfaltum/workspace-open
simonfaltum Mar 22, 2026
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
9 changes: 9 additions & 0 deletions acceptance/experimental/open/out.test.toml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 32 additions & 0 deletions acceptance/experimental/open/output.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@

=== print URL for a job
>>> [CLI] experimental open --url jobs 123
[DATABRICKS_URL]/jobs/123?o=[NUMID]

=== print URL for a notebook
>>> [CLI] experimental open --url notebooks 12345
[DATABRICKS_URL]/?o=[NUMID]#notebook/12345

=== unknown resource type
>>> [CLI] experimental open --url unknown 123
Error: unknown resource type "unknown", must be one of: alerts, apps, clusters, dashboards, experiments, jobs, model_serving_endpoints, models, notebooks, pipelines, queries, registered_models, warehouses

Exit code: 1

=== test auto-completion handler
>>> [CLI] __complete experimental open ,
alerts
apps
clusters
dashboards
experiments
jobs
model_serving_endpoints
models
notebooks
pipelines
queries
registered_models
warehouses
:4
Completion ended with directive: ShellCompDirectiveNoFileComp
11 changes: 11 additions & 0 deletions acceptance/experimental/open/script
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
title "print URL for a job"
trace $CLI experimental open --url jobs 123

title "print URL for a notebook"
trace $CLI experimental open --url notebooks 12345

title "unknown resource type"
errcode trace $CLI experimental open --url unknown 123

title "test auto-completion handler"
trace $CLI __complete experimental open ,
5 changes: 5 additions & 0 deletions acceptance/experimental/open/test.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
GOOS.windows = false
GOOS.linux = false

# No bundle engine needed for this command.
[EnvMatrix]
4 changes: 2 additions & 2 deletions bundle/config/resources/alerts.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"net/url"

"github.com/databricks/cli/libs/log"
"github.com/databricks/cli/libs/workspaceurls"
"github.com/databricks/databricks-sdk-go"
"github.com/databricks/databricks-sdk-go/marshal"
"github.com/databricks/databricks-sdk-go/service/sql"
Expand Down Expand Up @@ -52,8 +53,7 @@ func (a *Alert) InitializeURL(baseURL url.URL) {
if a.ID == "" {
return
}
baseURL.Path = "sql/alerts-v2/" + a.ID
a.URL = baseURL.String()
a.URL = workspaceurls.ResourceURL(baseURL, workspaceurls.AlertPattern, a.ID)
}

func (a *Alert) GetName() string {
Expand Down
4 changes: 2 additions & 2 deletions bundle/config/resources/apps.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"net/url"

"github.com/databricks/cli/libs/log"
"github.com/databricks/cli/libs/workspaceurls"
"github.com/databricks/databricks-sdk-go"
"github.com/databricks/databricks-sdk-go/marshal"
"github.com/databricks/databricks-sdk-go/service/apps"
Expand Down Expand Up @@ -83,8 +84,7 @@ func (a *App) InitializeURL(baseURL url.URL) {
if a.ModifiedStatus == "" || a.ModifiedStatus == ModifiedStatusCreated {
return
}
baseURL.Path = "apps/" + a.GetName()
a.URL = baseURL.String()
a.URL = workspaceurls.ResourceURL(baseURL, workspaceurls.AppPattern, a.GetName())
}

func (a *App) GetName() string {
Expand Down
4 changes: 2 additions & 2 deletions bundle/config/resources/clusters.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"net/url"

"github.com/databricks/cli/libs/log"
"github.com/databricks/cli/libs/workspaceurls"
"github.com/databricks/databricks-sdk-go"
"github.com/databricks/databricks-sdk-go/marshal"
"github.com/databricks/databricks-sdk-go/service/compute"
Expand Down Expand Up @@ -47,8 +48,7 @@ func (s *Cluster) InitializeURL(baseURL url.URL) {
if s.ID == "" {
return
}
baseURL.Path = "compute/clusters/" + s.ID
s.URL = baseURL.String()
s.URL = workspaceurls.ResourceURL(baseURL, workspaceurls.ClusterPattern, s.ID)
}

func (s *Cluster) GetName() string {
Expand Down
5 changes: 2 additions & 3 deletions bundle/config/resources/dashboard.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ package resources

import (
"context"
"fmt"
"net/url"

"github.com/databricks/cli/libs/log"
"github.com/databricks/cli/libs/workspaceurls"
"github.com/databricks/databricks-sdk-go"
"github.com/databricks/databricks-sdk-go/marshal"
"github.com/databricks/databricks-sdk-go/service/dashboards"
Expand Down Expand Up @@ -114,8 +114,7 @@ func (r *Dashboard) InitializeURL(baseURL url.URL) {
return
}

baseURL.Path = fmt.Sprintf("dashboardsv3/%s/published", r.ID)
r.URL = baseURL.String()
r.URL = workspaceurls.ResourceURL(baseURL, workspaceurls.DashboardPattern, r.ID)
}

func (r *Dashboard) GetName() string {
Expand Down
4 changes: 2 additions & 2 deletions bundle/config/resources/job.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"strconv"

"github.com/databricks/cli/libs/log"
"github.com/databricks/cli/libs/workspaceurls"
"github.com/databricks/databricks-sdk-go"
"github.com/databricks/databricks-sdk-go/marshal"
"github.com/databricks/databricks-sdk-go/service/jobs"
Expand Down Expand Up @@ -54,8 +55,7 @@ func (j *Job) InitializeURL(baseURL url.URL) {
if j.ID == "" {
return
}
baseURL.Path = "jobs/" + j.ID
j.URL = baseURL.String()
j.URL = workspaceurls.ResourceURL(baseURL, workspaceurls.JobPattern, j.ID)
}

func (j *Job) GetName() string {
Expand Down
4 changes: 2 additions & 2 deletions bundle/config/resources/mlflow_experiment.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"net/url"

"github.com/databricks/cli/libs/log"
"github.com/databricks/cli/libs/workspaceurls"
"github.com/databricks/databricks-sdk-go"
"github.com/databricks/databricks-sdk-go/marshal"
"github.com/databricks/databricks-sdk-go/service/ml"
Expand Down Expand Up @@ -49,8 +50,7 @@ func (s *MlflowExperiment) InitializeURL(baseURL url.URL) {
if s.ID == "" {
return
}
baseURL.Path = "ml/experiments/" + s.ID
s.URL = baseURL.String()
s.URL = workspaceurls.ResourceURL(baseURL, workspaceurls.ExperimentPattern, s.ID)
}

func (s *MlflowExperiment) GetName() string {
Expand Down
4 changes: 2 additions & 2 deletions bundle/config/resources/mlflow_model.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"net/url"

"github.com/databricks/cli/libs/log"
"github.com/databricks/cli/libs/workspaceurls"
"github.com/databricks/databricks-sdk-go"
"github.com/databricks/databricks-sdk-go/marshal"
"github.com/databricks/databricks-sdk-go/service/ml"
Expand Down Expand Up @@ -49,8 +50,7 @@ func (s *MlflowModel) InitializeURL(baseURL url.URL) {
if s.ID == "" {
return
}
baseURL.Path = "ml/models/" + s.ID
s.URL = baseURL.String()
s.URL = workspaceurls.ResourceURL(baseURL, workspaceurls.ModelPattern, s.ID)
}

func (s *MlflowModel) GetName() string {
Expand Down
4 changes: 2 additions & 2 deletions bundle/config/resources/model_serving_endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"net/url"

"github.com/databricks/cli/libs/log"
"github.com/databricks/cli/libs/workspaceurls"
"github.com/databricks/databricks-sdk-go"
"github.com/databricks/databricks-sdk-go/marshal"
"github.com/databricks/databricks-sdk-go/service/serving"
Expand Down Expand Up @@ -54,8 +55,7 @@ func (s *ModelServingEndpoint) InitializeURL(baseURL url.URL) {
if s.ID == "" {
return
}
baseURL.Path = "ml/endpoints/" + s.ID
s.URL = baseURL.String()
s.URL = workspaceurls.ResourceURL(baseURL, workspaceurls.ModelServingEndpointPattern, s.ID)
}

func (s *ModelServingEndpoint) GetName() string {
Expand Down
4 changes: 2 additions & 2 deletions bundle/config/resources/pipeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"net/url"

"github.com/databricks/cli/libs/log"
"github.com/databricks/cli/libs/workspaceurls"
"github.com/databricks/databricks-sdk-go"
"github.com/databricks/databricks-sdk-go/marshal"
"github.com/databricks/databricks-sdk-go/service/pipelines"
Expand Down Expand Up @@ -49,8 +50,7 @@ func (p *Pipeline) InitializeURL(baseURL url.URL) {
if p.ID == "" {
return
}
baseURL.Path = "pipelines/" + p.ID
p.URL = baseURL.String()
p.URL = workspaceurls.ResourceURL(baseURL, workspaceurls.PipelinePattern, p.ID)
}

func (p *Pipeline) GetName() string {
Expand Down
8 changes: 6 additions & 2 deletions bundle/config/resources/registered_model.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"strings"

"github.com/databricks/cli/libs/log"
"github.com/databricks/cli/libs/workspaceurls"
"github.com/databricks/databricks-sdk-go"
"github.com/databricks/databricks-sdk-go/marshal"
"github.com/databricks/databricks-sdk-go/service/catalog"
Expand Down Expand Up @@ -54,8 +55,11 @@ func (s *RegisteredModel) InitializeURL(baseURL url.URL) {
if s.ID == "" {
return
}
baseURL.Path = "explore/data/models/" + strings.ReplaceAll(s.ID, ".", "/")
s.URL = baseURL.String()
s.URL = workspaceurls.ResourceURL(
baseURL,
workspaceurls.RegisteredModelPattern,
strings.ReplaceAll(s.ID, ".", "/"),
)
}

func (s *RegisteredModel) GetName() string {
Expand Down
4 changes: 2 additions & 2 deletions bundle/config/resources/sql_warehouses.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"net/url"

"github.com/databricks/cli/libs/log"
"github.com/databricks/cli/libs/workspaceurls"
"github.com/databricks/databricks-sdk-go"
"github.com/databricks/databricks-sdk-go/marshal"
"github.com/databricks/databricks-sdk-go/service/sql"
Expand Down Expand Up @@ -47,8 +48,7 @@ func (sw *SqlWarehouse) InitializeURL(baseURL url.URL) {
if sw.ID == "" {
return
}
baseURL.Path = "sql/warehouses/" + sw.ID
sw.URL = baseURL.String()
sw.URL = workspaceurls.ResourceURL(baseURL, workspaceurls.WarehousePattern, sw.ID)
}

func (sw *SqlWarehouse) GetName() string {
Expand Down
1 change: 1 addition & 0 deletions cmd/experimental/experimental.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ development. They may change or be removed in future versions without notice.`,
}

cmd.AddCommand(aitoolscmd.NewAitoolsCmd())
cmd.AddCommand(newWorkspaceOpenCommand())

return cmd
}
Loading
Loading