dbtp is a Rust CLI for the dbt Cloud Platform APIs.
- About this document
- Getting the code
- Setting up an environment
- Running in development
- Testing
- Adding a changelog entry
- Submitting a Pull Request
There are many ways to contribute — opening issues, joining discussions, or submitting code changes. This document focuses on the latter. It assumes familiarity with Rust and the command line.
If you get stuck, open a GitHub Discussion or file an issue.
- Branches: All pull requests should target the
mainbranch. - CLA: Contributions are accepted under the Apache-2.0 license.
- Rust (stable toolchain)
git
External contributors should fork the repository, then clone their fork:
git clone https://github.com/<your-username>/dbtp.git
cd dbtpdbt Labs contributors can clone directly and push to a feature branch.
No additional setup is required beyond a working Rust toolchain. Install or update via:
rustup update stableBuild and run directly with cargo:
cargo build # debug build
cargo run -- projects list # run a command
cargo run -- --help # top-level helpSet environment variables to avoid passing flags every run:
export DBTP_TOKEN=<your-token>
export DBTP_ACCOUNT_ID=<your-account-id>Currently there is no automated test suite — commands are tested manually against a live dbt Cloud instance with the environment variables above.
When adding tests in the future, prefer unit tests for pure logic (URL construction, argument parsing, response formatting) that do not require network access.
cargo test # runs any tests in the repoCI enforces formatting and lints. Run these locally before pushing:
cargo fmt --check # check formatting (run `cargo fmt` to fix)
cargo clippy -- -D warnings # lintsWe use changie to manage the CHANGELOG.md. Do not edit CHANGELOG.md directly.
Install changie, then run:
changie newCommit the generated file in .changes/unreleased/ alongside your PR.
- Create a branch off
main. - Make your changes and ensure
cargo build,cargo fmt --check, andcargo clippy -- -D warningsall pass. - Add a changelog entry with
changie new. - Open a PR against
main. A maintainer will review and merge.
CI runs automatically on all PRs. Once checks pass and the PR is approved, a maintainer will merge it.