Skip to main content

dbt-switch

Ask DeepWiki

A simple CLI tool to manage and switch between dbt Cloud projects and hosts. Solves the pain point of manually updating active-host and active-project in your dbt_cloud.yml when working with multiple dbt Cloud accounts. Read more about it here!

The crux of the issue is documented in this dbt forum post: dbt Cloud CLI - Connect to Mulitple Hosts.

Two ways to use dbt-switch: run the CLI commands yourself, or let an AI agent handle setup and day-to-day usage for you. Both paths are documented below.

Requirements

Important Setup Step

You must manually merge your dbt_cloud.yml files from different accounts into one file.

If you work with multiple dbt Cloud accounts, you'll have separate dbt_cloud.yml files for each account. You need to combine all the projects sections into a single ~/.dbt/dbt_cloud.yml file before using dbt-switch.

Documentation

📚 See the Complete Usage Guide for detailed examples of the merged file structure.

Installation

uv tool install dbt-switch

Quick Start

# Initialize the configuration file
dbt-switch init

# Add a new project (interactive)
dbt-switch add

# Add a new project (non-interactive)
dbt-switch add my-project --host https://cloud.getdbt.com --project-id 12345

# List all configured projects
dbt-switch list

# Switch to a project
dbt-switch -p my-project

AI-Assisted Setup & Usage

dbt-switch ships with agent skill prompts that you can pass directly to an AI (e.g. Claude Code) to automate setup or day-to-day project management.

# Print the setup prompt (merging dbt_cloud.yml files + configuring dbt-switch)
dbt-switch skill --init

# Print the usage prompt (switching, adding, updating, deleting projects)
dbt-switch skill --usage

# Print both
dbt-switch skill

How to use: run one of the commands above from within an AI coding session (e.g. Claude Code) or copy the output and paste it into your AI assistant as a system/user prompt. The agent will guide you through the workflow — you just download the files (for --init) or describe what you want to do (for --usage).

Key Features

  • Manage multiple dbt Cloud projects across different accounts
  • Switch projects instantly with a simple command
  • Interactive and non-interactive modes for different workflows
  • Update project configurations easily (host, project ID, or both)

Documentation

Complete Usage Guide - Detailed documentation with examples, configuration files, and command reference

How It Works

  1. Store configurations: Define your projects in ~/.dbt/dbt_switch.yml
  2. Switch instantly: Update active-host and active-project in your ~/.dbt/dbt_cloud.yml
  3. Keep your data: All tokens and project configurations are preserved

Example workflow:

# Add your projects
dbt-switch add alpha --host cloud.getdbt.com --project-id 12345
dbt-switch add beta --host xyz123.us1.dbt.com --project-id 67890

# Switch between them
dbt-switch -p alpha    # Now using Alpha Industries project
dbt-switch -p beta     # Now using Beta Corp project

Metadata

Release files for dbt-switch 0.2.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dbt-switch 0.2.7
File Size Uploaded Provenance Actions
dbt_switch-0.2.7.tar.gz 14.0 kB Without provenance Details for dbt_switch-0.2.7.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for dbt-switch 0.2.7
File Interpreter ABI Platform Actions
dbt_switch-0.2.7-py3-none-any.whl Python 3 none any Details for dbt_switch-0.2.7-py3-none-any.whl

Total release size: 30.5 kB

Release files / dbt_switch-0.2.7.tar.gz

Download URL dbt_switch-0.2.7.tar.gz
Size 14.0 kB
Tags Source
SHA-256 checksum
How to use checksums
0eb81841a6335986fdd1ad744a0bbbd40576600f922df18021c3b2704edd6c9e
BLAKE2b-256 checksum
How to use checksums
5ab4d17111ee29c3e5bb7ae47b960ba4282a765eeef530370b2ca5f37eb9039d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.8

Release files / dbt_switch-0.2.7-py3-none-any.whl

Download URL dbt_switch-0.2.7-py3-none-any.whl
Size 16.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b2127a187a5cf8a26d26a6b468fe2ca648ce58bd55108cfefbac477038c03bb7
BLAKE2b-256 checksum
How to use checksums
60d38cedfc0d427a7b8870b90e92352310d011701667e44f0ddbb7fac7abdd5a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.8

Security for dbt-switch 0.2.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page