bb CLI is the command-line tool of Bytebase, helping developers integrate MySQL and PostgreSQL schema change into the existing CI/CD workflow. By integrating bb with your existing CI/CD system (GitLab CI, GitHub Actions, etc.), you can bring all best practices of CI/CD to the database.
This page contains a getting-started covering frequently used commands.
To install bb, just paste the following command in a macOS Terminal or Linux shell prompt:
This installs bb in /usr/local/bin. Run the following command to check if bb is installed:
And the output will look like this:
Start a local MySQL server via Docker
To use bb, you need a database. You can start an empty MySQL docker container (make sure the Docker Engine is running):
Restore sample database
After the MySQL server has started, you can restore an example database from our quickstart:
View current schema
To view the current schema, you can dump schema to stdout:
Apply database migration
Say you want to add a phone_no column to the table author. This is a so-called database migration and you can use bb migrate to do so:
After migration, you can dump again to check if the migration has executed successfully: