databricks-cli/cmd
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
..
account Hide commands under preview from help output (#469) 2023-06-14 14:59:57 +00:00
api Rename bricks -> databricks (#389) 2023-05-16 18:35:39 +02:00
auth Do not use FgWhite and FgBlack for terminal output (#435) 2023-06-05 17:30:40 +02:00
bundle Update short name for bundle command (#476) 2023-06-14 22:44:18 +02:00
configure Update configure command (#482) 2023-06-15 12:50:19 +00:00
fs Add fs mkdirs command for dbfs (#432) 2023-06-12 14:05:56 +02:00
root Tweak profile prompt (#454) 2023-06-09 13:56:35 +02:00
sync Added support for bundle.Seq, simplified Mutator.Apply interface (#403) 2023-05-24 14:45:19 +02:00
version Use cmdio in version command for `--output` flag (#419) 2023-06-01 12:03:22 +02:00
workspace Bump SDK to latest (#473) 2023-06-14 18:27:29 +00:00