CLI Cheatsheet

A quick recap of bauplan commands and their intended semantics:

Install and Status

Command / Description

pip install bauplan --upgrade

Install the latest version of Bauplan.

bauplan version

Show the version of the Bauplan CLI.

bauplan help

Show a list of available commands or help for one command.

Git and Explore

Command / Description

bauplan branch create <YOUR_USERNAME>.<BRANCH_NAME>

Show all the active branches of the user.

bauplan branch checkout <YOUR_USERNAME>.<BRANCH_NAME>

Checkout a given branch (switch the active branch )

bauplan branch

Show all the available branches to the user - the active branch marked with a star.

bauplan branch --all-zones

Show all open branches, not only those of the user.

bauplan branch rm <YOUR_USERNAME>.<BRANCH_NAME>

Delete branch (you can only delete your own branches).

bauplan branch get <YOUR_USERNAME>.<BRANCH_NAME>

Show all the table in a specific branch.

bauplan branch merge <YOUR_USERNAME>.<BRANCH_NAME>

Merge the branch to main. The active branch must be main.

bauplan table

Show all the table in the active branch.

bauplan table get <USERNAME>.<TABLE_NAME>

Show table metadata for a specific table in the active branch.

bauplan diff <USERNAME>.<BRANCH_NAME/TABLE_NAME>

Show the diff between the active branch and a certain branch.

Run

Command / Description

bauplan run

Execute a Bauplan run from the current folder in the active branch.

bauplan run --head

Execute a Bauplan run from the current folder and visualize a preview of the tables in the terminal.

bauplan run --id <RUN_ID>

Reproduces a previous run identified by its runID.

bauplan run --strict

Execute a Bauplan run while enforcing data contracts.

Query

Command / Description

bauplan query --branch <USERNAME>.<BRANCH_NAME> "SELECT col FROM table_name WHERE condition=value"

Run the query against and display the results. If branch is omitted, default is main.

bauplan query --branch <USERNAME>.<BRANCH_NAME> -f <file.sql>

Pipe the content of a file, run the query and display the results. If branch is omitted, default is main.

Import

Command / Description

bauplan import plan --table mynewtable 's3:///<PATH>' [ --file <FILE> ]

Create an import plan file from a cloud storage path that create a new table. Optional: specify a custom output file.

bauplan import plan --table mynewtable --replace 's3:///<PATH>' [ --file <FILE> ]

Create an import plan file from a cloud storage path, to replace an existing table.

bauplan import plan --table mynewtable --append 's3:///<PATH>' [ --file <FILE> ]

Create an import plan file from a cloud storage path, to append data to an existing table.

bauplan import apply --branch <BRANCH> [ --file <PATH> ]

Execute an import job plan file against the given branch. Optional: specify a custom plan input file.