cbt tool overview

The cbt tool is a command-line interface for performing several different operations on Cloud Bigtable. It is written in Go using the Go client library for Cloud Bigtable. Source code for the cbt tool is available in the GitHub repository GoogleCloudPlatform/google-cloud-go. This repository is a mirror of code.googlesource.com/gocloud.

For information about Cloud Bigtable in general, see the Overview of Cloud Bigtable.

Installing the cbt tool

You can install the cbt tool as a Cloud SDK component or by using the standard go tool.

Cloud SDK

This installation path is recommended if you work with multiple Google Cloud products.

  1. Install the Cloud SDK.
  2. Run the following commands:

      gcloud components update
      gcloud components install cbt

    If the tool is already installed, the terminal window displays the message All components are up to date.

Go tool

If you have the latest stable release of the go tool installed, you can install the cbt tool using the following command:

go get -u cloud.google.com/go/bigtable/cmd/cbt

Verifying the installation

Run a cbt command to verify installation of the tool:

cbt listinstances

The terminal window displays two columns named Instance Name and Info.

Creating a .cbtrc file

  1. Configure cbt to use your project and instance by creating a .cbtrc file, replacing project-id with the ID for the project where you created your Cloud Bigtable instance:

       echo project = project-id > ~/.cbtrc
       echo instance = quickstart-instance >> ~/.cbtrc

  2. Verify that you set up the .cbtrc file correctly:

       cat ~/.cbtrc

    The terminal displays the contents of the .cbtrc file, which looks similar to the following:

    project = project-id
    instance = quickstart-instance

    Now you can use the cbt tool with your instance.

Using the cbt tool

For details about using the cbt tool, including a list of available commands, see the cbt reference.