Quick setup guide for new developers cloning this dbt project.
- Python 3.12+
- Git
- uv (Python package manager)
- Dune API key
git clone <repo-url>
cd dune-dbt-template
uv syncChoose one method:
Method A: Add to shell profile (persistent)
# For zsh (default on macOS)
echo 'export DUNE_API_KEY=your_api_key_here' >> ~/.zshrc
echo 'export DUNE_TEAM_NAME=your_team_name' >> ~/.zshrc
echo 'export DEV_SCHEMA_SUFFIX=your_name' >> ~/.zshrc # Optional
source ~/.zshrc
# For bash
echo 'export DUNE_API_KEY=your_api_key_here' >> ~/.bashrc
echo 'export DUNE_TEAM_NAME=your_team_name' >> ~/.bashrc
echo 'export DEV_SCHEMA_SUFFIX=your_name' >> ~/.bashrc # Optional
source ~/.bashrc
# For fish
echo 'set -x DUNE_API_KEY your_api_key_here' >> ~/.config/fish/config.fish
echo 'set -x DUNE_TEAM_NAME your_team_name' >> ~/.config/fish/config.fish
echo 'set -x DEV_SCHEMA_SUFFIX your_name' >> ~/.config/fish/config.fish # Optional
source ~/.config/fish/config.fishMethod B: Export for current session (temporary)
# bash/zsh
export DUNE_API_KEY=your_api_key_here
export DUNE_TEAM_NAME=your_team_name
export DEV_SCHEMA_SUFFIX=your_name # Optional
# fish
set -x DUNE_API_KEY your_api_key_here
set -x DUNE_TEAM_NAME your_team_name
set -x DEV_SCHEMA_SUFFIX your_name # OptionalMethod C: Inline with commands (one-off)
DUNE_API_KEY=your_api_key_here DUNE_TEAM_NAME=your_team_name uv run dbt debug# Install dbt packages
uv run dbt deps
# Test connection
uv run dbt debugYou should see: All checks passed!
# Run all models (writes to dev schema)
uv run dbt run
# Run tests
uv run dbt test
# View documentation
uv run dbt docs generate && uv run dbt docs servedev(default): Writes to{team}__tmp_{suffix}schemas - safe for developmentprod: Writes to{team}schemas - production tables (use with caution)
To use prod target:
uv run dbt run --target prodIf this repo was created from the dune-dbt-template, you can pull in updates:
Set up upstream (one-time):
git remote add upstream https://github.com/duneanalytics/dune-dbt-template.git
git fetch upstreamPull in template updates:
git fetch upstream
git checkout main
git merge upstream/main # Review and resolve conflicts as needed
git push origin mainBest practices:
- Review changes before merging to ensure they align with your project
- Test thoroughly after merging template updates
- Consider selective merging if only certain updates are needed
- Read Development Workflow to learn the recommended process
- Review dbt Best Practices for repo-specific patterns
- Check SQL Style Guide for formatting standards