Initialize Projects
How to use the init command to set up Buster projects
Overview of the buster init
Command
The buster init
command streamlines the process of setting up a new Buster project. It creates a buster.yml
configuration file and helps connect your data warehouse in a single guided workflow.
Basic Usage
To initialize a new Buster project:
Running this command will start an interactive setup process that:
- Creates a
buster.yml
file in your current directory - Helps you connect to your data warehouse
- Configures model paths and database settings
- Optionally generates semantic models from your dbt catalog
Connecting a Data Source
When you run buster init
, you’ll be guided through connecting your data warehouse:
-
You’ll first be asked to select your data warehouse type from the supported options:
- Postgres
- BigQuery
- Snowflake
- Redshift
- MySQL
- SQL Server
- Databricks
- ClickHouse
- StarRocks
- Supabase
-
Based on your selection, you’ll be prompted for the required connection details:
- Host/endpoint
- Port
- Database name
- Schema
- Username and password (or other authentication details)
-
The command will test the connection to ensure everything is working properly
-
Upon successful connection, the credentials will be securely stored
Configuring Your Project
After connecting your data source, you’ll be asked to configure your project:
- Data Source Name: A unique identifier for this connection
- Database: The database to connect to
- Schema: The schema containing your models
- Model Paths: Directories containing your dbt models or SQL files
- Semantic Model Paths (Optional): Custom directories for your semantic model YAML files
Discovering dbt Projects
The init
command automatically detects and integrates with dbt projects:
- It looks for common dbt configuration files (
dbt_project.yml
, etc.) - It identifies model paths based on dbt project settings
- It finds your dbt catalog files for semantic model generation
For more details on working with dbt, see our complete guide to Integrating with dbt.
Generating Semantic Models
The init
command includes integration with the generate
command, letting you:
- Automatically discover your dbt catalog
- Generate initial semantic models based on your database schema and dbt models
- Place these models alongside your SQL files or in a dedicated directory
Example Flow
Here’s an example of initializing a project with a Postgres database:
Configuration File
The init
command creates a buster.yml
file with your configuration:
Additional Options
The init
command supports several flags to customize behavior:
--no-interactive
: Run in non-interactive mode (useful for scripts)--project-file FILE
: Specify a custom location for the buster.yml file--data-source NAME
: Pre-select a data source name--database-type TYPE
: Pre-select a database type--generate-models
: Automatically generate semantic models--skip-connection-test
: Skip testing the database connection
Next Steps
After initializing your project:
- Review the generated
buster.yml
file - Examine any generated semantic models and enhance them as needed
- Run
buster deploy
to deploy your project
Related Commands
buster generate
- Generate semantic models from your dbt catalogbuster deploy
- Deploy your project to the Buster platform