Description
**Note** **Databricks recommends that you use newer Databricks CLI versions 0.200 and above instead of legacy Databricks CLI versions 0.17 and below (located in this repository). You can find the new CLI at https://github.com/databricks/cli.** **If you have been using the code in this repository as a Python SDK for interacting with the Databricks APIs, we recommend you use the new dedicated SDK package that can be found at https://github.com/databricks/databricks-sdk-py.** databricks-cli ============== .. image:: https://github.com/databricks/databricks-cli/actions/workflows/push.yml/badge.svg?branch=main :target: https://github.com/databricks/databricks-cli/actions/workflows/push.yml?query=branch%main :alt: Build status .. image:: https://codecov.io/gh/databricks/databricks-cli/branch/main/graph/badge.svg :target: https://codecov.io/gh/databricks/databricks-cli The Databricks Command Line Interface (CLI) is an open source tool which provides an easy to use interface to the Databricks platform. The CLI is built on top of the Databricks REST APIs. **Note**: This CLI is no longer under active development and has been released as an experimental client. Please leave bug reports as issues on our `GitHub project <https://github.com/databricks/databricks-cli>`_. Requirements ------------ - Python Version >= 3.7 Installation --------------- To install simply run ``pip install --upgrade databricks-cli`` Then set up authentication using username/password or `authentication token <https://docs.databricks.com/api/latest/authentication.html#token-management>`_. Credentials are stored at ``~/.databrickscfg``. - ``databricks configure`` (enter hostname/username/password at prompt) - ``databricks configure --token`` (enter hostname/auth-token at prompt) Multiple connection profiles are also supported with ``databricks configure --profile <profile> [--token]``. The connection profile can be used as such: ``databricks workspace ls --profile <profile>``. To test that your authentication information is working, try a quick test like ``databricks workspace ls``. Known Issues --------------- ``AttributeError: 'module' object has no attribute 'PROTOCOL_TLSv1_2'`` The Databricks web service requires clients speak TLSV1.2. The built in version of Python for MacOS does not have this version of TLS built in. To use the Databricks CLI you must install a version of Python that has ``ssl.PROTOCOL_TLSv1_2``. For MacOS, the easiest way may be to install Python with `Homebrew <https://brew.sh/>`_. Using Docker ------------ .. code:: # build image docker build -t databricks-cli . # run container docker run -it databricks-cli # run command in docker docker run -it databricks-cli fs --help Documentation ------------- For the latest CLI documentation, see - `Databricks <https://docs.databricks.com/user-guide/dev-tools/databricks-cli.html>`_ - `Azure Databricks <https://learn.microsoft.com/en-us/azure/databricks/dev-tools/cli>`_
Release History
| Version | Changes | Urgency | Date |
|---|---|---|---|
| 0.18.0 | Imported from PyPI (0.18.0) | Low | 4/21/2026 |
| 0.17.8 | ## What's Changed * Include link to new CLI in README by @pietern in https://github.com/databricks/databricks-cli/pull/660 * Add trampoline into newer CLI versions if found in $PATH by @pietern in https://github.com/databricks/databricks-cli/pull/650 **Full Changelog**: https://github.com/databricks/databricks-cli/compare/0.17.7...0.17.8 | Low | 9/21/2023 |
| 0.17.7 | ## What's Changed * Fix api client by switching to replacements for deprecated urllib3 methods by @shreyas-goenka in https://github.com/databricks/databricks-cli/pull/637 * Integration for configuring workspace bindings by @willwwt in https://github.com/databricks/databricks-cli/pull/628 * Add add-schema, update-schema, and remove-schema to Delta Sharing CLI by @andyl-db in https://github.com/databricks/databricks-cli/pull/608 ## New Contributors * @willwwt made their first contribution i | Low | 5/8/2023 |
| 0.17.6 | ## What's Changed * Add missing fields to JobsService by @pietern in https://github.com/databricks/databricks-cli/pull/614 **Full Changelog**: https://github.com/databricks/databricks-cli/compare/0.17.5...0.17.6 | Low | 3/22/2023 |
| 0.17.5 | ## What's Changed * Make use of the new name filtering in calls to list jobs. by @dinowernli in https://github.com/databricks/databricks-cli/pull/595 ## New Contributors * @dinowernli made their first contribution in https://github.com/databricks/databricks-cli/pull/595 **Full Changelog**: https://github.com/databricks/databricks-cli/compare/0.17.4...0.17.5 | Low | 3/10/2023 |
| 0.17.4 | ## What's Changed * Fix bug that disallowed JSON flags in unity-catalog recipients update command by @wchau in https://github.com/databricks/databricks-cli/pull/549 * Replace legacy start API in favor of updates API for DLT pipelines by @pradeepgv-db in https://github.com/databricks/databricks-cli/pull/553 * Add more configurable flags for UC metastore, external locations, and storage credentials. by @wchau in https://github.com/databricks/databricks-cli/pull/562 * Accept JSON policy object | Low | 12/8/2022 |
| 0.17.3 | ## What's Changed * Skip information_schema when purging catalog by @adamcain-db in https://github.com/databricks/databricks-cli/pull/539 * Add optional region arg to "unity-catalog metastores create" by @andrewli81 in https://github.com/databricks/databricks-cli/pull/547 ## New Contributors * @andrewli81 made their first contribution in https://github.com/databricks/databricks-cli/pull/547 **Full Changelog**: https://github.com/databricks/databricks-cli/compare/0.17.2...0.17.3 | Low | 8/26/2022 |
| 0.17.2 | ## What's Changed * Don't let .netrc take precedence in ApiClient by @kartikgupta-db in https://github.com/databricks/databricks-cli/pull/526 * Add support for dbt tasks by @kzidane in https://github.com/databricks/databricks-cli/pull/520 * Add access_control_list parameter to JobsService by @pietern in https://github.com/databricks/databricks-cli/pull/540 * Add cancel_all_runs function to JobsService by @pietern in https://github.com/databricks/databricks-cli/pull/542 * Add update_job func | Low | 8/19/2022 |
| 0.17.1 | ## What's Changed * OAuth: properly handle trailing "/" in hostname by @fjakobs in https://github.com/databricks/databricks-cli/pull/497 * Use 2.1 API version for UC paths by @adamcain-db in https://github.com/databricks/databricks-cli/pull/498 * Fix external-location 'lists' command by @adamcain-db in https://github.com/databricks/databricks-cli/pull/503 * Updated Delta Pipelines to match API PipelineSettings definition by @stawo in https://github.com/databricks/databricks-cli/pull/501 * a | Low | 8/12/2022 |
| 0.17.0 | ## What's Changed * Add Unity Catalog support by @adamcain-db in https://github.com/databricks/databricks-cli/pull/471 * Add --wait option to databricks runs submit CLI command by @jerrylian-db in https://github.com/databricks/databricks-cli/pull/487 ## New Contributors * @jerrylian-db made their first contribution in https://github.com/databricks/databricks-cli/pull/487 **Full Changelog**: https://github.com/databricks/databricks-cli/compare/0.16.8...0.17.0 | Low | 6/17/2022 |
| 0.16.8 | ## What's Changed * Fix repo creation if provider is specified @pietern in https://github.com/databricks/databricks-cli/pull/480 **Full Changelog**: https://github.com/databricks/databricks-cli/compare/0.16.7...0.16.8 | Low | 6/15/2022 |
| 0.16.7 | ## What's Changed * For pipelines, deprecate deploy in favor of create and edit by @pradeepgv-db in https://github.com/databricks/databricks-cli/pull/437 * Improving OAuth error messages by @sweisdb in https://github.com/databricks/databricks-cli/pull/453 * Better error handling in repos by @alexott in https://github.com/databricks/databricks-cli/pull/428 * Fix exports from Workspace to Windows FS by @stormwindy in https://github.com/databricks/databricks-cli/pull/448 * Corrects help text f | Low | 6/10/2022 |
| 0.16.6 | ## What's Changed * Increase base PyJWT version to 1.7.0 by @stormwindy in https://github.com/databricks/databricks-cli/pull/445 **Full Changelog**: https://github.com/databricks/databricks-cli/compare/0.16.5...0.16.6 | Low | 4/1/2022 |
| 0.16.5 | ## What's Changed * Fix typo in help for import/export commands by @alexott in https://github.com/databricks/databricks-cli/pull/433 * Deprecate "run/reset" commands in favor of start which uses StartUpdate endpoint by @pradeepgv-db in https://github.com/databricks/databricks-cli/pull/420 * Add version option to runs by @nordp in https://github.com/databricks/databricks-cli/pull/434 * Add idempotency-token to run-now in runs cli and api by @nordp in https://github.com/databricks/databricks-c | Low | 3/31/2022 |
| 0.16.4 | ## What's Changed * [Jobs] Make python_named_parameters optional in jobs.api.run_now by @nordp in https://github.com/databricks/databricks-cli/pull/429 **Full Changelog**: https://github.com/databricks/databricks-cli/compare/0.16.3...0.16.4 | Low | 2/4/2022 |
| 0.16.3 | ## What's Changed * [Jobs] Fix link for Jobs CLI warning by @lucasterra-db in https://github.com/databricks/databricks-cli/pull/401 * Add secure tunneling command to cli by @deka108 in https://github.com/databricks/databricks-cli/pull/402 * Fix pipelines list pagination by @dylanstee-db in https://github.com/databricks/databricks-cli/pull/417 * Pin pylint-django to avoid py2 issue by @jaipreet-s in https://github.com/databricks/databricks-cli/pull/419 * Move tunneling CLI changes from maste | Low | 2/3/2022 |
| 0.16.2 | ## What's Changed * Make jobs_api_version optional in DatabricksConfig which previously could break codepaths for not having this newly added parameter specified. @KoningJasper in https://github.com/databricks/databricks-cli/pull/398 | Low | 10/21/2021 |
| 0.16.1 | ## What's Changed * Moved warnings to stderr from stdout for some newly introduced warnings by @borremosch-db in https://github.com/databricks/databricks-cli/pull/394 * Fix passing version has headers in Jobs Api by @KoningJasper in https://github.com/databricks/databricks-cli/pull/396 | Low | 10/20/2021 |
| 0.16.0 | ## What's Changed 1. Allow users to use API 2.1 (with a different format) for jobs 2. Adds ability to list jobs by type. 3. Adds CLI config file (.databrickscfg) to .gitignore | Low | 10/19/2021 |
| 0.15.0 | Add the `repos` command group for managing repos with commands `get`, `list`, `create`, `update`, `delete` (https://github.com/databricks/databricks-cli/pull/380) | Low | 8/6/2021 |
| 0.14.3 | * Fix "configure --aad-token" command (#364) * [SC-71389] Better exceptions for Pipelines CLI (#365) | Low | 3/17/2021 |
| 0.14.2 | Add modification_time field to `databricks fs ls -l <path>` (aka `dbfs ls -l <path>`). Modification time of requested path/file will be printed. | Low | 2/26/2021 |
| 0.14.1 | Fix a bug where we were using an unsupported click operation. | Low | 11/20/2020 |
| 0.14.0 | Add the `pipelines list` command to list Delta Pipelines that have been deployed (#333) | Low | 11/6/2020 |
| 0.13.0 | Changelog ------------ * Remove dependency to `tenacity`. * Add retries with exponential backoff on `429` status code for all HTTP requests sent through `databricks_cli.sdk.ApiClient`. | Low | 10/21/2020 |
| 0.12.2 | Fixing bug with creation of databricks-backed secret scope | Low | 10/13/2020 |
| 0.12.0 | Changelog ------------ * Update `pipelines` command to reflect changes in the API (https://github.com/databricks/databricks-cli/pull/304, https://github.com/databricks/databricks-cli/pull/308, https://github.com/databricks/databricks-cli/pull/317, @mukulmurthy, @rgovind3, @aakash-db) * Add support for cluster policies (https://github.com/databricks/databricks-cli/pull/303, @itaiw) * Add `tokens` command to expose the tokens API (https://github.com/databricks/databricks-cli/pull/246, @areese, | Low | 9/23/2020 |
| 0.11.0 | Changelog ------------ * Add the `pipelines` command group for managing Delta Pipelines with the initial commands `deploy`, `delete`, `get`, and `reset` (https://github.com/databricks/databricks-cli/pull/300, @arulajmani, @mukulmurthy, and @null-sleep) * Require configparser only in python < 3.6 (#287, @acxz) * Support writeStatus flag in resource configuration in stack API (#290, @xuanwang14) | Low | 6/2/2020 |
| 0.10.0 | Changelog ------------ * Fix issue https://github.com/databricks/databricks-cli/issues/264. Add `init_scripts` optional argument to `create_cluster` and `edit_cluster` (https://github.com/databricks/databricks-cli/pull/266, @malthe) * Add DBC format support to Workspace API (https://github.com/databricks/databricks-cli/pull/276, @svar29) * Improve developer experience and error handling: when deleting directory structures recursively using `rm -r`, the user is presented with the progress of | Low | 4/1/2020 |
| 0.9.1 | Changelog ------------ * Extend Stack CLI to support HTML file format (#263, @lu-wang-dl) * Display Azure KeyVault URL for AKV-backed secret scope (#265, @nkangdatabricks) | Low | 10/31/2019 |
| 0.9.0 | Changelog ------------ * Jobs list will no longer throw if there are zero jobs (#230, @andrewmchen) * Add runs get output command (#247, @areese) * Add dbfs cat command (#226, @danielvdende) * Log request info when `--debug` flag is used (#248, @areese) * Add cluster events command (#238, @smurching) * Add instance pool command group (#250, @lianghe-databricks) | Low | 8/28/2019 |
| 0.8.7 | - Look for credentials in TaskContext when running in Spark Task on the executor (#232). | Low | 6/13/2019 |
| 0.8.6 | Changelog ------------ * Fix boolean query parameters to GET requests (#219, @andrewmchen) | Low | 3/20/2019 |
| 0.8.5 | Changelog ------------ * Use query parameters for GET calls to API (#213, @federicolanusse-DB) | Low | 3/12/2019 |
| 0.8.4 | Changelog ------------ * Add init scripts option in edit cluster SDK (#196, @lyle-nel) * Add permanent delete cluster feature (#200, @andrewmchen) * Bugfix to make uninstall all libraries not fail if there are no libraries (#201, @andrewmchen) * Bugfix to make workspace list handle new fields in the API such as created_at (#210, @andrewmchen) | Low | 2/13/2019 |
| 0.8.3 | Changelog ------------ * Add cluster resize support (#190, @justinmills) * Support Databricks URIs with query strings (#193, @andrewmchen) * Automatically initialize databricks-cli config provider when running inside Databricks notebooks (#194, @aarondav) | Low | 1/24/2019 |
| 0.8.2 | Changelog ------------ * Adds python wheel support in library commands (#168, @srinathshankar ) | Low | 8/23/2018 |
| 0.8.1 | Changelog ------------ * Allows users to specify the path of a .databrickscfg configuration file via the `DATABRICKS_CONFIG_FILE` environment variable (#164, @smurching ) * Updates to documentation (#163, @stbof) | Low | 8/13/2018 |
| 0.8.0 | Changelog ------------ - Allow users to set configs from environment variables (https://github.com/databricks/databricks-cli/pull/127)(@saileshkotha) - Groups CLI (https://github.com/databricks/databricks-cli/pull/114)(@diraol) - --debug flag (https://github.com/databricks/databricks-cli/pull/146)(@alinxie) - Internal refactoring of configuration module (https://github.com/databricks/databricks-cli/pull/158)(@aarondav) | Low | 8/7/2018 |
| 0.7.2 | Changelog ------------ - Add `--insecure` option to `databricks configure` which creates a configuration profile that can talk to shards with invalid SSL (https://github.com/databricks/databricks-cli/pull/118) - Make `setup.py` more robust by specifying encoding. | Low | 6/3/2018 |
| 0.7.1 | Changelog ------------ - Made small changes to the `secrets` command. Renaming some commands (https://github.com/databricks/databricks-cli/pull/119) | Low | 5/11/2018 |
| 0.7.0 | Changelog ------------ - Add new sub-command `secrets` (https://github.com/databricks/databricks-cli/pull/105) - Fix bug with basic authentication on python 3.6 (https://github.com/databricks/databricks-cli/pull/109) - Fix bug with DEFAULT profile section (https://github.com/databricks/databricks-cli/pull/108) | Low | 4/24/2018 |
| 0.6.0 | Changelog ------------ - Add support for python3 (https://github.com/databricks/databricks-cli/pull/89) | Low | 3/14/2018 |
| 0.5.0 | Changelog ------------ - Add support for libraries API (https://github.com/databricks/databricks-cli/pull/74) - Add support for profiles (https://github.com/databricks/databricks-cli/pull/64, https://github.com/databricks/databricks-cli/pull/81) | Low | 2/27/2018 |
| 0.4.2 | Changelog ------------ - Fix path separator on Windows (https://github.com/databricks/databricks-cli/pull/66) - Ignore hidden files option on `databricks workspace import_dir` (https://github.com/databricks/databricks-cli/pull/66) | Low | 2/16/2018 |
| 0.4.1 | Changelog -------------- Add critical fix to address https://github.com/databricks/databricks-cli/issues/36. The bug is that when we stripped the extension we used `rstrip` which does not do what we want. ``` 'apple-py.py'.rstrip('.py') == 'apple-' ``` | Low | 11/8/2017 |
| 0.4.0 | Changelog ------------- - Add support for Clusters API - Add support for Jobs API | Low | 11/7/2017 |
| 0.3.1 | Changelog ---------------- - Fixed some nits with workspace export. (Make exporting to directory munge target_path) | Low | 10/11/2017 |
| 0.3.0 | Changelog ------------- - Support workspace API (https://docs.databricks.com/user-guide/databricks-cli.html#workspace-cli-examples) | Low | 10/9/2017 |
| 0.2.0 | Changelog ------------ - Support token authentication (https://docs.databricks.com/administration-guide/admin-settings/tokens.html#rest-api-tokens) | Low | 9/12/2017 |
