How can I work with Databricks outside the workspace?
Summary
- Most Databricks work doesn't require the workspace UI. The Databricks CLI, REST API, SDKs, SQL drivers, IDE tools and coding agents let you work from a terminal, an editor, an application or a pipeline.
- The Databricks CLI wraps the Databricks REST API, so you can script workspace and account operations from your local terminal or from automation, and run Declarative Automation Bundles for CI/CD.
- For development, the SSH tunnel (Beta), Databricks Connect and the Databricks IDE extension connect your local IDE to Databricks compute.
- For applications, SDKs for Python, JavaScript, Java, Go and R and SQL connectors and drivers, including JDBC, ODBC and the SQL Statement Execution API, bring Databricks data and resources into your own code.
- For AI agents, Genie Code CLI (Beta) runs a Databricks-tuned coding agent in your terminal, and managed MCP servers such as Genie One give other agents governed data access through Unity Gateway.
How can I work with Databricks outside the workspace?
Pick the interface that matches the job. Use the Databricks CLI for terminal work and scripts, Declarative Automation Bundles for CI/CD, the SSH tunnel or Databricks Connect for IDE development, SDKs and SQL drivers for applications, and Genie Code CLI or managed MCP servers for AI agents. These tools authenticate to Databricks as you, so Unity Catalog permissions still govern the workspace data you can reach.
Tools for working outside the workspace
| What you want to do | Tool | What to know |
|---|---|---|
| Run commands and shell scripts, manage auth profiles | Databricks CLI | Wraps the Databricks REST API; versions 1.0.0 and above are GA |
| Deploy projects with CI/CD | Declarative Automation Bundles | Define jobs, pipelines and other resources as source files, then validate and deploy with the CLI |
| Provision infrastructure as code | Databricks Terraform provider | Cloud accounts, workspaces, metastores and account-level identities |
| Develop in your IDE | SSH tunnel (Beta), Databricks Connect, the Databricks IDE extension | Choose by where you want code to execute |
| Build applications | Databricks SDKs for Python, JavaScript, Java, Go and R | Integrate with deployment systems and build custom workflows and services |
| Query data from apps and tools | SQL connectors and drivers | JDBC, ODBC, the SQL connector for Python, drivers for Go and Node.js, and the SQL Statement Execution API |
| Ask data questions from a terminal | databricks genie ask |
Returns an answer from Genie; add --include-sql to see the queries |
| Use a coding agent | Genie Code CLI (Beta), or another agent through the ug CLI |
Model access goes through Unity Gateway |
| Give external agents data tools | Genie One MCP server | Generally available; reached at its Unity Gateway URL with Unity Catalog permissions enforced |
| Run agents or untrusted code in isolation | Databricks Sandbox (Beta) | Serverless compute through the REST API, SDK or CLI |
When no SDK fits, the Databricks REST API gives "access to almost all Databricks resources," though the docs position it for advanced scenarios.
Developing from your IDE
Three tools connect a local editor to Databricks compute, and they differ in where your code runs:
- SSH tunnel (Beta). Connects Visual Studio Code, Cursor or your terminal to serverless compute, AI Runtime or a dedicated classic cluster. Python, the kernel and execution all run on Databricks. Start with
databricks ssh connectfor serverless, ordatabricks ssh setupfor a reusable connection to a classic cluster. It needs the Databricks CLI version 1.5.0 or above and uses HTTPS with WebSocket support, not port 22. - Databricks Connect. General code runs locally, while DataFrame operations and UDFs run on Databricks compute. It's available for Python, R and Scala and works with any IDE's native debugger.
- Databricks IDE extension. For Visual Studio Code and Cursor. It runs local files on Databricks compute or as Lakeflow Jobs, syncs code with your workspace and works with bundles.
The SSH tunnel and the IDE extension aren't compatible yet, so use one or the other.
Working with AI agents outside the workspace
Genie Code CLI is a coding agent that runs in your local terminal and is tuned for data and AI work on Databricks. It reads and edits local files, runs commands and uses the Databricks CLI to discover and query data. It runs under your identity, so Unity Catalog permissions apply to workspace operations, while local file and command operations aren't governed by Databricks.
If your team uses a different coding agent, install Databricks agent skills with databricks aitools install and connect managed MCP servers. The ug CLI launches supported agents with model traffic routed through Unity Gateway, where admins set budgets and track usage.
What stays the same outside the workspace
- Identity. The SSH tunnel and Databricks Sandbox automatically authenticate as the user who starts the session. Genie Code CLI runs under your own identity.
- Permissions. Genie Code CLI's workspace operations and Genie One MCP queries are subject to your Unity Catalog permissions.
- Files. Workspace files and Unity Catalog volumes remain the persistent locations. In an SSH session, files outside
/Workspace,/Volumesand/dbfsare lost on restart.
FAQs
Can I use the Databricks CLI without installing it locally?
Yes. You can run Databricks CLI commands from within a Databricks workspace using the web terminal. For local scripts and automation, install the CLI and configure authentication.
What's the best way to deploy work built outside the workspace?
Declarative Automation Bundles. They describe resources such as Lakeflow Jobs, pipelines and Model Serving endpoints as source files, so you can test and deploy them through CI/CD with the Databricks CLI.
Can external AI agents query my Databricks data?
Yes, through managed MCP servers such as Genie One, which Unity Gateway governs and which always enforce Unity Catalog permissions.
Are all of these tools generally available?
No. The SSH tunnel, Databricks Sandbox and Genie Code CLI are in Beta. The Databricks CLI from version 1.0.0 and the Genie One MCP server are generally available.
The information provided herein is for general informational purposes only and may not reflect the most current product capabilities or configurations.