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" # default
  # 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 /Users/jairus.martinez/.dbt/dbt_cloud.yml:

active-hosts:
  - default (active): cloud.getdbt.com
  - custom (inactive): [identifier].us[#].dbt.com

active-projects:
  - proj_1 (active): 123456
  - proj_2 (inactive): 234567
  - proj_3 (inactive): 345678

The script identifies options by their comment (e.g., # proj_1). If a comment is not present, it will use the value of the property itself (e.g., the project ID or host URL).

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.21.tar.gz (4.3 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.21-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for dbt_switch-0.1.21.tar.gz
Algorithm Hash digest
SHA256 d13fecda2d6a1470a4754ee423868409cfef7754a7e2cfd9c02c8a4f7ec0961c
MD5 bf01053a2e9145a1c5d4e4a487ce72f3
BLAKE2b-256 a90e94dcb598c39e0bcdddd40eaffc91c9efacf78d6e833fd67ab77190496615

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dbt_switch-0.1.21-py3-none-any.whl
Algorithm Hash digest
SHA256 d92d448a196fa761c5269759ef757e6f852189d5f3afb5e9c44380d5d9dc2be9
MD5 1386d5618d0bd7ebc3dee245c9767909
BLAKE2b-256 c7c0c1cf65b899d497fa23a5c17677d9c8cd2d1c74e334cd7515a0bc922b6cf7

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