Skip to main content

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

Project description

dbt-switch

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

Usage

# Switch to a specific project and host
dbt-switch --proj proj_2 --host default

# Switch only the project (host stays the same)
dbt-switch --proj proj_1

# Switch only the host (project stays the same)
dbt-switch --host default

# See all available options
dbt-switch --list

Example

Given a dbt_cloud.yml file like this:

# dbt_cloud.yml
version: "1"
context:
  active-host: "cloud.getdbt.com" # prod
  # active-host: "[identifier].us[#].dbt.com" # custom

  active-project: "123456" # proj_1
  # active-project: "234567" # proj_2
  # active-project: "345678" # proj_3

You can see the available options with dbt-switch --list:

$ dbt-switch --list

Available options in dbt_cloud.yml:

active-hosts:
  - default (active)
  - custom (inactive)

active-projects:
  - proj_1 (active)
  - proj_2 (inactive)
  - proj_3 (inactive)

Switch to the custom host and the proj_3 project:

$ dbt-switch --host custom --proj proj_3

✓ Deactivated active-host: default
✓ Activated active-host: custom
✅ Successfully updated dbt_cloud.yml
✓ Deactivated active-project: proj_1
✓ Activated active-project: proj_3
✅ Successfully updated dbt_cloud.yml

The dbt_cloud.yml file will be updated to:

# dbt_cloud.yml
version: "1"
context:
  # active-host: "cloud.getdbt.com" # default
  active-host: "[identifier].us[#].dbt.com" # custom

  # active-project: "123456" # proj_1
  # active-project: "234567" # proj_2
  active-project: "345678" # proj_3

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.1.0.tar.gz (4.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.1.0-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for dbt_switch-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c0f0b7cc26262c5155c5b287a10547a47179ffb38494a13579c57138b55c44ca
MD5 7987bab157c371b7fc7c2373adf5c220
BLAKE2b-256 feb80b63de51b43d2d4618130737c458e72c299924f1a17ae7fe4762563b1120

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for dbt_switch-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2baf549392f0b443a6c80cdbf91da7a650c980586710ff1a9182d04addbd1559
MD5 27c7d4db47e5191bc716eba31f01eb72
BLAKE2b-256 c0ae47281626cf9d45d162cc1e3a38cb66f25e2e9c268a267cbd4477ce09bf33

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