Databricks CLI
Go to file
Pieter Noordhuis b9406efd27
Update configure command (#482)
## Changes

This now uses:
* libs/cmdio to determine interactivity and perform prompting
* libs/databrickscfg to persist the profile

It loads a config.Config structure from the environment just like we do
for unified authentication. It is therefore possible to specify both the
host and token with environment variables.

## Tests

```
pieter.noordhuis@L4GHXDT29P /tmp % export DATABRICKS_CONFIG_FILE=.databrickscfg
pieter.noordhuis@L4GHXDT29P /tmp % databricks configure
Databricks Host: https://foo.bar
Personal Access Token: *****
pieter.noordhuis@L4GHXDT29P /tmp % cat .databrickscfg
[DEFAULT]
host  = https://foo.bar
token = token
pieter.noordhuis@L4GHXDT29P /tmp % echo token | databricks configure
Error: host must be set in non-interactive mode
pieter.noordhuis@L4GHXDT29P /tmp % echo token | databricks configure --host foo
Error: must start with https://
pieter.noordhuis@L4GHXDT29P /tmp % echo token | databricks configure --host https://foo
pieter.noordhuis@L4GHXDT29P /tmp % cat .databrickscfg
[DEFAULT]
host  = https://foo
token = token
pieter.noordhuis@L4GHXDT29P /tmp % cat .databrickscfg
pieter.noordhuis@L4GHXDT29P /tmp % databricks configure --host https://foo
Personal Access Token: ******
pieter.noordhuis@L4GHXDT29P /tmp % cat .databrickscfg
[DEFAULT]
host  = https://foo
token = token2
```
2023-06-15 12:50:19 +00:00
.codegen Hide commands under preview from help output (#469) 2023-06-14 14:59:57 +00:00
.github Rename bricks -> databricks (#389) 2023-05-16 18:35:39 +02:00
.vscode Rename bricks -> databricks (#389) 2023-05-16 18:35:39 +02:00
bundle Pass through proxy related environment variables (#465) 2023-06-14 21:58:26 +02:00
cmd Update configure command (#482) 2023-06-15 12:50:19 +00:00
docs Rename bricks -> databricks (#389) 2023-05-16 18:35:39 +02:00
folders Don't depend on working directory in folders.FindDirWithLeaf (#54) 2022-09-14 15:08:55 +02:00
internal Fix deprecation notice for io/ioutil (#477) 2023-06-15 10:38:30 +00:00
libs Update configure command (#482) 2023-06-15 12:50:19 +00:00
python Update setup.py (#397) 2023-05-23 11:39:57 +02:00
.codegen.json Added OpenAPI command coverage (#357) 2023-04-26 13:06:16 +02:00
.gitattributes Update with the latest Go SDK (#457) 2023-06-12 14:23:21 +02:00
.gitignore Rename bricks -> databricks (#389) 2023-05-16 18:35:39 +02:00
.goreleaser.yaml Rename bricks -> databricks (#389) 2023-05-16 18:35:39 +02:00
CHANGELOG.md Release v0.100.3 (#461) 2023-06-12 17:08:00 +02:00
LICENSE Create LICENSE (#467) 2023-06-14 14:38:52 +00:00
Makefile goreleaser deprecated --rm-dist in favor of --clean (#349) 2023-04-20 11:59:34 +02:00
NOTICE Create NOTICE (#468) 2023-06-14 20:05:08 +02:00
README.md Add installation instructions (#458) 2023-06-12 16:31:22 +02:00
go.mod Bump SDK to latest (#473) 2023-06-14 18:27:29 +00:00
go.sum Bump SDK to latest (#473) 2023-06-14 18:27:29 +00:00
main.go Rename bricks -> databricks (#389) 2023-05-16 18:35:39 +02:00
main_test.go Rename bricks -> databricks (#389) 2023-05-16 18:35:39 +02:00

README.md

Databricks CLI

build

This project is in private preview.

Documentation about the full REST API coverage is avaialbe in the docs folder.

Documentation is available at https://docs.databricks.com/dev-tools/cli/databricks-cli.html.

Installation

This CLI is packaged as a dependency-free binary executable and may be located in any directory. See https://github.com/databricks/cli/releases for releases and the docs pages for installation instructions.

Authentication

This CLI follows the Databricks Unified Authentication principles.

You can find a detailed description at https://github.com/databricks/databricks-sdk-go#authentication.