Skip to main content

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

Project description

dbt-switch

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.

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

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

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.6.tar.gz (10.7 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.6-py3-none-any.whl (13.4 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for dbt_switch-0.2.6.tar.gz
Algorithm Hash digest
SHA256 0bb6eb43ec4d29a2d8a21a43ffc82f7cbbdd92ddb5e6c4ab18751c7fb5bb1896
MD5 014ea22ff17c0c0904f005c8e7132eb7
BLAKE2b-256 d095dcb8939a7e13c0725b188c185ee76604eeeeae6edc0718e4176f90b5f9ee

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for dbt_switch-0.2.6-py3-none-any.whl
Algorithm Hash digest
SHA256 757ae66fe278b794c8d78b005bb273b10219876c67369a9f4c934be44248c503
MD5 850d93407375ce6f256a24cdd1cb29aa
BLAKE2b-256 f5d0189b9d0d929cd9d0b2f00703068d119e9d616511a27d12dd3beaf17dba27

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