Skip to main content

A simple CLI to switch between dbt Cloud projects and hosts.

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dbt_switch-0.2.7.tar.gz (14.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dbt_switch-0.2.7-py3-none-any.whl (16.5 kB view details)

Uploaded Python 3

File details

Details for the file dbt_switch-0.2.7.tar.gz.

File metadata

  • Download URL: dbt_switch-0.2.7.tar.gz
  • Upload date:
  • Size: 14.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.8

File hashes

Hashes for dbt_switch-0.2.7.tar.gz
Algorithm Hash digest
SHA256 0eb81841a6335986fdd1ad744a0bbbd40576600f922df18021c3b2704edd6c9e
MD5 f370e5dd298273f34d4fbe16b1907184
BLAKE2b-256 5ab4d17111ee29c3e5bb7ae47b960ba4282a765eeef530370b2ca5f37eb9039d

See more details on using hashes here.

File details

Details for the file dbt_switch-0.2.7-py3-none-any.whl.

File metadata

  • Download URL: dbt_switch-0.2.7-py3-none-any.whl
  • Upload date:
  • Size: 16.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.8

File hashes

Hashes for dbt_switch-0.2.7-py3-none-any.whl
Algorithm Hash digest
SHA256 b2127a187a5cf8a26d26a6b468fe2ca648ce58bd55108cfefbac477038c03bb7
MD5 cc257d793791cf690c5e429efbb388f8
BLAKE2b-256 60d38cedfc0d427a7b8870b90e92352310d011701667e44f0ddbb7fac7abdd5a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page