cbt CLI overview
The
cbt
CLI
is a command-line interface for performing several
different operations on Bigtable . It is written in Go using the
Go client library for Bigtable . Source code for the
cbt
CLI
is available in the
GoogleCloudPlatform/google-cloud-go GitHub repository. This
repository is a mirror of code.googlesource.com/gocloud.
For information about Bigtable in general, see the overview of Bigtable.
Install the
cbt
CLI
You can install the
cbt
CLI
as a
gcloud CLI component.
The
cbt
CLI
does not implement smart retries or error handling. When working in production
environment, use a Bigtable client library or the Google Cloud console.
- Install the gcloud CLI.
Run the following commands:
gcloud components update gcloud components install cbt
If the
cbt
CLI is already installed, the terminal window displays theAll components are up to date
message.
Verify the installation
Run a
cbt
CLI
command to verify installation of the CLI:
cbt listinstances
The terminal window displays two columns named Instance Name
and Info
.
Create a .cbtrc file
You can store required options and parameters, such as -project
, -instance
, -creds
, -admin-endpoint
, or -data-endpoint
options, in a single .cbtrc
file for convenience.
In your
.cbtrc
file, configurecbt
to use your project and instance by replacing project-id with the ID for the project where you created your Bigtable instance:echo project = project-id > ~/.cbtrc
echo instance = quickstart-instance >> ~/.cbtrc
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 settings:project = project-id instance = quickstart-instance
Now you can use the
cbt
CLI with your instance.
Use the
cbt
CLI
For details about using the
cbt
CLI
, including a list of available commands,
see the
cbt
CLI
reference.