LinuxCommandLibrary

cbt

TLDR

List all tables in an instance

$ cbt -project [project_id] -instance [instance_id] ls
copy
Read rows from a table
$ cbt -project [project_id] -instance [instance_id] read [table_name]
copy
Count rows in a table
$ cbt -project [project_id] -instance [instance_id] count [table_name]
copy
Create a new table
$ cbt -project [project_id] -instance [instance_id] createtable [table_name]
copy
Create a column family
$ cbt -project [project_id] -instance [instance_id] createfamily [table_name] [family_name]
copy
Write a value to a cell
$ cbt -project [project_id] -instance [instance_id] set [table_name] [row_key] [family]:[column]=[value]
copy

SYNOPSIS

cbt [-project project] [-instance instance] [-creds file] [-timeout duration] command [arguments...]

DESCRIPTION

cbt is a command-line interface for Google Cloud Bigtable, a fully managed NoSQL database service. It allows performing administrative and data operations on Bigtable instances, tables, column families, and rows.
The tool can be configured via a ~/.cbtrc file containing project and instance defaults, or by passing flags directly.

PARAMETERS

-project projectid_

Google Cloud project ID. Uses gcloud default if unset
-instance instanceid_
Cloud Bigtable instance name
-creds file
Path to credentials JSON file
-timeout duration
Operation timeout (e.g., 10s, 5m)
Common commands:
ls - List tables
read table - Read rows from table
count table - Count rows in table
createtable table - Create a table
deletetable table - Delete a table
createfamily table family - Create column family
set table row family:col=val - Write cell value
deleterow table row - Delete a row
help - Print help text

CAVEATS

The cbt CLI does not implement smart retries or advanced error handling. For production environments, use a Bigtable client library or the Google Cloud console instead.
Bash shell syntax rules apply: values with spaces or operators require quotes, and arbitrary byte values need dollar-sign prefix with single quotes.

HISTORY

The cbt tool was developed by Google as part of the Cloud Bigtable ecosystem, written in Go using the official Go client library for Bigtable. It provides a quick way to interact with Bigtable for development and debugging purposes.

SEE ALSO

gcloud(1), bq(1)

Copied to clipboard